Search ALL entities in the game

Place to get help with not working mods / modding interface.
Spawn
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu May 23, 2013 1:44 pm
Contact:

Search ALL entities in the game

Post by Spawn »

Hello,
question: How can I List all entities? Or, maybe it exist a globale table?
The Problem:
I save a game with mod-entities. After loading the game, the entities (modiefied assembling maschine) created in the game.
But my user-predefined table >glob.Modmaschine< is empty. Here I store some properties and values for the mod-entity.
Without this properties the entities don`t work.
So I think about a workaround: OnLoad I search every entity, filter the mod-entities and destroy it. then create it new on same position and fill my table with the properties. :o

But this function need a rectangle to search, right? Whats the game borders?

Code: Select all

AllEntities = game.findentities{ {x1, y1}, {x2, y2} }
Greetings Frank

slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: Search ALL entities in the game

Post by slpwnd »

Finding all the entities is not feasible or possible now. Saving / Loading mod entities should work fine. Could you post your code?

Spawn
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu May 23, 2013 1:44 pm
Contact:

Re: Search ALL entities in the game

Post by Spawn »

Hello,
thx for your post. After you wrote "it must work", I look over my code again.
And -shame on me- :oops: in one case, my skript kills the tables. :roll:

Thanks Frank

Post Reply

Return to “Modding help”