Page 1 of 1

[SOLVED] Actor Flag Change?

Posted: Wed Mar 02, 2016 9:23 am
by A-Bomb
Hello all, I've searched and not yet found any function or general method about changing an Actor's flags in a way that doesn't require:
  • Using A_ChangeFlag() within the actor's definition (by the way, I don't want to use this way about it simply because I want the functionality I'm adding to be able to apply to any arbitrary monster without the need to extend any specific monster classes)
  • Using SetActorProperty() in an ACS script (I just want to see if it can be done without ACS)
Is there any way to accomplish this without using the above? Here's an example:

Let's say I wanted to create a projectile that turns regular monsters into friendly monsters. In this projectile, I've enabled the HITTARGET flag so now upon Death I have the ability to obtain the Actor pointer of the monster which it hit. Using this information, would I be able to disable the FRIENDLY flag of the monster from within the Death state of the projectile?

Remember, the point of this is to have this work with any arbitrary monster class without extending existing classes or using ACS. Is this possible? Thank you for bearing with me, I'm still new to DECORATE!

Re: Actor Flag Change?

Posted: Wed Mar 02, 2016 9:55 am
by Blue Shadow
A-Bomb wrote:Let's say I wanted to create a projectile that turns regular monsters into friendly monsters. In this projectile, I've enabled the HITTARGET flag so now upon Death I have the ability to obtain the Actor pointer of the monster which it hit. Using this information, would I be able to disable the FRIENDLY flag of the monster from within the Death state of the projectile?
Through the Death state sequence of the projectile, give (via [wiki]A_GiveToTarget[/wiki], for instance) the monster a CustomInventory-derived item which has a Pickup state that calls A_ChangeFlag.

Re: Actor Flag Change?

Posted: Wed Mar 02, 2016 10:09 am
by A-Bomb
Through the Death state sequence of the projectile, give (via [wiki]A_GiveToTarget[/wiki], for instance) the monster a CustomInventory-derived item which has a Pickup state that calls A_ChangeFlag.
Ahah! I had heard about this "CustomInventory" stuff before but I'd never ventured far into this area. Much obliged friend, I shall look into this right away!