From 960c517250042474fc738b2525d97734abc60880 Mon Sep 17 00:00:00 2001 From: sleepysva Date: Sat, 14 Dec 2024 19:51:29 -0600 Subject: [PATCH] v1.3.0.8 Pump fixes --- _metadata | 2 +- interface/arcana/arcana_auto/body_pump.png | Bin 0 -> 669 bytes interface/arcana/arcana_auto/burner.config | 31 ++++++-- interface/arcana/arcana_auto/burner.lua | 25 +++++++ .../arcana/arcana_auto/coalgenerator.config | 31 ++++++-- interface/arcana/arcana_auto/footer_clean.png | Bin 364 -> 375 bytes .../arcana/arcana_auto/galvasteelbar.png | Bin 448 -> 0 bytes interface/arcana/arcana_auto/pump.config | 56 +++++++++++++++ interface/arcana/arcana_auto/stateoff.png | Bin 0 -> 185 bytes interface/arcana/arcana_auto/stateon.png | Bin 0 -> 207 bytes interface/arcana/arcana_auto/temp.png | Bin 3232 -> 0 bytes interface/arcana/arcana_auto/temp2.png | Bin 4040 -> 0 bytes interface/arcana/arcana_auto/toggle.png | Bin 0 -> 251 bytes interface/arcana/arcana_auto/toggleoff.png | Bin 0 -> 227 bytes .../workshop/workshop_auto_burner/burner.lua | 67 +++++++++++------- .../coalgenerator.lua | 67 +++++++++++------- objects/workshop/workshop_auto_pump/pump.lua | 14 +++- .../workshop_auto_pump.object | 2 +- scripts/automation/arcana_power.lua | 16 +++++ 19 files changed, 242 insertions(+), 69 deletions(-) create mode 100644 interface/arcana/arcana_auto/body_pump.png delete mode 100644 interface/arcana/arcana_auto/galvasteelbar.png create mode 100644 interface/arcana/arcana_auto/pump.config create mode 100644 interface/arcana/arcana_auto/stateoff.png create mode 100644 interface/arcana/arcana_auto/stateon.png delete mode 100644 interface/arcana/arcana_auto/temp.png delete mode 100644 interface/arcana/arcana_auto/temp2.png create mode 100644 interface/arcana/arcana_auto/toggle.png create mode 100644 interface/arcana/arcana_auto/toggleoff.png diff --git a/_metadata b/_metadata index 0b34abd94..4805a3c4f 100644 --- a/_metadata +++ b/_metadata @@ -8,5 +8,5 @@ "priority" : 9000, "steamContentId" : "2359135864", "tags" : "Crafting and Building|Miscellaneous|Planets and Environments|NPCs and Creatures|Weapons|Quests|Dungeons|Ships|Species|Furniture and Objects|Food and Farming|Mechanics|Armor and Clothes", - "version" : "1.3.0.5" + "version" : "1.3.0.7" } \ No newline at end of file diff --git a/interface/arcana/arcana_auto/body_pump.png b/interface/arcana/arcana_auto/body_pump.png new file mode 100644 index 0000000000000000000000000000000000000000..23fbe901f620c26777b9de99df1c7c345c5479fe GIT binary patch literal 669 zcmeAS@N?(olHy`uVBq!ia0y~yU{nUO3pv<;&#-&MH!(WJ2^*Zo9I?2xYM9S9ty3Rb7dAI%8lAQ{KEbBJT zPyeObvSIr4|Cc}9x3$0bzq+F8W-YVDGSCGYrb{I+aKHi`|ErA&)@%k zo%A~Ozg&Qc@8yDuy?68cZ@pR5mp@0@<-l7DQ@i8udNL2}oNKg9a&7~QA(PM%4i5ok z1;?I|%4xZ}w4PzZn#@^ks`obE%`5lb^E@PpB|KyM?-=*C#EJ9vb{q1N7(&k_4~p(O zQt2{Z)vX|P->;TqOFIN(W}das+oT(HesgkqWB>109XdzZb9M;ME|lRb_g%mC`+1$M zyQ}yOo1`~L9#6DAzx%7r`+Hnx>%vPr?@pCqq(3-7Bv%mN&)-ns)eBcKRk1QbDxfFg(yPy{goihm$RKoP_UD1sOPMd*wk z->T8DKiKymz+oB<`zPyu1xaj1Kp{FwVmkub&~z(GlB%xj*~9qmyiStw>(^&XvjIn7 zH0+-wNz)J|3o)9SMhRdWn?z`8X^iF$RMo}S69F{j0vjlT7y(6S5~E4$Qvk*0KJ71i?Q=h{i@D`yU5ArF0TYu@0R$NUfL;6oL~}LP T9b^e%00000NkvXXu0mjfP=$%I delta 324 zcmey)^oD7IVZEBCi(^Q|oVT}a{g@I(+AfxN$Z~#(*u}E;Wz4Y&4-Tm`&b_gj=cVaJ zIc*M!M?5cHET41v>=W(0uTRqIRz0n`bVh78!lrserA|Cqk~yYRif ztTBrMZ#N$F_hG!?*3+QWAsE17$ke6a<{)^4L!(K8(N#cs0Y`KFua7%dEkFD*pP%WE z|JM?Wtlz(^HcB$KN~mPx$dPzhT(=kgzQ4|O8{|mE@gBob&5J-xHD1_AF&{T6{(9|dJ1Gow`7JdS! zz$x4kog5@6Bty3f$LtA3gGV#C4bOM;`krOwfeV+*eLw!^-gh-mA}cV5asa^l{qesL zXC#A#d87eGi6)Dg<(!EA1~D_Xk_U*c2k`vzhDtR*6R5N{jsU>wiW`UfY3%MCfti)0 zQxlm;Dj7gm|Jva513teSv1l4y9XK!MY!g~qtJOP5B?IcBe@&w4m~q3olZ=8{ZjA>` z)ao7iF#te+l2cbOgj%VA&5doPRS6LhZt4ZlQry5w4FfaB2&v?Y=(o!lQcnq>BpS#1 z?J}x`3%G(IIZVW^EUlTC!yCrO>jN&&P60qcL@s*}ZGXxgm+QT_!a8@?f?y_tV-?l!mrmF!mZr9; i-O%mj?b$OK{xERg)RYW&e5wkxp25@A&t;ucLK6V0;zU>g literal 0 HcmV?d00001 diff --git a/interface/arcana/arcana_auto/stateon.png b/interface/arcana/arcana_auto/stateon.png new file mode 100644 index 0000000000000000000000000000000000000000..c82aa7cd02513eb9713c7ea2476573d96b8e1828 GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^DnQK7!3HFIvU78R6k~CayA#8@b22Z1oK8;{#}JRs zw^s$lTO1@>AAWzW;;H*pdD>&0zU}fiJ~?a=YoDvay*O>Du@3=h-2mDBtt#PZQR!)MVSv+8Rv+1ZhO3+gGxx1OWxqohFcE8>EcK6%aZ+E}nCOO!di;2jI z0000nON+BkJW1i@jlF`rlDu1ak0=003REJZs{7llJ-j#j8@ohXhxG zRB!10ely)c2tK1c0kkypl7D(95p5~y?6z-S)FSOn{K`I;V&8nLO4X>~v(_%f@xXb0 z%Y7CmdBso>31=+I;fl0Zy>6T}V9(yY=);&!?;3#u32)Nqrkl5S&uvck5;q;T%<9fL zRN7=XyV!j@lu!9c2bXh7se&*hdAr(cM7ICc(@=FelOQkfsLnxgf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K*T@rz(8(3gXyXh-Ar!yCu+_Pa=)4{80gD4eUhokXYJ2!@7 z9TvlOO{w*jLV)KqnSQyWPwldCS*_i z?08Iq`gu2!x0@YgzO%&e$-MFJJ{4p225bpjwHBMa=jpd|EKP zz*EmUwfLe`K!Qir4~atUW&!(XZ}#wH1!i^GNfoo;a-k&oOz!EEn91LS?LRfwxm%<_ z%%ii@K*OBxR|jk#wo+v?S)!g&1$&vl&e9D!$i3p>#g%^q1b6%R5quWko=vacSSX3Y ze_Kb+zC>5LG<0Q1ev}m`cLmRF7H;FspiCBt$X)#M{nb=@v zN-*n^lJx({JquHuXPqhM^w3T^?YKA99$M-mhGl;4yY%^8?U9EGY+B&M)<2SHY*qjD zJXK0ooyJPyMLO_&p5{b#wcgULfQ)-8yHaJ%y(n4R$R9AePv)<9HleUxg`Kr+A4JyN zM75X~@}-j!|7PPg#>mumM9a^4)rM(iPJdZe$XLB#ZU3uGDQ7q@F4R@%t?3`b)G#TX!4c0CZAGrWMlCw2RlR| z*dRpNPrvLmKX4X{c6zVIRMO7UYWdC0I# zTS{+scTu{Y$OjcyQbhwfE+LldUT1;CoRB$3S(;_e3~sEfX7a+wo2@Uuwf3zz^Qwd9 zRNqUhz%S#l?d&Zjal@HmEh6pX(Y_VYZUpA<9PNAg*3Of#wMGUE_5*nQ*Rn-1-rN%F zL)*L6*z#hXg`r+~F{WTWn6ID2=Q-`%+nRw4Z@R~lO2O?t1>;veFUs13D;S)au1lbLc5eovZ?{>vO;516nrXkK#6Jri>T5Bu z^b*h+rlmL_rjgV7g}FxuriHsk7}yCqmsmM`aDeB|_Kj&1TQv#38rJ)ZXx;w%=O|Bj XN3t?XZ|5<;O+)BOXWMG)i^=~0oifIz diff --git a/interface/arcana/arcana_auto/toggle.png b/interface/arcana/arcana_auto/toggle.png new file mode 100644 index 0000000000000000000000000000000000000000..f1a759afb4063f29676962135830724e799ef3f9 GIT binary patch literal 251 zcmVPx#wMj%lR49?9)1eN7FcgL1zl4NfV2X#BUXXLsXm~)-2-MspL6R995(P7)iWx{Y zD5cAeyys9CDwt@ z{B>smkOuA)U(d!Udpt?HQHW)b2Cnh1O1e=1ya5)VKV0~&D4PHP002ovPDHLkV1m@0 BXX*d| literal 0 HcmV?d00001 diff --git a/interface/arcana/arcana_auto/toggleoff.png b/interface/arcana/arcana_auto/toggleoff.png new file mode 100644 index 0000000000000000000000000000000000000000..9bd360b2287ee0e28137797c35689fa19e66d642 GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^{2hP9?yYh_luuiB+E^O4})sWBT?2_^rTaa3YC z>*=k>C(Zw`J?2Bs(VLnK{gIC&3by|fS%0AV->yi8ImOGjmPtRI 0 then - self.consumptionTimer = math.max(0, self.consumptionTimer - dt) - if self.consumptionTimer == 0 then - consumeInputSingle() - self.consumptionTimer = self.consumptionTime + if power.getState() == true then + if self.consumptionTimer > 0 then + self.consumptionTimer = math.max(0, self.consumptionTimer - dt) + if self.consumptionTimer == 0 then + consumeInputSingle() + self.consumptionTimer = self.consumptionTime + end + end + if self.productionTimer > 0 then + self.productionTimer = math.max(0, self.productionTimer - dt) + if self.productionTimer == 0 then + if self.isPowered == true then + object.setOutputNodeLevel(0, true) + setAnimation(true) + power.set(self.maxPower) + else + object.setOutputNodeLevel(0, false) + setAnimation(false) + power.set(0) + end + power.send(0, power.get()) + self.productionTimer = self.productionTime + end end + else + setAnimation(false) end - if self.productionTimer > 0 then - self.productionTimer = math.max(0, self.productionTimer - dt) - if self.productionTimer == 0 then - if self.isPowered == true then - object.setOutputNodeLevel(0, true) - animator.setAnimationState("switchState", "on") - animator.setParticleEmitterActive("smoke", true) - if self.isPlayingSound == false then - animator.playSound("onloop", -1) - self.isPlayingSound = true - end - power.set(self.maxPower) - else - object.setOutputNodeLevel(0, false) - animator.setAnimationState("switchState", "off") - animator.setParticleEmitterActive("smoke", false) - animator.stopAllSounds("onloop") - self.isPlayingSound = false - end - power.send(0, power.get()) - self.productionTimer = self.productionTime +end + +function setAnimation(s) + if s == true then + if self.isPlayingSound == false then + animator.playSound("onloop", -1) + self.isPlayingSound = true end + animator.setAnimationState("switchState", "on") + animator.setParticleEmitterActive("smoke", true) + else + animator.setAnimationState("switchState", "off") + animator.setParticleEmitterActive("smoke", false) + animator.stopAllSounds("onloop") + self.isPlayingSound = false end -end +end \ No newline at end of file diff --git a/objects/workshop/workshop_auto_coalgenerator/coalgenerator.lua b/objects/workshop/workshop_auto_coalgenerator/coalgenerator.lua index 886b7680c..67d075d54 100644 --- a/objects/workshop/workshop_auto_coalgenerator/coalgenerator.lua +++ b/objects/workshop/workshop_auto_coalgenerator/coalgenerator.lua @@ -50,34 +50,47 @@ function consumeInput() end function update(dt) - if self.consumptionTimer > 0 then - self.consumptionTimer = math.max(0, self.consumptionTimer - dt) - if self.consumptionTimer == 0 then - consumeInput() - self.consumptionTimer = self.consumptionTime + if power.getState() == true then + if self.consumptionTimer > 0 then + self.consumptionTimer = math.max(0, self.consumptionTimer - dt) + if self.consumptionTimer == 0 then + consumeInput() + self.consumptionTimer = self.consumptionTime + end end + if self.productionTimer > 0 then + self.productionTimer = math.max(0, self.productionTimer - dt) + if self.productionTimer == 0 then + if self.isPowered == true then + object.setOutputNodeLevel(0, true) + setAnimation(true) + power.set(self.maxPower) + else + object.setOutputNodeLevel(0, false) + setAnimation(false) + power.set(0) + end + power.send(0, power.get()) + self.productionTimer = self.productionTime + end + end + else + setAnimation(false) end - if self.productionTimer > 0 then - self.productionTimer = math.max(0, self.productionTimer - dt) - if self.productionTimer == 0 then - if self.isPowered == true then - object.setOutputNodeLevel(0, true) - animator.setAnimationState("switchState", "on") - animator.setParticleEmitterActive("smoke", true) - if self.isPlayingSound == false then - animator.playSound("onloop", -1) - self.isPlayingSound = true - end - power.set(self.maxPower) - else - object.setOutputNodeLevel(0, false) - animator.setAnimationState("switchState", "off") - animator.setParticleEmitterActive("smoke", false) - animator.stopAllSounds("onloop") - self.isPlayingSound = false - end - power.send(0, power.get()) - self.productionTimer = self.productionTime +end + +function setAnimation(s) + if s == true then + if self.isPlayingSound == false then + animator.playSound("onloop", -1) + self.isPlayingSound = true end + animator.setAnimationState("switchState", "on") + animator.setParticleEmitterActive("smoke", true) + else + animator.setAnimationState("switchState", "off") + animator.setParticleEmitterActive("smoke", false) + animator.stopAllSounds("onloop") + self.isPlayingSound = false end -end +end \ No newline at end of file diff --git a/objects/workshop/workshop_auto_pump/pump.lua b/objects/workshop/workshop_auto_pump/pump.lua index 2e1546838..d6f1dc063 100644 --- a/objects/workshop/workshop_auto_pump/pump.lua +++ b/objects/workshop/workshop_auto_pump/pump.lua @@ -14,8 +14,14 @@ function init() self.outputRate = root.assetJson(configPath).outputRate or 1 self.recipes = root.assetJson(configPath).recipes or nil self.powerUseAmount = config.getParameter("powerUseAmount", 0) - arcana_power:setPower(config.getParameter("maxPower", 10)) + power.set(config.getParameter("maxPower", 10)) animator.setGlobalTag("directives", config.getParameter("directives", "")) + + self.isPowered = true + message.setHandler("getProgress", function() + local progress = power.round((1 - (self.cooldownTimer / self.pumpTime)), 1) + if self.isPowered == true and self.isEmpty == false then return progress else return 0 end + end) end @@ -59,15 +65,17 @@ function automation() world.destroyLiquid(liquidPosition) liquidItem.name = root.liquidConfig(liquidLevel[1]).config.itemDrop world.containerAddItems(entity.id(), liquidItem) + self.isEmpty = false animator.setAnimationState("switchState", "on") else + self.isEmpty = true animator.setAnimationState("switchState", "empty") end end function powerCheck() - if arcana_power:getPower() >= self.powerUseAmount then - arcana_power:removePower(self.powerUseAmount) + if power.get() >= self.powerUseAmount then + power.remove(self.powerUseAmount) self.isPowered = true else animator.setAnimationState("switchState", "off") diff --git a/objects/workshop/workshop_auto_pump/workshop_auto_pump.object b/objects/workshop/workshop_auto_pump/workshop_auto_pump.object index 24831bc29..40220f351 100644 --- a/objects/workshop/workshop_auto_pump/workshop_auto_pump.object +++ b/objects/workshop/workshop_auto_pump/workshop_auto_pump.object @@ -86,7 +86,7 @@ "openSounds" : [ "/sfx/objects/campfire_use.ogg" ], "slotCount" : 1, - "uiConfig" : "/interface/arcana/arcana_auto/extractor.config", + "uiConfig" : "/interface/arcana/arcana_auto/pump.config", "frameCooldown" : 5, "autoCloseCooldown" : 3600, diff --git a/scripts/automation/arcana_power.lua b/scripts/automation/arcana_power.lua index 79c00a5c3..2c109784e 100644 --- a/scripts/automation/arcana_power.lua +++ b/scripts/automation/arcana_power.lua @@ -8,6 +8,12 @@ end function power.init() storage.max = config.getParameter("maxPower", 0) storage.power = storage.power or config.getParameter("initPower", 0) + storage.state = storage.state or true + + message.setHandler("getState", function(_, _, state) + if state ~= nil then power.setState(state) end + return power.getState(state) + end) end -- Sends power to all connected objects for a set node. @@ -44,6 +50,16 @@ function power.get() return storage.power end +-- Returns current state for button use +function power.getState() + return storage.state +end + +-- Sets current state +function power.setState(s) + storage.state = s +end + --http://lua-users.org/wiki/SimpleRound, for progress bar completion rounding. function power.round(num, numDecimalPlaces) if num <= 0.97 then return num end