Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 863 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
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,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
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 | 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