Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (AndrewAMD, Ayumi, NewbieZorro), 14,141 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
remove entities with the same attributes #66935
03/17/06 22:31
03/17/06 22:31
Joined: Dec 2005
Posts: 252
MyOwnKingdom
nipx Offline OP
Member
nipx  Offline OP
Member

Joined: Dec 2005
Posts: 252
MyOwnKingdom
HI!

I need a function that remove all entieties who have something in common.
I played with handle & arrays, but it didnt work because some of the entieties were removed before.

Example: all entities with Skill99==1 -> ent_remove

I think this is possible, but I cant find the solution...

thx nipx

Re: remove entities with the same attributes [Re: nipx] #66936
03/17/06 23:17
03/17/06 23:17
Joined: Dec 2005
Posts: 414
Munich, Germany
R
Robotronic Offline
Senior Member
Robotronic  Offline
Senior Member
R

Joined: Dec 2005
Posts: 414
Munich, Germany
Hi!
You could use the ent_next() instruction to access all your level entities.
I modified the example from the manual.

function remove_ents()
{
you = ent_next (NULL); // retrieve first entity
while (you != NULL) // repeat until there are no more entities
{
if(you.skill1 == 5) //just an example
{
ent_remove(you); // remove entity
}
you = ent_next (you); // get next entity
}
}

on_x = remove_ents;

If you use this code and press the x-key, all entities that have skill1 set to 5 should be removed. I hope it works! I´m no great coder, and didn´t test anything ...

Re: remove entities with the same attributes [Re: Robotronic] #66937
03/17/06 23:31
03/17/06 23:31
Joined: Dec 2005
Posts: 252
MyOwnKingdom
nipx Offline OP
Member
nipx  Offline OP
Member

Joined: Dec 2005
Posts: 252
MyOwnKingdom
ent_next? I have never heard before but i agree it's a good idea.

thx, i'll try it out!

nipx

Re: remove entities with the same attributes [Re: nipx] #66938
03/17/06 23:58
03/17/06 23:58
Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Ran Man Offline
Expert
Ran Man  Offline
Expert

Joined: Jun 2002
Posts: 3,682
Coppell, Texas
Code:
 action l1_toplayer
{
while ((my != null) && (levelone == 0)){wait (1);}
// wait here until off of top layer

if (my ! = null){ent_remove(me);}
wait(1);
}



Just change the variable named "levelone" to take out the entities...


Cougar Interactive

www.zoorace.com

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1