Gamestudio Links
Zorro Links
Newest Posts
Future of ZorroHFT
by TipmyPip. 11/16/25 13:52
COT Download with Quandl does not work
by Petra. 11/15/25 09:35
Training with the R bridge does not work
by Petra. 11/15/25 09:31
Zorro 2.70
by jcl. 11/15/25 08:43
Camera always moves upwards?
by NeoDumont. 11/14/25 16:32
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (TipmyPip, Grant, Ayumi, ozgur, Quad), 7,400 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
tritom, sheliepaley, Blueguy, blobplayintennis, someone2
19178 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
About on_ent_remove #474726
11/01/18 14:23
11/01/18 14:23
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Hi!

I just wanted to ask about - on_ent_remove (manual isn't really clear enough about it). Let's say I have something like this:
Code:
action test_dummy(){
	
	on_ent_remove = remove_dummy;
	
	while(my){
		
		wait(1);
		
	}
	
}

Will this set 'remove_dummy' only for this entity (test_dummy), OR will it call it for all entities before deleting them? If by that single line I set 'remove_dummy' for all removing entities, this will mess all other on_ent_remove function set by the engine (f.e. physX) right? I'm a bit confused. Is there a function/event to be set for a specific entity, without messing other stuff?

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: About on_ent_remove [Re: 3run] #474727
11/01/18 14:45
11/01/18 14:45
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
The manual reads like it gets called for every entity, I guess you could tag yours with a specific skill to figure out when you want to run a certain action.

To chain them, just take the pointer of the previous function and run it inside of yours, something like this:

Code:
function (*prev_ent_remove)(ENTITY *); 

function my_ent_remove(ENTITY *ent)
{
   // ...

   if(prev_ent_remove)
       prev_ent_remove();
}


void main()
{
    prev_ent_remove = ent_remove;
    ent_remove = my_ent_remove;
}



(No guarantee that this will run like this in Lite-C cuz Lite-C is weird af, but you get the idea)


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: About on_ent_remove [Re: WretchedSid] #474728
11/01/18 15:25
11/01/18 15:25
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Hey, that sounds like a good workaround. Thank you!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung

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

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