[1.1.55] Can't change artillery wagon's force
Posted: Sun Feb 27, 2022 7:47 pm
You can't change an artillery wagons force via Lua API script. It accepts the request, but the force doesn't change.
1: Load save: 2: script to change the force of the player selected entity:
3: Hover over the locomotive and cargo wagon and run the above script in console. The force will change as expected.
4: Hover over the artillery wagon and run the above script in console. The force of the artillery wagon won't change, but no error occurs either.
1: Load save: 2: script to change the force of the player selected entity:
Code: Select all
/c
local carriage = game.player.selected
game.print("pre: " .. carriage.force.name)
carriage.force = game.forces.enemy
game.print("post: " .. carriage.force.name)
4: Hover over the artillery wagon and run the above script in console. The force of the artillery wagon won't change, but no error occurs either.