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
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.
[2.0.65] LuaSegmentedUnit.speed effectively doesn't change speed in some cases
[2.0.65] LuaSegmentedUnit.speed effectively doesn't change speed in some cases
- Attachments
-
- factorio-current.log
- (11.2 KiB) Downloaded 11 times
-
- nauvis-worms_0.1.2.zip
- Mod
- (982 Bytes) Downloaded 11 times
-
- 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
This will be fixed in 2.0.67