Sign in to follow this  
Followers 0

Custom imp not properly raised (zdoom)

I've been tweaking the 'superimp' from realm667 a bit. In testing I have noticed that when the monster is splattered and then raised by an archvile it is the normal death sprites in reverse, not the splatter sprites. Any idea why?

code:

ACTOR SuperImp : BaronOfHell 3133
{
Game Doom
Health 60
Radius 20
Height 56
Mass 100
Speed 8
PainChance 200
BloodColor green
Obituary "%o was shocked by the imp's superior firepower."
Monster
+FLOORCLIP
SeeSound "imp/sight"
PainSound "imp/pain"
DeathSound "imp/death"
ActiveSound "imp/active"
HitObituary "$OB_IMPHIT"
Obituary "$OB_IMP"
States
{
Spawn:
IMP4 AB 10 A_Look
Loop
See:
IMP4 AABBCCDD 3 A_Chase
Loop
Melee:
Missile:
IMP3 A 8 A_FaceTarget
IMP3 B 8 A_FaceTarget
TROO G 8 A_BruisAttack
Goto See
Pain:
TROO H 2
TROO H 2 A_Pain
Goto See
Death:
IMP4 I 8
IMP4 J 8 A_Scream
IMP4 K 6
IMP4 L 6 A_NoBlocking
IMP4 M -1
Stop
XDeath:
IMP4 N 5
IMP4 O 5 A_XScream
IMP4 P 5
IMP4 Q 5 A_NoBlocking
IMP4 RST 5
IMP4 U -1
Stop
Raise:
IMP4 MLKJI 8
Goto See
}
}

Share this post


Link to post

The frames specified within the "Raise" state are the normal death frames, not the splatter frames.

The archvile clears the DEAD bit, restores its health, and tells it to enter to "Raise" state. I'm not sure how to get it to enter a custom raise state, if possible.

Share this post


Link to post
Mista_T said:

The frames specified within the "Raise" state are the normal death frames, not the splatter frames.


Just looking through all other monsters' codes, this always seems to be the case.

Example: regular imp Raise state -

Raise:
TROO MLKJI 8
Goto See

Share this post


Link to post

I got an idea - it's been a while since I did anything in ZDoom, but can you set variables or values on actors?

Set a variable called "splattered" to 1 before the final XDeath frame, and to 0 before the last Death frame. Then, when it enters Raise, branch on the value of that variable (if "splattered" = 1, go to SplatterRaise, else goto NormalRaise).

Share this post


Link to post

If you want it to play the right animation in the right situation, then here is an example of what to do using the original Doom imp:

ACTOR CoolImp : DoomImp
{
  States
  {
  XDeath:
    TNT1 A 0 A_GiveInventory("ImpGibbed", 1)
    Goto Super::XDeath
  Raise:
    TNT1 A 0 A_JumpIfInventory("ImpGibbed", 1, "GibRaise")
    TROO MLKJI 8
    Goto See
  GibRaise:
    TNT1 A 0 A_TakeInventory("ImpGibbed", 1)
    TROO UTSRQPON 5
    Goto See
  }
}

ACTOR ImpGibbed : Inventory {}
When the monster is gibbed, it's given a dummy inventory item (ImpGibbed). Once it starts to rise, it checks for the presence of said item in its inventory and if it's there, then the monster rises while playing the gib animation, however if the item doesn't exist, then it plays the normal death animation.

Share this post


Link to post
Blue Shadow said:

If you want it to play the right animation in the right situation, then here is an example of what to do using the original Doom imp:


When the monster is gibbed, it's given a dummy inventory item (ImpGibbed). Once it starts to rise, it checks for the presence of said item in its inventory and if it's there, then the monster rises while playing the gib animation, however if the item doesn't exist, then it plays the normal death animation.


Cool, that worked. Seems a bit odd since all my other monsters un-gib without the special state, but whatever works! Thanks.

Share this post


Link to post

Ok, I just checked raising a regular splattered imp and it raised the normal frames too! Is this something that's always happened and I never noticed? Mind = blown.

Share this post


Link to post

Yes, it has always been this way. Not just for the imp, but for all other monsters, as well.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0