From 6ab5a1fa2ecb3a23c1fcfabff798677fe05fd25e Mon Sep 17 00:00:00 2001 From: patman <27874300+patmanf@users.noreply.github.com> Date: Wed, 1 Jun 2022 09:40:00 -0500 Subject: [PATCH] add input wiring node to toggle 'Meat Service' --- _metadata | 2 +- pat/meatvent/vent.lua | 16 ++++++++++++++++ pat/meatvent/vent.object | 4 +++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/_metadata b/_metadata index 85d44e8..f8b9582 100644 --- a/_metadata +++ b/_metadata @@ -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", diff --git a/pat/meatvent/vent.lua b/pat/meatvent/vent.lua index b070069..8a5950a 100644 --- a/pat/meatvent/vent.lua +++ b/pat/meatvent/vent.lua @@ -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) @@ -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 \ No newline at end of file diff --git a/pat/meatvent/vent.object b/pat/meatvent/vent.object index bc5fdf2..47a9e04 100644 --- a/pat/meatvent/vent.object +++ b/pat/meatvent/vent.object @@ -37,5 +37,7 @@ "speed" : [15, 25], "time" : [0.3, 6], "soundPitch" : [0.92, 1.24] - } + }, + + "inputNodes" : [[0, 0]] }