Moving group of biters on the map
Posted: Sun Nov 24, 2024 7:52 pm
I completely fail at this seemingly simple task. How should it be done? Can someone post a simple code example which issues a command and then issues next command once the previous one is completed and it just works 100% of time.
I create a LuaCommandable object with some biters in it and then issue commands. I remember the commandable object and either periodically check if previous command finish/biters got stuck or use on_ai_command_completed event.
The problem is that the LuaCommandable gets invalidated randomly. Most of my code is a partially working workaround to this problem and I always end with stuck biters on the map or/and very strange behavior.
There is ai_settings.allow_destroy_when_commands_fail = false but it is a property of single biter not a LuaCommandable and setting it to every biter in the group does not help. I also detach every biter from spawner.
I create a LuaCommandable object with some biters in it and then issue commands. I remember the commandable object and either periodically check if previous command finish/biters got stuck or use on_ai_command_completed event.
The problem is that the LuaCommandable gets invalidated randomly. Most of my code is a partially working workaround to this problem and I always end with stuck biters on the map or/and very strange behavior.
There is ai_settings.allow_destroy_when_commands_fail = false but it is a property of single biter not a LuaCommandable and setting it to every biter in the group does not help. I also detach every biter from spawner.