LuaSurface.refresh_enemy_peaceful_mode()
Posted: Mon Nov 21, 2016 7:55 am
Request:
An API to refresh the status of peaceful-mode in enemy units on a particular surface. Such API can be called after changing LuaSurface.peaceful_mode.
Alternatively, add LuaSurface.set_peaceful_mode(true/false) to change LuaSurface.peaceful_mode and automatically refresh unit status.
Reason:
For most of the modders and command users, we know that changing LuaSurface.peaceful_mode will not change the current status of the existing enemy units. The change is only applied on the new ones. So we need to call LuaForce.kill_all_units for the enemy in order to force respawn. Users may see the units suddenly disappear and may feel odd. Ideally, the refresh is done internally so users will not see that.
An API to refresh the status of peaceful-mode in enemy units on a particular surface. Such API can be called after changing LuaSurface.peaceful_mode.
Alternatively, add LuaSurface.set_peaceful_mode(true/false) to change LuaSurface.peaceful_mode and automatically refresh unit status.
Reason:
For most of the modders and command users, we know that changing LuaSurface.peaceful_mode will not change the current status of the existing enemy units. The change is only applied on the new ones. So we need to call LuaForce.kill_all_units for the enemy in order to force respawn. Users may see the units suddenly disappear and may feel odd. Ideally, the refresh is done internally so users will not see that.