Page 1 of 1

Search ALL entities in the game

Posted: Thu Jun 06, 2013 11:27 am
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

Re: Search ALL entities in the game

Posted: Thu Jun 06, 2013 11:57 am
by slpwnd
Finding all the entities is not feasible or possible now. Saving / Loading mod entities should work fine. Could you post your code?

Re: Search ALL entities in the game

Posted: Thu Jun 06, 2013 12:18 pm
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