Unit entities created on an old mod prototype version have "cached" movement_speed
Posted: Wed Oct 18, 2023 11:36 pm
It seems that if a unit is created in a map and the game saved. Then the unit prototype's speed is changed in the mod. When the game is loaded the existing units keep the old prototype speed, with any newly placed units getting the new prototype speed.
See demo video, save and sample mod attached.
In this demo you can see I have ended up with 3 different speed versions of my single custom unit prototype. I hit this when adjusting my unit's speed to try and find a good balance for a new unit and had saved the test map to make this iterative process quicker.
See demo video, save and sample mod attached.
In this demo you can see I have ended up with 3 different speed versions of my single custom unit prototype. I hit this when adjusting my unit's speed to try and find a good balance for a new unit and had saved the test map to make this iterative process quicker.
- Have mod with custom unit. (as per atatched)
- Load game and pause game speed in the editor.
- Place unit in map with an enemy target near by. So the unit will path towards the turret.
- Save map and close game.
- Edit mod to change movement_speed of prototype. (https://lua-api.factorio.com/latest/pro ... ment_speed)
- Load game and load save.
- Place another instance of the unit in the map by the first one.
- Unpause the game speed.
- Notice that the 2 instances of the same custom unit prototype move at different speeds. They also list different speeds on the entity details panel on the right hand side. But both show the current speed in the prototype explorer, confirming they are the same prototype.