[0.12.10] Circuit network get_blueprint_entities and create_entity
Posted: Sun Oct 04, 2015 2:36 pm
Steps to reproduce:
1. Connect 2 constant combinators like in the image below
2. Place a blueprint of them in the first slot of your quicker
3. Execute the follow code in the console. It's gonna place the entity of the blueprint using the create_entity methode
Expected results: The 2 constant combinators connected by a red wire shut be placed at the players position
Actual results: The 2 constant combinators get placed without red wire connecting them
1. Connect 2 constant combinators like in the image below
2. Place a blueprint of them in the first slot of your quicker
3. Execute the follow code in the console. It's gonna place the entity of the blueprint using the create_entity methode
Code: Select all
/c local es = game.player.character.get_inventory(defines.inventory.player_quickbar)[1].get_blueprint_entities() for k,v in pairs (es) do local g={} for k,v in pairs(v) do g[k]=v end g.inner_name=v.name g.inner_name=v.name g.position.x=g.position.x+game.player.position.x g.position.y=g.position.y+game.player.position.y g.force=game.player.force game.surfaces.nauvis.create_entity(g) end
Expected results: The 2 constant combinators connected by a red wire shut be placed at the players position
Actual results: The 2 constant combinators get placed without red wire connecting them