From b508b99b6ece937d4648229c9e3b9874b67455ce Mon Sep 17 00:00:00 2001 From: Kherae Date: Thu, 19 Oct 2023 04:02:54 -0700 Subject: [PATCH 1/4] these...are unused. --- ...n_atmosregenerator.lua => isn_atmosregenerator.lua.DEPRECATED} | 0 .../{isn_atmosregulator.lua => isn_atmosregulator.lua.DEPRECATED} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename objects/power/isn_atmosregulator/{isn_atmosregenerator.lua => isn_atmosregenerator.lua.DEPRECATED} (100%) rename objects/power/isn_atmosregulator/{isn_atmosregulator.lua => isn_atmosregulator.lua.DEPRECATED} (100%) diff --git a/objects/power/isn_atmosregulator/isn_atmosregenerator.lua b/objects/power/isn_atmosregulator/isn_atmosregenerator.lua.DEPRECATED similarity index 100% rename from objects/power/isn_atmosregulator/isn_atmosregenerator.lua rename to objects/power/isn_atmosregulator/isn_atmosregenerator.lua.DEPRECATED diff --git a/objects/power/isn_atmosregulator/isn_atmosregulator.lua b/objects/power/isn_atmosregulator/isn_atmosregulator.lua.DEPRECATED similarity index 100% rename from objects/power/isn_atmosregulator/isn_atmosregulator.lua rename to objects/power/isn_atmosregulator/isn_atmosregulator.lua.DEPRECATED From 00eaabb15c4b28df2d5136217f6f3fa8f646f709 Mon Sep 17 00:00:00 2001 From: Kherae Date: Thu, 19 Oct 2023 04:04:06 -0700 Subject: [PATCH 2/4] shift to using require in script --- objects/power/fu_atmosfilter/fu_atmosfilter.lua | 3 ++- objects/power/fu_atmosfilter/fu_atmosfilter.object | 2 +- objects/power/isn_atmosregulator/isn_atmosregulator.object | 2 +- objects/power/isn_atmosregulator/isn_atmosregulatornew.object | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/objects/power/fu_atmosfilter/fu_atmosfilter.lua b/objects/power/fu_atmosfilter/fu_atmosfilter.lua index 4dc79994ad1..07b945ca161 100644 --- a/objects/power/fu_atmosfilter/fu_atmosfilter.lua +++ b/objects/power/fu_atmosfilter/fu_atmosfilter.lua @@ -1,4 +1,5 @@ require "/scripts/effectUtil.lua" +require "/scripts/fupower.lua" function init() power.init() @@ -47,4 +48,4 @@ function containerCallback() end end storage.effects = #effects > 0 and effects or nil -end \ No newline at end of file +end diff --git a/objects/power/fu_atmosfilter/fu_atmosfilter.object b/objects/power/fu_atmosfilter/fu_atmosfilter.object index 61b63fa9dbb..b6efbdae253 100644 --- a/objects/power/fu_atmosfilter/fu_atmosfilter.object +++ b/objects/power/fu_atmosfilter/fu_atmosfilter.object @@ -41,7 +41,7 @@ } ], - "scripts" : [ "/scripts/fupower.lua","/objects/power/fu_atmosfilter/fu_atmosfilter.lua" ], + "scripts" : [ "/objects/power/fu_atmosfilter/fu_atmosfilter.lua" ], "scriptDelta" : 60, "objectType" : "container", diff --git a/objects/power/isn_atmosregulator/isn_atmosregulator.object b/objects/power/isn_atmosregulator/isn_atmosregulator.object index ef45035ab6b..b5e392b4f00 100644 --- a/objects/power/isn_atmosregulator/isn_atmosregulator.object +++ b/objects/power/isn_atmosregulator/isn_atmosregulator.object @@ -47,7 +47,7 @@ } ], - "scripts" : [ "/scripts/fupower.lua","/objects/power/fu_atmosfilter/fu_atmosfilter.lua" ], + "scripts" : [ "/objects/power/fu_atmosfilter/fu_atmosfilter.lua" ], "scriptDelta" : 60, "atmos" : { diff --git a/objects/power/isn_atmosregulator/isn_atmosregulatornew.object b/objects/power/isn_atmosregulator/isn_atmosregulatornew.object index 76163b55ed9..afb5e6ca7fe 100644 --- a/objects/power/isn_atmosregulator/isn_atmosregulatornew.object +++ b/objects/power/isn_atmosregulator/isn_atmosregulatornew.object @@ -42,7 +42,7 @@ } ], - "scripts" : [ "/scripts/fupower.lua","/objects/power/fu_atmosfilter/fu_atmosfilter.lua" ], + "scripts" : [ "/objects/power/fu_atmosfilter/fu_atmosfilter.lua" ], "scriptDelta" : 60, "objectType" : "container", From 52d4a861dfacb3cb1ab3bc92342160e973965238 Mon Sep 17 00:00:00 2001 From: Kherae Date: Thu, 19 Oct 2023 04:15:13 -0700 Subject: [PATCH 3/4] warped regulator power smoothing. sort of. --- .../power/fu_atmosfilter/fu_atmosfilterwarped.lua | 14 ++++++++------ .../isn_atmosregulatorwarped.object | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/objects/power/fu_atmosfilter/fu_atmosfilterwarped.lua b/objects/power/fu_atmosfilter/fu_atmosfilterwarped.lua index 589b4d14e17..8a7a6c9623e 100644 --- a/objects/power/fu_atmosfilter/fu_atmosfilterwarped.lua +++ b/objects/power/fu_atmosfilter/fu_atmosfilterwarped.lua @@ -1,4 +1,5 @@ require "/scripts/effectUtil.lua" +require "/scripts/fupower.lua" function init() power.init() @@ -7,12 +8,13 @@ function init() end self=util.mergeTable(self or {},config.getParameter("atmos") or {}) itemList=root.assetJson("/objects/power/fu_atmosfilter/warpedItemList.json") + self.interval=1.0 end function update(dt) - if self and self.range and itemList and (storage.effects or self.objectEffects) then - if not deltaTime or deltaTime > 1.0 then - if power.consume(config.getParameter('isn_requiredPower')) then + if (not deltaTime) or (deltaTime >= self.interval) then + if self and self.range and itemList and (storage.effects or self.objectEffects) then + if power.consume(config.getParameter('isn_requiredPower')*(deltaTime or self.interval)) then animator.setAnimationState("switchState", "on") if storage.effects then for _,effect in pairs(storage.effects) do @@ -34,10 +36,10 @@ function update(dt) end deltaTime=0 else - deltaTime=deltaTime+dt + animator.setAnimationState("switchState", "off") end else - animator.setAnimationState("switchState", "off") + deltaTime=deltaTime+dt end power.update(dt) end @@ -69,4 +71,4 @@ function containerCallback() storage.messages = #messageList > 0 and messageList or nil end ---effectUtil.effectTypesInRange(effect,range,types,duration,teamType) \ No newline at end of file +--effectUtil.effectTypesInRange(effect,range,types,duration,teamType) diff --git a/objects/power/isn_atmosregulator/isn_atmosregulatorwarped.object b/objects/power/isn_atmosregulator/isn_atmosregulatorwarped.object index 5391d714fb4..2e60621f896 100644 --- a/objects/power/isn_atmosregulator/isn_atmosregulatorwarped.object +++ b/objects/power/isn_atmosregulator/isn_atmosregulatorwarped.object @@ -41,8 +41,8 @@ } ], - "scripts" : [ "/scripts/fupower.lua","/objects/power/fu_atmosfilter/fu_atmosfilterwarped.lua" ], - "scriptDelta" : 60, + "scripts" : [ "/objects/power/fu_atmosfilter/fu_atmosfilterwarped.lua" ], + "scriptDelta" : 10, "objectType" : "container", "openSounds" : [ "/sfx/objects/metalbox_open.ogg" ], From 1395db9fdb1474fb14bec320676156d5831f05f6 Mon Sep 17 00:00:00 2001 From: Kherae Date: Thu, 19 Oct 2023 04:24:23 -0700 Subject: [PATCH 4/4] rem --- .../isn_atmosregenerator.lua.DEPRECATED | 12 ------------ .../isn_atmosregulator.lua.DEPRECATED | 11 ----------- 2 files changed, 23 deletions(-) delete mode 100644 objects/power/isn_atmosregulator/isn_atmosregenerator.lua.DEPRECATED delete mode 100644 objects/power/isn_atmosregulator/isn_atmosregulator.lua.DEPRECATED diff --git a/objects/power/isn_atmosregulator/isn_atmosregenerator.lua.DEPRECATED b/objects/power/isn_atmosregulator/isn_atmosregenerator.lua.DEPRECATED deleted file mode 100644 index 8b750df240a..00000000000 --- a/objects/power/isn_atmosregulator/isn_atmosregenerator.lua.DEPRECATED +++ /dev/null @@ -1,12 +0,0 @@ -require '/scripts/fupower.lua' -require "/scripts/effectUtil.lua" - -function update(dt) - if power.consume(config.getParameter('isn_requiredPower')) then - animator.setAnimationState("switchState", "on") - effectUtil.effectAllInRange("regenerationAtmosRegen",500) - else - animator.setAnimationState("switchState", "off") - end - power.update(dt) -end \ No newline at end of file diff --git a/objects/power/isn_atmosregulator/isn_atmosregulator.lua.DEPRECATED b/objects/power/isn_atmosregulator/isn_atmosregulator.lua.DEPRECATED deleted file mode 100644 index 6da4f41f542..00000000000 --- a/objects/power/isn_atmosregulator/isn_atmosregulator.lua.DEPRECATED +++ /dev/null @@ -1,11 +0,0 @@ -require "/scripts/effectUtil.lua" - -function update(dt) - if power.consume(config.getParameter('isn_requiredPower')) then - animator.setAnimationState("switchState", "on") - effectUtil.effectAllInRange("isn_atmosprotection",500) - else - animator.setAnimationState("switchState", "off") - end - power.update(dt) -end \ No newline at end of file