Gamestudio Links
Zorro Links
Newest Posts
How is this possible ? winning percentage 100%
by chsmac85
Today at 14:15
Asset capacity
by tuuPaul
Today at 13:48
New Zorro version 1.96
by jcl
Today at 13:13
Next contest?
by Michael_Schwarz
Today at 10:33
Help! 1.88.6 Crashes <5 minutes after clicking Trade!
by jcl
Today at 10:28
WFO
by jcl
Today at 10:27
TA-Lib not updated
by jcl
Today at 10:24
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
16 registered (Ayumi, MatPed, alibaba, kvm, chsmac85, KadigunFx, CocaCola, HellThunder, 3 invisible), 462 Guests and 7 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
fandi, Deedee, avgtrader, aventador, gokhanuck
18103 Registered Users
Topic Options
Rate This Topic
#474726 - 11/01/18 15:23 About on_ent_remove
3run Offline
Senior Expert

Registered: 05/05/09
Posts: 5092
Loc: 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

Top
#474727 - 11/01/18 15:45 Re: About on_ent_remove [Re: 3run]
WretchedSid Offline
Expert

Registered: 04/23/07
Posts: 3748
Loc: 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

Top
#474728 - 11/01/18 16:25 Re: About on_ent_remove [Re: WretchedSid]
3run Offline
Senior Expert

Registered: 05/05/09
Posts: 5092
Loc: Caucasus
Hey, that sounds like a good workaround. Thank you!
_________________________
Looking for free stuff?? Take a look here: http://badcom.at.ua

Top


Moderator:  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