Reaper_Man, on 19 October 2022 - 02:19 PM, said:
When "enemy" gets blown up by an rpg, trying to check its extra will throw the same error won't it?
Ideally I'd have the orbitsprite change action upon the parent dying or ceasing to exist so if a removed sprite returns 0 or -1 extra all is well.
One more thing I'm trying to do is nullify selfdamage this enemy takes from projectiles spawned by its orbitsprites.
Below works mostly but they still manage to blow themselves up sometimes. The 4 picnums are projectiles and an explosion they spawn
state projectilenull getactor[THISACTOR].htpicnum TEMP2 ifvare TEMP2 9996 setactor[THISACTOR].htextra -1 else ifvare TEMP2 9997 setactor[THISACTOR].htextra -1 else ifvare TEMP2 9998 setactor[THISACTOR].htextra -1 else ifvare TEMP2 9999 setactor[THISACTOR].htextra -1 ends actor BOSS4 BOSS4STRENGTH fall ifvare boss 0 { getactor[THISACTOR].htextra TEMP ifvarg TEMP 0 { state projectilenull } } spritepal 6 ifvare boss 0 state notbosscode else state boss4code getlastpal enda
The best version of this someone wrote for the cycloid sentry just compares the owner id of the projectile to the actor's id,
but in this the case it's an actor spawning a sprite that spawns a projectile. Passing the 1st actor's id down via var is easy enough but I haven't figured out how to get the id of the projectile to the 1st actor to compare that var.