Code: Select all
game.surfaces[1].create_entity {
name = "entity-ghost",
inner_name = "decider-combinator",
position = {0, 0},
force = "player",
player_description = "test",
control_behavior = {
decider_conditions = {
conditions = {},
outputs = {{signal = {type = "item", name = "iron-ore"}}}
}
}
}
In contrast to building the entity proper
Code: Select all
game.surfaces[1].create_entity {
name = "decider-combinator",
position = {0, 0},
force = "player",
player_description = "test",
control_behavior = {
decider_conditions = {
conditions = {},
outputs = {{signal = {type = "item", name = "iron-ore"}}}
}
}
}
I expect the control_behavior to be applied in both cases.
As far as I could see this is the case with `control_behavior` for all entity types, none of the behaviours get added.
There might be other entity-specific attributes which are not applied either for ghosts, but I haven't found any.
Usecase:
I'm saving a blueprints BlueprintEntity and Tiles tables so it can be placed automatically at some later time, without having to worry the original blueprint has been destroyed/changed.
With the BlueprintEntity table it's very useful to be able to do
Code: Select all
blueprint_entity.inner_name = blueprint_entity.name
blueprint_entity.name = "entity-ghost"
blueprint_entity.force = player.force
surface.create_entity(blueprint_entity)It applies recipes, filters, priorities etc, everything but the control_behavior.

