Creeps forget their command sometimes, and don't get removed on command failed
Posted: Thu Jun 06, 2019 11:06 pm
Factorio's AI on a stress test:
https://mods.factorio.com/mod/dota
After a while, some creeps seem to forget their command
Since i increased their collision size, it got even worse.
I also told them to destroy themselves when their command failed, but they don't...
Afaik there's no way to read a unit's command to destroy them manually.
https://mods.factorio.com/mod/dota
After a while, some creeps seem to forget their command
Since i increased their collision size, it got even worse.
I also told them to destroy themselves when their command failed, but they don't...
Afaik there's no way to read a unit's command to destroy them manually.
Code: Select all
local south_biter = game.surfaces[1].create_entity{name="dota-biter-"..south_level.."-"..color, position = south_spawn, force = color}
south_biter.ai_settings.allow_destroy_when_commands_fail = true
south_biter.ai_settings.do_separation = true
south_biter.set_command{
type = def.command.compound,
structure_type = def.compound_command.return_last,
commands =
{
{type = def.command.go_to_location, destination = {x=177 ,y=115}},
{type = def.command.go_to_location, destination = {x=118 ,y=170}},
{type = def.command.attack_area, destination =enemy_silo_pos, radius = 70}
}
}
Code: Select all
local unit = table.deepcopy(data.raw.unit["small-biter"])
unit.can_open_gates = true
unit.flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "not-repairable", "breaths-air", "player-creation"}
unit.ai_settings = { destroy_when_commands_fail = true}
unit.selection_box[1][1]= unit.selection_box[1][1]*1.2
...
unit.collision_box[1][1]= unit.collision_box[1][1]*2.5
...
unit.attack_parameters.range = unit.attack_parameters.range * 2