get parent frame number

hi everyone
i have create some Unconscious animations for all characters in my game that their names are pain11 ,death11,follow30
in pain11 I summoned an object that called star(star animation is 5 star that rolling over character head
in star i summoned star_shadow that is the shadow effect for star to make it more believable
here is my code in star
@script
void self = getlocalvar("self");
void vSpawn;
void parent = getentityproperty(getlocalvar("self"),"parent");
if (frame == 0)
{
setspawnentry("name", "star_shadow");
vSpawn = spawn();
bindentity(vSpawn, self, 0, -1, 0, 1, 0);
changeentityproperty(vSpawn, "direction", getentityproperty(self, "direction"));
changeentityproperty(vSpawn, "position", (getentityproperty(self,"x")),(getentityproperty(self,"z")), (getentityproperty(self,"a")));
clearspawnentry();
}
if ( frame == 192 )
{
killentity(vSpawn);
killentity(vSpawn);
killentity(self);
}
if (((getentityproperty(parent,"animationid"))!=(openborconstant("ANI_FOLLOW30")))&&((getentityproperty(parent,"animationid"))!=(openborconstant("ANI_PAIN11")))&&((getentityproperty(parent,"animationid"))!=(openborconstant("ANI_DIE11"))))
{
killentity(vSpawn);
killentity(vSpawn);
killentity(self);
}
@end_script
now i explain my problem . if i attack the enemy with attack11 when enemy animation is pain11 there will be 2 star
the easiest way that i thought is in star i get parent animation frame number and if parent frame == 0 star would kill itself
and first star would be disappeared and second one remains

can some one tell me how to read parent frame number?
 
Last edited:
Back
Top Bottom