Page 1 of 1

Look for all machines with name "x"

Posted: Thu Feb 28, 2013 8:46 pm
by ficolas
Well so I need to ejecute a lua code where every machine X is placed
I asked this, and kovarex said that I can use the findentity function, but that this will be slow, How do I use this?
Also, I can use the onplace event, to record the position of the machine on a file, using the file API, but in order to do this, ill need to check if the entity is still there, I could use isvalid, but that wont say that the name is "x", it will only say that there is an entity.

Re: Look for all machines with name "x"

Posted: Thu Feb 28, 2013 8:48 pm
by kovarex
You can manage the list of all entities created by player by catching events oncreated, onmined and onbuild ...

Re: Look for all machines with name "x"

Posted: Thu Feb 28, 2013 9:09 pm
by ficolas
I think the onmined event isnt at the wiki