View Single Post
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 01-28-2017 , 16:38   Re: How to SetParent
Reply With Quote #13

Funny thing, apparently my common stocks .inc had

PHP Code:
AcceptEntityInput(iChild"SetParent"iParentiParent); 
Which prevents ClearParent from working properly.

Be sure not to make this mistake ;p


So what do you do to remove particles that linger even if you Stop and Kill them? ("duel_blue" and "duel_red")

PHP Code:
RemoveDuelIcon()
{
    new 
iDuel EntRefToEntIndex(g_iDuelTargetEntRef);
    if (
IsValidEnt(iDuel))
    {
        
AcceptEntityInput(iDuel"ClearParent");
        
TeleportEntity(iDuelOFF_THE_MAPNULL_VECTORNULL_VECTOR);
        
//DelayEntityInput(iDuel, "Stop", 0.05);
        
DelayEntityInput(iDuel"Kill"0.1);
        
g_iDuelTargetEntRef INVALID_ENTREF;
    }

The "Kill" input has to be sent later apparently, else the entity dies in place and leaves its remnants.

duel_icon particles apparently have a long lifetime which is why the particle persists even after the entity is destroyed.
__________________

Last edited by Chdata; 01-29-2017 at 04:57.
Chdata is offline