[2.0.65] LuaSegmentedUnit.speed effectively doesn't change speed in some cases

Bugs which we just recently fixed in our development version and will reach you in the next release.
Osmo
Fast Inserter
Fast Inserter
Posts: 132
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

[2.0.65] LuaSegmentedUnit.speed effectively doesn't change speed in some cases

Post by Osmo »

I created a mod that changes demolisher update_effects to raise a script trigger event. In control stage, i then listen to that event and set the segmented unit's speed to 100.
Expected result: the speed is set to 100 and, assuming no further script intervention, is then decelerated to match the speed as defined by unit's AI settings, but not by more than the prototype's acceleration rate per tick.
Actual result: the speed is set to 100, but on the next tick, acceleration is -99.9, and no actual speed change is observed. You can see the script prints acceleration and speed values
изображение.png
изображение.png (11.81 KiB) Viewed 315 times
Note that if instead of on_script_trigger_effect, on_tick is used, then the behaviour is correct, which suggests it might be related to at what point in the tick the script runs.
Attachments
factorio-current.log
(11.2 KiB) Downloaded 11 times
nauvis-worms_0.1.2.zip
Mod
(982 Bytes) Downloaded 11 times
StrangePan
Factorio Staff
Factorio Staff
Posts: 246
Joined: Fri Dec 07, 2018 3:41 pm
Contact:

Re: [2.0.65] LuaSegmentedUnit.speed effectively doesn't change speed in some cases

Post by StrangePan »

This will be fixed in 2.0.67
Post Reply

Return to “Resolved for the next release”