Skip to content

Commit

Permalink
Merge pull request #82 from SMTheGuild/dev
Browse files Browse the repository at this point in the history
Ascii Block, Wings, Time Block, Smart Totebot
  • Loading branch information
QuestionableM authored Feb 10, 2024
2 parents 355e2f7 + 1807302 commit c4f430c
Show file tree
Hide file tree
Showing 33 changed files with 125 additions and 60 deletions.
4 changes: 2 additions & 2 deletions Effects/Database/EffectSets/customeffects.json
Original file line number Diff line number Diff line change
Expand Up @@ -955,15 +955,15 @@
{
"parameterList":
{
"velocity": 0.0,
"velocity_max_50": 0.0,
"Intensity": 30.0
},
"effectList":
[
{
"type": "audio",
"name": "event:/props/challengeball_rolling",
"parameters": [ "velocity" ]
"parameters": [ "velocity_max_50" ]
}
]
}
Expand Down
10 changes: 5 additions & 5 deletions Objects/Database/ShapeSets/scriptedparts.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
},
{
"uuid": "6613bebe-be9f-435c-b415-42a0b45cc8e3", // date time clock block
"renderable": "$CONTENT_DATA/Objects/Renderables/placeholder_1x1x1.rend",
"renderable": "$CONTENT_DATA/Objects/Renderables/obj_interactive_analogclock.rend",
"scripted": { "filename": "$MOD_DATA/Scripts/interactable/NumberOut/TimeBlock.lua", "classname": "TimeBlock" },
"color": "df7f00",
"color": "3e9ffe",
"hull": {
"x":1,"y":1,"z":1,"margin":0.05,
"pointList":[
Expand Down Expand Up @@ -986,7 +986,7 @@
},
{
"uuid": "e2cc7014-85f3-4bb8-a7ca-b70b6502d91e", // large wing
"renderable": "$CONTENT_DATA/Objects/Renderables/placeholder_4x1x4.rend",
"renderable": "$CONTENT_DATA/Objects/Renderables/obj_interactive_wings_01.rend",
"scripted": { "filename": "$MOD_DATA/Scripts/interactable/Locomotion/FlappyWing.lua", "classname": "FlappyWing",
"data": {
"animationName": "Flap", "animationLoop": false,
Expand Down Expand Up @@ -1028,7 +1028,7 @@
},
{
"uuid": "b5222776-1702-4c22-a8c5-ca26cc0290e7", // small wing propeller
"renderable": "$CONTENT_DATA/Objects/Renderables/placeholder_1x1x1.rend",
"renderable": "$CONTENT_DATA/Objects/Renderables/obj_interactive_wings_02.rend",
"scripted": { "filename": "$MOD_DATA/Scripts/interactable/Locomotion/FlappyWing.lua", "classname": "FlappyWing",
"data": {
"animationName": "Rotation", "animationLoop": true,
Expand Down Expand Up @@ -1298,4 +1298,4 @@
"sticky": "-Z-Y-X+X"
}
]
}
}
Binary file not shown.
Binary file modified Objects/Mesh/MeshNew/obj_interactive_textblock_01.fbx
Binary file not shown.
Binary file added Objects/Mesh/MeshNew/obj_interactive_wings_01.fbx
Binary file not shown.
Binary file added Objects/Mesh/MeshNew/obj_interactive_wings_02.fbx
Binary file not shown.
23 changes: 23 additions & 0 deletions Objects/Renderables/obj_interactive_analogclock.rend
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"lodList": [
{
"animationList": [
{
"file": "$CONTENT_DATA/Objects/Mesh/MeshNew/obj_interactive_analogclock.fbx",
"name": "clock_anim"
}
],
"mesh": "$CONTENT_DATA/Objects/Mesh/MeshNew/obj_interactive_analogclock.fbx",
"subMeshList": [
{
"material": "SkelAnimDifAsgNor",
"textureList": [
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_analogclock_dif.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_analogclock_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_analogclock_nor.tga"
]
}
]
}
]
}
14 changes: 11 additions & 3 deletions Objects/Renderables/obj_interactive_textblock_01.rend
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
{
"material" : "DifAsgNor",
"textureList" : [
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_dif.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_nor.tga"
"$CONTENT_DATA/Objects/Textures/letterblock_whiteletters_dif.png",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_screen_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_screen_nor.tga"
]
},
{
Expand All @@ -24,6 +24,14 @@
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_screen_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_screen_nor.tga"
]
},
{
"material" : "DifAsgNor",
"textureList" : [
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_dif.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_nor.tga"
]
}
]
}
Expand Down
14 changes: 11 additions & 3 deletions Objects/Renderables/obj_interactive_textblock_02.rend
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
{
"material" : "DifAsgNor",
"textureList" : [
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_dif.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_nor.tga"
"$CONTENT_DATA/Objects/Textures/letterblock_blackletters_dif.png",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_screen_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_screen_nor.tga"
]
},
{
Expand All @@ -24,6 +24,14 @@
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_screen_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_screen_nor.tga"
]
},
{
"material" : "DifAsgNor",
"textureList" : [
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_dif.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_nor.tga"
]
}
]
}
Expand Down
14 changes: 11 additions & 3 deletions Objects/Renderables/obj_interactive_textblock_03.rend
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
{
"material" : "DifAsgNor",
"textureList" : [
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_dif.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_nor.tga"
"$CONTENT_DATA/Objects/Textures/letterblock_paintletters_dif.png",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_screen_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_screen_nor.tga"
]
},
{
Expand All @@ -24,6 +24,14 @@
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_screen_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_screen_nor.tga"
]
},
{
"material" : "DifAsgNor",
"textureList" : [
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_dif.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_textblock_01_nor.tga"
]
}
]
}
Expand Down
24 changes: 24 additions & 0 deletions Objects/Renderables/obj_interactive_wings_01.rend
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"lodList" : [
{
"mesh" : "$CONTENT_DATA/Objects/Mesh/MeshNew/obj_interactive_wings_01.fbx",
"animationList" : [
{
"file" : "$CONTENT_DATA/Objects/Mesh/MeshNew/obj_interactive_wings_01.fbx",
"name" : "Flap"
}
],
"subMeshList" : [
{
"material" : "SkelAnimDifAsgNorAo",
"textureList" : [
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_atlaswings_dif.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_atlaswings_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_atlaswings_nor.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_wings_01_ao.tga"
]
}
]
}
]
}
24 changes: 24 additions & 0 deletions Objects/Renderables/obj_interactive_wings_02.rend
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"lodList" : [
{
"mesh" : "$CONTENT_DATA/Objects/Mesh/MeshNew/obj_interactive_wings_02.fbx",
"animationList" : [
{
"file" : "$CONTENT_DATA/Objects/Mesh/MeshNew/obj_interactive_wings_02.fbx",
"name" : "Rotation"
}
],
"subMeshList" : [
{
"material" : "SkelAnimDifAsgNorAo",
"textureList" : [
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_atlaswings_dif.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_atlaswings_asg.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_atlaswings_nor.tga",
"$CONTENT_DATA/Objects/Textures/TexturesNew/obj_interactive_wings_02_ao.tga"
]
}
]
}
]
}
17 changes: 0 additions & 17 deletions Objects/Renderables/placeholder_1x1x1.rend

This file was deleted.

17 changes: 0 additions & 17 deletions Objects/Renderables/placeholder_4x1x4.rend

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Objects/Textures/placeholder.png
Binary file not shown.
22 changes: 13 additions & 9 deletions Scripts/interactable/NumberOut/TimeBlock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,27 @@ dofile "../../libs/load_libs.lua"

print("loading TimeBlock.lua")

---@class TimeBlock : ShapeClass
---@field lastClockvalue integer
TimeBlock = class( nil )
TimeBlock.maxParentCount = 0
TimeBlock.maxChildCount = -1
TimeBlock.connectionInput = sm.interactable.connectionType.none
TimeBlock.connectionOutput = sm.interactable.connectionType.power
TimeBlock.colorNormal = sm.color.new( 0xccccccff )
TimeBlock.colorHighlight = sm.color.new( 0xF2F2F2ff )
TimeBlock.poseWeightCount = 2
TimeBlock.poseWeightCount = 0


function TimeBlock.server_onRefresh( self )
function TimeBlock:server_onRefresh()
sm.isDev = true
self:server_onCreate()
end
function TimeBlock.server_onCreate( self )

function TimeBlock:server_onCreate()
sm.interactable.setValue(self.interactable, os.time())
end

function TimeBlock.server_onFixedUpdate(self, dt)
function TimeBlock:server_onFixedUpdate(dt)
local clockvalue = os.time()
if clockvalue ~= self.lastClockvalue then
self.interactable:setPower(clockvalue) -- power overflows, only modpack parts will be able to read using getValue
Expand All @@ -33,8 +35,10 @@ function TimeBlock.server_onFixedUpdate(self, dt)
self.lastClockvalue = clockvalue
end

function TimeBlock.client_onFixedUpdate( self, dt )
local posevalue = (os.time()%60)+30
self.interactable:setPoseWeight(0, (math.sin(0-2*math.pi*posevalue/60)+1)/2)
self.interactable:setPoseWeight(1, (math.cos(2*math.pi*posevalue/60)+1)/2)
function TimeBlock:client_onCreate()
self.interactable:setAnimEnabled("clock_anim", true)
end

function TimeBlock:client_onFixedUpdate(dt)
self.interactable:setAnimProgress("clock_anim", (os.time() % 60) / 60)
end
2 changes: 1 addition & 1 deletion Scripts/interactable/ToteGenerator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function ToteGenerator.client_onFixedUpdate(self, dt)
if note ~= self.note and note > 0 and note < 26 then
self.note = note
if tote == 10 then
self.effect:setParameter( "velocity", note*2 ) -- 1-25 (0->1)
self.effect:setParameter( "velocity_max_50", note*2 ) -- 1-25 (0->1)
else
self.effect:setParameter( "pitch", (note-1)/24 ) -- 1-25 (0->1)
end
Expand Down

0 comments on commit c4f430c

Please sign in to comment.