Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (VoroneTZ, 7th_zorro, AndrewAMD), 1,054 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
removing an entity after a few seconds ? #313328
02/28/10 19:00
02/28/10 19:00
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
Can someone please remind me how to remove an entity after a few seconds. I am producing some physics objects and I want to remove them after a while as the engine slows down.

Thanks

Re: removing an entity after a few seconds ? [Re: dracula] #313331
02/28/10 19:13
02/28/10 19:13
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
function remove_ent(ENTITY* ent,var seconds){
wait(seconds*-1);
ent_remove(ent);
}

make sure you are using something like this in the removed entity

Code:
action physics_object{
  //your stuff here
  while(me){
      //more of your stuff
      if(some_certeain_thing_happens)remove_ent(me,0.5);
      wait(1);
  }
}




3333333333
Re: removing an entity after a few seconds ? [Re: Quad] #313334
02/28/10 19:38
02/28/10 19:38
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
Thank you, I'll try it

Cheers


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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