Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
purist

self raising in Decorate

Recommended Posts

I'm trying to use Decorate to have an imp raise itself from the dead after it's killed (like zombies in Quake).

I put replaced 'stop' with 'goto raise' after the death frame and increased the time to 150.

It appeared to work except but after it 'raises' it's no longer a solid object (projectiles pass through it, you can walk through it too). It can still cause damage to you.

I tried fiddling about with the frame sequences and going straight to 'see' instead of 'raise' but I get the same effect.

Can anybody help?

Share this post


Link to post

probably the reason why its no longer a solid object is because its death states have the action function A_NoBlocking. Maybe you should try adding A_SetSolid in its raise states.

Share this post


Link to post
kristus said:

You probably has to give it some health too.


Do you mean re-set it's health, if so how do you do it? Obviously, it starts with health.

Worst said:

probably the reason why its no longer a solid object is because its death states have the action function A_NoBlocking. Maybe you should try adding A_SetSolid in its raise states.


I've tried that but it makes no difference. Tried removing A_SetSolid from it's death states but that didn't change anything either.

The closest I've got is either using A_SetShootable or A_ChangeFlag("SHOOTABLE,1") in the raise states. Now, after raising, the imp is solid but doesn't take damage.

I don't understand why it doesn't work since it must go through the same set of states and codepointers when it's resurrected by an archvile.

Anymore ideas? Here's my Decorate file if it's any use.


actor FormerImp : DoomImp 3666
{
spawnid 5
obituary "%o was flamed by a former imp."
hitobituary "a former imp returned to haunt %o."
+SHOOTABLE
states
{
Spawn:
FIMP AB 10 A_Look
loop
See:
FIMP AABBCCDD 3 A_Chase
loop
Melee:
Missile:
FIMP EF 8 A_FaceTarget
FIMP G 6 A_TroopAttack // See DoomImpBall
goto See
Pain:
FIMP H 2
FIMP H 2 A_Pain
goto See
Death:
FIMP I 8
FIMP J 8 A_Scream
FIMP K 6
FIMP L 6
FIMP M 150
goto Raise
Raise:
FIMP ML 8 A_XScream
FIMP KJI 6 A_ChangeFlag("SHOOTABLE",1)
goto See
}
}

Share this post


Link to post

Possibly you should add the flag MONSTER above the flag +SHOOTABLE

I'm not sure if it will work or not, though

Share this post


Link to post

Purist, I've analyzed your code, and I can tell you what you did.
When the HP of an enemy in Zdoom is reduced to 0, the actor has its height set to 16. What you basically did was respawn a ghost version of the imp except that it walks through spaces with a height of 16 instead of 0. The Raise state only defines the frames for the actor's revival while the Arch-vile's heal state actually resets its height, flags, and HP. Therefore, your Imp is still considered "dead" with 0 HP and height 16, so even if you set it to shootable, it won't mean anything. (Just for the record, the "goto Raise" line is redundant since there is no "stop" to prevent it from going there next anyway.)

Arch-viles in Zdoom work by basically creating a new enemy upon resurrecting, which is why the total number of enemies increases by 1 when it does this. Since I don't believe HP or height can be reset with functions, you will have to recreate this style of resurrection.

What you will have to do is to leave it in its dead state for 5 seconds then play the death frames backwards, still in the death state. At the end of the death state, use a blank frame (all cyan colored so it is invisible) to call the A_CustomMissile function to call another respawning imp (recursion, basically.) This imp will have all its flags and stats at their initial values and it will incriment the kill counter like normal, basically simulating the archie's heal state. The fact it is spawned as a projectile means that if something is standing on it, it will simply be telefragged. If you still want it to respawn after being gibbed, you can just define the gib death sequence in the same way. Since you didn't put a -1 frame, archies won't know it's dead and try to resurrect an enemy that can respawn itself. The old corpse will not be able to be interacted with, just like a pain elemental.

Consider this code:

Actor UndeadImp: DoomImp 3667
{
spawnid 5
obituary "%o was flamed by an Undead Imp."
hitobituary "The Undead Imp ripped %o to pieces."
MONSTER
+FLOORCLIP
states
{
Spawn:
FIMP AB 10 A_Look
loop
See:
FIMP AABBCCDD 3 A_Chase
loop
Melee:
Missile:
FIMP EF 8 A_FaceTarget
FIMP G 6 A_TroopAttack
goto See
Death:
FIMP I 8
FIMP J 8 A_Scream
FIMP K 6
FIMP L 6 A_NoBlocking
FIMP M 150
FIMP L 6 A_XScream
FIMP K 6
FIMP J 8
FIMP I 8
FIMP V 0 A_CustomMissile("UndeadImp",0,0) //The invisible frame that makes a new imp
stop
}
}

That's the easiest way to solve your problem. I hope this is what you're looking for. While it's not necessarily a perfect self-respawn, all the other things I can think get much more complicated and messy. I hope I explained that well and that you understood all of it. =/ Let me know if you want me to explain a perfect respawn to you if this isn't good enough.

Share this post


Link to post

Thanks Death-Destiny - I'm happy with that. I tried reversing the the death frames but would never have been able to get my head around the projectile part on my own.

I don't want the imp to be able to re-raise after being gibbed so I just have to work on the sprites now.

Share this post


Link to post

All this messing around and yet there's one simple solution:

Actor UndeadImp: DoomImp 3667
{
spawnid 5
obituary "%o was flamed by an Undead Imp."
hitobituary "The Undead Imp ripped %o to pieces."
MONSTER
+FLOORCLIP
states
{
Spawn:
FIMP AB 10 A_Look
loop
See:
FIMP AABBCCDD 3 A_Chase
loop
Melee:
Missile:
FIMP EF 8 A_FaceTarget
FIMP G 6 A_TroopAttack
goto See
Death:
FIMP I 8
FIMP J 8 A_Scream
FIMP K 6
FIMP L 6 A_NoBlocking
FIMP M 150
FIMP M -1 Thing_Raise(0)
Wait
}
}

Share this post


Link to post

That is a simple solution, Thanks! It's a shame modifying the sprites isn't so simple.

Share this post


Link to post
TheDarkArchon said:

All this messing around and yet there's one simple solution:


Sorry to double post but there's a couple of bugs that arise with this code.

1. The former imp won't re-raise if you stand on it's body.
2. I've modified the former imps sprites to distinguish it from the regular imp but after re-raising it switches to the regular imp sprites until it attacks or gets hit.

Anyway around these? I'm still really pleased with the code but it'd be nice to smooth out these little niggles.

EDIT: Forget point two - I've fixed it. I'd left the raise command inherited from the regular imp. To fix I just added the raise states into DECORATE with the former imps sprite file names included.

Share this post


Link to post

Both should be fixed here (You are using ZDoom 2.2.0 or better, right?)

Actor UndeadImp: DoomImp 3667
{
spawnid 5
obituary "%o was flamed by an Undead Imp."
hitobituary "The Undead Imp ripped %o to pieces."
MONSTER
+FLOORCLIP
states
{
Spawn:
FIMP AB 10 A_Look
loop
See:
FIMP AABBCCDD 3 A_Chase
loop
Melee:
Missile:
FIMP EF 8 A_FaceTarget
FIMP G 6 A_TroopAttack
goto See
Death:
FIMP I 8
FIMP J 8 A_Scream
FIMP K 6
FIMP L 6 A_NoBlocking
FIMP M 150
ResAssurance
FIMP M 1 Thing_Raise(0)
Loop
Raise:
FIMP LK 6
FIMP JI 8
Goto See
}
}

Share this post


Link to post

I'm using version 2.2.0.748, but that code's not working. It won't raise at all - whether I'm stood on the body or not.

The sprite problem is sorted now (see edited post).

Share this post


Link to post
purist said:

I'm using version 2.2.0.748, but that code's not working. It won't raise at all - whether I'm stood on the body or not.


I don't think it can respawn if you're standing on it. Thing_Raise(tid) simulates the Archie's heal state, which also can't do this (presumably because it would get stucked into whatever's standing on it.) AFAIK, For Thing_Raise(tid) to work, the tic number has to be -1 so Doom knows it's done executing code and to be resurrectable, but since -1 stops code execution, you can't make it do anything else if Thing_Raise(tid) fails.

Share this post


Link to post

Never mind. It's close enough. I'm still looking forward to putting it into a map.

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
×