Skip to content

Commit

Permalink
add input wiring node to toggle 'Meat Service'
Browse files Browse the repository at this point in the history
  • Loading branch information
patmanf committed Jun 1, 2022
1 parent 23e4871 commit 6ab5a1f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _metadata
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version" : "1.0",
"version" : "1.1",
"author" : "pat man",
"description" : "adds \"the meatvent\" from the hit game DOOM 3\nit is a vent, that dispenses raw meat\nfind it in the outpost\n\nmeat\n\n\n[url=https://discord.gg/GdsQSgV][img]https://i.imgur.com/wXjYMqP.gif[/img][/url]\n[url=https://www.patreon.com/pathiccstar][img]https://i.imgur.com/uyG8oTa.gif[/img][/url]\n[url=https://link.clashofclans.com/en?action=OpenClanProfile&tag=2QCU2R9GP][img]https://i.imgur.com/xVfcRRH.gif[/img][/url]",
"name" : "pat_meatvent",
Expand Down
16 changes: 16 additions & 0 deletions pat/meatvent/vent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ function init()
timer = 0.1
parameters = {}
center = rect.center(object.boundBox())

onInputNodeChange({node = 0, level = object.getInputNodeLevel(0)})
end

function update(dt)
Expand All @@ -31,4 +33,18 @@ function update(dt)
animator.playSound("meat")
animator.burstParticleEmitter("blood")
end
end

function onInputNodeChange(args)
if args.node == 0 then
local connected = object.isInputNodeConnected(0)
if not connected then args.level = true end

animator.setParticleEmitterActive("drip", args.level)
script.setUpdateDelta(args.level and 1 or 0)
end
end

function onNodeConnectionChange()
onInputNodeChange({node = 0, level = object.getInputNodeLevel(0)})
end
4 changes: 3 additions & 1 deletion pat/meatvent/vent.object
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@
"speed" : [15, 25],
"time" : [0.3, 6],
"soundPitch" : [0.92, 1.24]
}
},

"inputNodes" : [[0, 0]]
}

0 comments on commit 6ab5a1f

Please sign in to comment.