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

Replicating Duke's shrink ray/freezethrower in ZDoom

Recommended Posts

It would seem like doing this would not be all too difficult but apparently it is. It is very easy to make a shrink gun by using custom death states to spawn a little guy after he's been hit. The problem is, how do I make the shrunken enemy grow to normal size? now, I'd considered simply spawning a new enemy after a set period of time, but that would restore the enemy's full health. This wouldn't be ideal against larger dudes you weren't able to squish (like mancubus, cyber etc.) because if you'd already worked down their health to some degree, then you'd have to start over. Any ideas?

On a similar note, the same goes for the Freezethrower. I'd like enemies to 'thaw out' some time after being hit (this could be easier to accomplish since an enemy only freezes after getting down to 1 health)

Any ideas?

Share this post


Link to post

If you want the enemy to shrink when it 'dies', then when it regains full size, it could spawn yet another enemy like the original, but with far less health.

The same thing might be possible with the freezing.

Share this post


Link to post

The best would be in my opinion to use a morph projectile. Though making a single morphed monster with custom states for each monster variant (and some inventory trickery to make it jump to the correct state once it's morphed) would be quite unwieldy.

For freezing, you might get away with creating a single base "DukeMonster" class, which redefines the GenericFreezeDeath state to call Thing_Raise at the end, instead of A_FreezeDeathChunks.

Share this post


Link to post
Gez said:

(and some inventory trickery to make it jump to the correct state once it's morphed)


This sounds like as good an idea as any, and I had considered this. using the morphing would be ideal, but again, making the correct shrunken monster would require some work. What exactly did you have in mind with 'inventory trickery?' My main goal is to avoid shrinking a mancubus and having it turn into a cyberdemon (or a chicken for that matter) and how would I tell the player he needs to morph to a player and not something else?

For freezing, you might get away with creating a single base "DukeMonster" class, which redefines the GenericFreezeDeath state to call Thing_Raise at the end, instead of A_FreezeDeathChunks.


I need to browse the all powerful ZDoom wiki before I comment further on this, but wouldn't that mean that trying to shatter a frozen dude would ultimately result in him unfreezing?

(on a side note, you're pretty much an awesome resource on all things ZDoom, are you ever on #zdoom?)

Share this post


Link to post
Patrick said:

What exactly did you have in mind with 'inventory trickery?'

Something that wouldn't work, actually. I thought monsters, like players, kept their inventory while morphed. They don't; though it could be requested; that'd be a single line of code (morphed->Inventory = actor->Inventory;) in P_MorphMonster().

Patrick said:

I need to browse the all powerful ZDoom wiki before I comment further on this, but wouldn't that mean that trying to shatter a frozen dude would ultimately result in him unfreezing?

Mmh... You're right. The "shatter when shot" effect is obtained by reducing to 1 the amount of remaining tics for the current state. There's still a trick that could be used to determine if the monster has been forcibly shattered or came to term naturally, and it is in the presence of the SHATTERED flag. When you shoot a frozen monster, it gains this flag. A frozen monster that reaches the end of its state doesn't. But there's no A_CheckFlag function.

Patrick said:

(on a side note, you're pretty much an awesome resource on all things ZDoom, are you ever on #zdoom?)

Nah, I don't do IRC.

Share this post


Link to post

A possibility would be that for the shrink gun, the monster could enter a custom pain state that makes it invisible/passthru/non-blocking and have it spawn a little monster. If the little monster was killed, it could somehow kill the big one, and if the small one wasn't killed, it would go away and the big monster would be teleported to the small one's location. This seems like it would require some ACS nonsense that I wouldn't care to bother with. And it passes the point of 'this is more work that it's worth.' I'll add a feature request over at ZDoom for the morphing stuff.

EDIT: Could it be possible to write a simple acs function that 'passes on' the big monster's health to the small monster, and then to the big monster again? SetActorProperty and GetActorProperty could be useful for this.

Share this post


Link to post

hmmm perhaps custom damagetypes might be used to our advantage? have a custom damage type that corresponds to every monster, and so that when a monster is hit by one, it will morph into whatever appropriate small dude it is supposed to be? and I solved the freezethrower issue, that was deceptively simple.

Share this post


Link to post

The only problem with morphing is that if they ever change back before dying, they go back to full health.

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×