Wounded state & alternative behaviour

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
InsaneFury
Posts: 105
Joined: Mon Nov 23, 2009 6:51 am

Wounded state & alternative behaviour

Post by InsaneFury »

I'm looking for a way to implement some kind of Mortal Kombat-'esque "finishing move".

Basically it'd go like this:
[zombieman see]
(player shoots)
[zombieman pain]
(player shoots)
[zombieman wounded]
(player uses chainsaw --> death1) OR (player uses rocketlauncher --> death2)
I noticed you can specify custom Wounded states per damagetype, but for this, I think I'd need a secondary wounded state?

Alternatively, it should be 'solvable' by creating a new actor and spawning it at the zombieman death state, but I'd rather have all behaviour combined in one actor. Would this be possible in any way?

I know it's possible to have Death.<Damagetype> and Wounded.<Damagetype> states, but the Death.<Damagetype> is used for the 'normal' Zombieman deaths, where the Wounded.<Damagetype> states would be useless as I want the actor to enter the Wounded state _before_ checking the DamageType after that.
User avatar
Chronos
Posts: 170
Joined: Tue Dec 30, 2008 1:58 pm
Location: Somewhere in your nightmare...

Re: Wounded state & alternative behaviour

Post by Chronos »

It should be easily done by ACS
So if health lower then enter some state(better not wounded if this state already exist)
after this you checks by which weapon actor was killed and makes zombieman enters proper state.
I may be wrong somewhere because i wasn't looking at this side of ACS but mechanics probably same.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Wounded state & alternative behaviour

Post by XutaWoo »

Or you could just have dummy inventory items with A_Give/TakeInventory and A_JumpIfInventory.
User avatar
InsaneFury
Posts: 105
Joined: Mon Nov 23, 2009 6:51 am

Re: Wounded state & alternative behaviour

Post by InsaneFury »

XutaWoo wrote:Or you could just have dummy inventory items with A_Give/TakeInventory and A_JumpIfInventory.
How would that work exactly? I'd basically have all Wound.<damagetype> states give a custom inventoryitem corresponding to that damagetype to the actor, then the general Death states would check for such an item and play a different state?

I'm a bit hesitant to do ACS scripting if I don't need to; somehow I feel more comfortable with DECORATE (primarily because I've failed to compile all my ACS scripts as the compiler couldn't understand some Zdoom-specific code).
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Wounded state & alternative behaviour

Post by XutaWoo »

insanefury wrote:
XutaWoo wrote:Or you could just have dummy inventory items with A_Give/TakeInventory and A_JumpIfInventory.
How would that work exactly? I'd basically have all Wound.<damagetype> states give a custom inventoryitem corresponding to that damagetype to the actor, then the general Death states would check for such an item and play a different state?
Yar. Although if you want to have different fatalities for different weapons after the guy's been stunned, you'll still need a custom deathstate for that weapon; having different Wound states wouldn't actually do much unless you want all of the weapons to do the same fatality if the guy's been wounded by one weapon.
User avatar
InsaneFury
Posts: 105
Joined: Mon Nov 23, 2009 6:51 am

Re: Wounded state & alternative behaviour

Post by InsaneFury »

XutaWoo wrote: Yar. Although if you want to have different fatalities for different weapons after the guy's been stunned, you'll still need a custom deathstate for that weapon; having different Wound states wouldn't actually do much unless you want all of the weapons to do the same fatality if the guy's been wounded by one weapon.
Ah, so I'd first have a generic Wounded give a custom IsWounded inventoryitem. And then create regular Death.<DamageType> states, but in those states I'd check if the IsWounded item is set: if it is, it'll play the 'fatality' scene and if not, it continues to the generic death state? :D
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Wounded state & alternative behaviour

Post by XutaWoo »

Yep.
User avatar
InsaneFury
Posts: 105
Joined: Mon Nov 23, 2009 6:51 am

Re: Wounded state & alternative behaviour

Post by InsaneFury »

I was wondering: is it possible to make a generic (monster-inherited) Wounded/Dizzy state which would reference the sprite used in the Pain state?

Inheriting a parent state is possible via DECORATE, but that inherits the parent's sprite too. Can this be circumvented, possibly using ACS?

Ideally, I want to make all (even custom) monsters susceptible to fatalities. Having a single spot to define the state, while still being able to use monster-specific sprites would be very convenient.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Wounded state & alternative behaviour

Post by XutaWoo »

Nope.

There's not even a way to define a base class for all monsters.
User avatar
Demolisher
Posts: 1749
Joined: Mon Aug 11, 2008 12:59 pm
Graphics Processor: nVidia with Vulkan support
Location: Winchester, VA
Contact:

Re: Wounded state & alternative behaviour

Post by Demolisher »

InsaneFury wrote:I was wondering: is it possible to make a generic (monster-inherited) Wounded/Dizzy state which would reference the sprite used in the Pain state?

Inheriting a parent state is possible via DECORATE, but that inherits the parent's sprite too. Can this be circumvented, possibly using ACS?

Ideally, I want to make all (even custom) monsters susceptible to fatalities. Having a single spot to define the state, while still being able to use monster-specific sprites would be very convenient.

[wiki=Classes:Actor][Massive Hack][/wiki]
[/Massive Hack]
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wounded state & alternative behaviour

Post by Graf Zahl »

Massive hack indeed! There's certainly no better way to break your mod than to replace the internal class definitions.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Wounded state & alternative behaviour

Post by NeuralStunner »

Isn't that a planned feature/advantage of DoomScript though? :)
User avatar
InsaneFury
Posts: 105
Joined: Mon Nov 23, 2009 6:51 am

Re: Wounded state & alternative behaviour

Post by InsaneFury »

One more question: Isn't there a DamageType for chainsaw damage/MOD_CHAINSAW?
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: Wounded state & alternative behaviour

Post by Project Shadowcat »

No, don't believe so. Just "Normal" if I remember right.
User avatar
Zetta
Posts: 10
Joined: Sun Apr 19, 2009 3:17 pm

Re: Wounded state & alternative behaviour

Post by Zetta »

Wow thats a pretty cool idea, can´t imagine how itwould be used though.
Locked

Return to “Editing (Archive)”