Gamestudio Links
Zorro Links
Newest Posts
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,241 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 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 | chip programmers | 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