- Winona's catapults stay in idle sleep mode after being activated again. Their power consumption can get stuck in sleep consumption instead of idle consumption once they enter sleep mode.
The issue seems to be that there's no powerload:SetLoad call in SetActiveMode for when they become active. The power consumptions don't change due to never notifying the circuits (OnCircuitChanged function declaring will need to be moved up to be available in SetActiveMode):
local function SetActiveMode(inst, active) if inst._autoactivetask then inst._autoactivetask:Cancel() inst._autoactivetask = nil end local loading = POPULATING if not (active and inst._powertask) then inst.components.timer:StopTimer("active_time") inst.components.timer:StopTimer("boost") RefreshAttackPeriod(inst) inst:SetBrain(nil) inst:RemoveEventCallback("timerdone", OnTimerDone) inst:RemoveEventCallback("newcombattarget", OnNewCombatTarget) inst:RemoveEventCallback("droppedtarget", OnDroppedTarget) inst.components.combat:SetRetargetFunction(nil) inst.components.combat:SetTarget(nil) inst.components.powerload:SetLoad(TUNING.WINONA_CATAPULT_POWER_LOAD_SLEEP_MODE, true) if inst._powertask then SetLedStatusBlink(inst, true) else SetLedStatusOff(inst) end if not loading then inst:PushEvent("togglepower", { ison = false }) end OnCircuitChanged(inst) -- HERE, notify circuit elseif loading or not inst.components.timer:TimerExists("active_time") then if loading then --no target on load, but could've saved while we had target inst.components.timer:ResumeTimer("active_time") else inst.components.timer:StartTimer("active_time", CalcSleepModeDelay(inst), inst.components.combat:HasTarget()) end inst.components.combat:SetRetargetFunction(1, RetargetFn) inst:ListenForEvent("timerdone", OnTimerDone) inst:ListenForEvent("newcombattarget", OnNewCombatTarget) inst:ListenForEvent("droppedtarget", OnDroppedTarget) inst:SetBrain(brain) if not inst:IsAsleep() then inst:RestartBrain() end inst.components.powerload:SetLoad(TUNING.WINONA_CATAPULT_POWER_LOAD_IDLE) -- HERE, set power load back to idle load SetLedStatusOn(inst) if not loading then inst:PushEvent("togglepower", { ison = true }) end OnCircuitChanged(inst) -- HERE, notify circuit end end
- Winona's gadgets that have a powerload when recharging near a generator (Portasol, Winbot and Remote), don't apply this powerload consistently, as they don't properly update the powerload on the circuit on being set to charging or not charging, only on being connected or disconnected.
This simply requires a few OnCircuitChanged calls to be added (as well as moving where said function is declared if needed):
local function SetCharging(inst, powered, duration) if not powered then if inst._powertask then -- code related to stopping charging here OnCircuitChanged(inst) end else local waspowered = inst._powertask ~= nil local remaining = waspowered and GetTaskRemaining(inst._powertask) or 0 if duration > remaining then if inst._powertask then inst._powertask:Cancel() end inst._powertask = inst:DoTaskInTime(duration, SetCharging, false) if not waspowered then -- code related to starting charging here OnCircuitChanged(inst) end end end end
- Lastly, Winbots don't disconnect from a circuit on being deployed.
This is a huge oversight as it means they'll still consume power from a circuit (especially with the issue above where things don't update as they should).
local function OnDeploy(inst, pt)--, deployer) StopWatchForReactivate(inst) ChangeToCharacterPhysics(inst, 50, PHYSICS_RADIUS) if pt then --loading doesn't pass pt inst.Physics:Teleport(pt.x, 0, pt.z) end inst:AddComponent("locomotor") inst.components.locomotor:SetTriggersCreep(false) inst.components.locomotor.pathcaps = { ignorecreep = true } inst.components.locomotor.runspeed = TUNING.WINONA_STORAGE_ROBOT_RUNSPEED inst.Transform:SetFourFaced() inst:SetStateGraph("SGwinona_storage_robot") inst:SetBrain(brain) SetCharging(inst, false) RefreshLedStatus(inst) inst.components.circuitnode:Disconnect() -- HERE, disconnect from the circuit inst.components.fueled:StartConsuming() if pt then StorageRobotCommon.UpdateSpawnPoint(inst) end if not inst:IsAsleep() then inst:RestartBrain() elseif inst._offscreendeactivatetask == nil then inst._offscreendeactivatetask = inst:DoTaskInTime(OFFSCREEN_DEACTIVATE_DELAY, inst.OnDeactivateRobot) end inst:ListenForEvent("teleported", OnTeleported) SetWasDeployed(inst, true) inst._isactive:set(true) inst.components.circuitnode:Disconnect() -- OR HERE, disconnect from the circuit end
I personally added the line at the bottom since I implemented it with a mod script format in a way to keep the original functionality and not touch anything else, but it might work just fine with doing it just after refreshing the led status, I just haven't tested it there.
For the catapult sleep mode issue:
- Without the upgrade to avoid power consumption from devices in sleep mode, have a catapult enter sleep mode, then rearm it repeatedly any time it goes into sleep mode.
- Notice how the catapult will still drain half the power as if it was in sleep mode, instead of the intended idle drain.
- Also notice how power consumption on a generator won't change when changing between modes.
For the gadgets:
- Drop a Portasol, Winbot or Remote that need charging near a generator.
- Notice how they won't drain any power from the generator.
- Now add another device, or update the circuit in some other way, like adding another powered generator.
- (Winbot only) Check that the power drain still applies while Winbot is moving around even outside of the range of the generator.
- (Winbot only) Grab Winbot and notice how the power drain will stop.
- Notice how the drain will apply (from both the new device and the dropped item).
- Now wait until the device is fully charged.
- Notice how it will continue to drain power until the circuit is updated again.
-
1
A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now