StrifePlayer additional states?

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
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

StrifePlayer additional states?

Post by Skippy »

According to the [wiki=Classes:StrifePlayer]StrifePlayer[/wiki] article, two new states were added to the class in r1125 - 'Firehands' and 'Firehandslower'. I assume this is in relation to the special player burn death discussed in the past. Can anyone shed some light on their function, and wether or not this is part of an effort to implement POV death sprites or similar? :|
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Re: StrifePlayer additional states?

Post by Skippy »

I'll give this a bump. Anyone (particularly devs) able to assist?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: StrifePlayer additional states?

Post by Graf Zahl »

Those are the burning hand 'weapon' sprites. They are referenced by the StrifePlayer's A_ItBurnsItBurns and A_CrispyPlayer code pointers (great names, btw.)
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Re: StrifePlayer additional states?

Post by Skippy »

Thanks for replying, Graf. Sorry for not being clear enough - I know what they do and that they are referenced by the aforementioned action functions, but I was curious as to why they only appeared as part of the player's DECORATE definition recently (at least in relation to how long we've had Strife support). Is there a generic POV death sprite implementation in the works / is A_ItBurnsItBurns et al being exposed for generalised DECORATE usage?

Based on your comments in the linked thread above, it appears that a generic implementation of 'death hands' was feasible from as far back as May 2007. :|
User avatar
InsaneFury
Posts: 105
Joined: Mon Nov 23, 2009 6:51 am

Re: StrifePlayer additional states?

Post by InsaneFury »

I'm bumping this one a bit, as I'm looking into using the A_ItBurnsItBurns() and A_CrispyPlayer() for a playerclass-based DooM2 project. I'd like to have some light shed on how these features can be used, as the Wiki is quiet about them so far...
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: StrifePlayer additional states?

Post by XutaWoo »

From what I'm guessing, A_ItBurnsItBurns causes your weapon to go to the player's Firehands state, while A_CripsyPlayer causes it to go to the Firehandslower state.

You'll need to inhereit from StrifePlayer if you want to use them, I'm guessing.
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: StrifePlayer additional states?

Post by NeuralStunner »

XutaWoo wrote:You'll need to inhereit from StrifePlayer if you want to use them, I'm guessing.
Yes. These code pointers are declared native to StrifePlayer in Decorate.
User avatar
InsaneFury
Posts: 105
Joined: Mon Nov 23, 2009 6:51 am

Re: StrifePlayer additional states?

Post by InsaneFury »

I'd like to see if I can use the effect in DooM2, but I can't seem to get it to work.

The player displays the Burn animation, but the Waving hands only seem to display very shortly. Basically in the Death state, I put Goto Fire state, which plays correctly until A_CrispyPlayer is called. ZDoom crashes right there (Report).


I uploaded a test wad here, could anyone have a look & see what's broken?
Note that I copied the sprites from Strife 1:1 without touching the palette (which for demonstration purpose shouldn't matter much).
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: StrifePlayer additional states?

Post by NeuralStunner »

Hmm...
A_ItBurnsItBurns is what tells the engine not to immediately drop dead, and is supposed to start the hand waving animation (FireHands) instead. A_CrispyPlayer apparently tells it that the player is now dead, and to drop him to the floor immobile, while lowering the waving arms (FireHandsLower). Without it, you can still "walk" around and open doors after "dying".

Since the hand wave animation doesn't play, (and God only knows why,) I think this might be why the latter codepointer crashes.
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: StrifePlayer additional states?

Post by Gez »

Here's some code. Note that P_SetPsprite is the function that sets the "player sprite", that is to say, the various HUD sprite thingies (weapons, weapon flashes, targeter powerup, etc.).

Code: Select all

DEFINE_ACTION_FUNCTION(AActor, A_CrispyPlayer)
{
	if (self->player != NULL && self->player->mo == self)
	{
		self->player->playerstate = PST_DEAD;
		P_SetPsprite (self->player, ps_weapon,
			self->player->psprites[ps_weapon].state +
			(self->FindState("FireHandsLower") - self->FindState("FireHands")));
	}
}
Okay, so yes, A_CrispyPlayer does set the player state to "dead" (the PST_DEAD line).

The interesting thing is after that. There's a horrible hack. It adds up the state numbers of the current weapon sprite and the FireHandsLower state, and substract from that the state number of the FireHands state. So, be sure to declare the states in the same sequence as they are in StrifePlayer: FireHands then FireHandsLower, and as many states for either.

Code: Select all

DEFINE_ACTION_FUNCTION(AActor, A_ItBurnsItBurns)
{
	S_Sound (self, CHAN_VOICE, "human/imonfire", 1, ATTN_NORM);

	if (self->player != NULL && self->player->mo == self)
	{
		P_SetPsprite (self->player, ps_weapon, self->FindState("FireHands"));
		P_SetPsprite (self->player, ps_flash, NULL);
		self->player->ReadyWeapon = NULL;
		self->player->PendingWeapon = WP_NOCHANGE;
		self->player->playerstate = PST_LIVE;
		self->player->extralight = 3;
	}
}
Seems pretty straightforward. Little hack as it sets the player to be still alive. Then it hijacks the Psprite weapon "channel" to display the fire hands, while nullifying your weapon so you can't attack, and preventing you from changing to another weapon. Also makes you all shiny (extralight = 3).

Code: Select all

DEFINE_ACTION_FUNCTION(AActor, A_HandLower)
{
	if (self->player != NULL)
	{
		pspdef_t *psp = &self->player->psprites[ps_weapon];
		psp->sy += FRACUNIT*9;
		if (psp->sy > WEAPONBOTTOM*2)
		{
			P_SetPsprite (self->player, ps_weapon, NULL);
		}
		if (self->player->extralight > 0) self->player->extralight--;
	}
}
Rather simple as well: it lowers the vertical offset of the weapon Psprite (remember that 0 is at the top, so increasing the offset means going further downward, so a high value means a low offset), and if the Psprite offset becomes so low that the weapon can't be seen anymore, then just remove that sprite altogether. Also, makes the player less shiny by decreasing extralight.
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: StrifePlayer additional states?

Post by Ceeb »

So the Strife burning hands are the most hacktacular thing ever made. :P
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: StrifePlayer additional states?

Post by NeuralStunner »

Gez wrote:The interesting thing is after that. There's a horrible hack. It adds up the state numbers of the current weapon sprite and the FireHandsLower state, and substract from that the state number of the FireHands state. So, be sure to declare the states in the same sequence as they are in StrifePlayer: FireHands then FireHandsLower, and as many states for either.
Aha! So, cutting the AltSkin* states and stuff, adding the Disintegrate state, and removing the state jump from Death makes it work. Thanks Gez!

So, this works as it should:
Spoiler:
In the future though, I'd hope a much less hacky method could be adopted...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: StrifePlayer additional states?

Post by Graf Zahl »

Ceeb wrote:So the Strife burning hands are the most hacktacular thing ever made. :P

Not the most but this a pretty dirty effect. So dirty in fact that ZDoom had to add some new code pointers to do them. Strife originally did some of this effect in an even more hackish way. What ZDoom does is rather tame by comparison.
User avatar
InsaneFury
Posts: 105
Joined: Mon Nov 23, 2009 6:51 am

Re: StrifePlayer additional states?

Post by InsaneFury »

Ok, so in order for people to (ab)use these functions, they'll have to steer clear of any new player states (like freeze-/fire death, per-damagetype pain-/deathstates?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: StrifePlayer additional states?

Post by Graf Zahl »

No. If you inherit from the Strife player all you need to do is call these functions in the proper places. They don't depend on anything external.
Locked

Return to “Editing (Archive)”