Page 1 of 1

Friendly Detection(resurrection)

Posted: Mon Oct 26, 2015 5:07 pm
by Discount Ninja
Question: Is there a way to detect if a monster has been raised to a friendly state? I'd like to apply special stats and variables if the monster goes into a state like this. Or even a way to separate the raise states if by an enemy or friend.

Why: It'd be nice to see who was friendly and not in my mod, and give slightly different abilities.

RE: Friendly Detection(resurrection)

Posted: Mon Oct 26, 2015 5:27 pm
by Lollipop
Although not pretty, you can destinguish non-player actors from each other with inventory items. You will have to check for these items on both ends of an action for this to be conciderable though, and I don't remember how to pull that off.

RE: Friendly Detection(resurrection)

Posted: Mon Oct 26, 2015 6:57 pm
by Discount Ninja
That'd be pretty easy to do if I can find a way to detect if a monster is friendly or not.

RE: Friendly Detection(resurrection)

Posted: Mon Oct 26, 2015 7:08 pm
by CloudFlash
My suggestion: modify the archvile so that he makes a small a_explode with unique damage type after he is done reviving a monster, modify the monster so that if it's hit by the special damage type, he disappears and instead spawns the friendly version of itself.
Alternatively, you could try peeking at how Zdoomwars did it, because I'm pretty sure Zdoomwars did it somehow

RE: Friendly Detection(resurrection)

Posted: Mon Oct 26, 2015 8:44 pm
by Ænima
Put this in a script and call it via ACS_ExecuteAlways in the monster's "Raise" state:

Code: Select all

if (GetActorProperty(0, APROP_Friendly) == TRUE)
{
// give inventory item, set a different DECORATE state, spawn a different actor instead, do whatever you want here
}

RE: Friendly Detection(resurrection)

Posted: Tue Oct 27, 2015 8:24 am
by Discount Ninja
That works too, thanks!

But, I found a simpler way.
TNT1 A 0 A_CheckFlag("Friendly","State goes here",AAPTR_DEFAULT)

Figures I'd find a solution as soon as I ask. =P

RE: Friendly Detection(resurrection)

Posted: Tue Oct 27, 2015 9:22 am
by Ænima
Discount Ninja wrote: That works too, thanks!

But, I found a simpler way.
TNT1 A 0 A_CheckFlag("Friendly","State goes here",AAPTR_DEFAULT)

Figures I'd find a solution as soon as I ask. =P
Ah. I forgot about A_CheckFlag.


You're welcome anyways. :p