Page 1 of 1

[DECORATE] Custom Player Death causes crashout

Posted: Thu Jun 04, 2020 7:22 pm
by HellBlade64
Not sure how exactly to cover this.
So here we go:

I am trying to add custom death animations to the player character.

In essence I was trying to re-add the unused death animations from the Doom beta and what have you.

They work just fine offline, but when on a sever the client will completely crash and I have no idea why.
So I will post the code and the crash log here.

Here is the code:
Spoiler: (Open)

Code: Select all

  Death:
     TNT1 A 0 A_Jump(255,"RegularDeath","AltDeath")
     Stop
  RegularDeath:
    PLAY H 10
    PLAY I 10 A_PlayerScream
    PLAY J 10 A_NoBlocking
    PLAY KLM 10
    PLAY N -1
    Stop
  AltDeath:
    PARM A 10
    PARM B 10 A_PlayerScream
    PARM C 10 A_NoBlocking
    PARM DEF 10
    PARM G -1
    Stop
  XDeath:
    PLAY O 5
    PLAY P 5 A_XScream
    PLAY Q 5 A_NoBlocking
    PLAY RSTUV 5
    PLAY W -1
    Stop
  XDeath:
	TNT1 A 0 A_Jump(255,"XDeathNormal","SplitInHalf")
	Stop
  XDeathNormal:
    PLAY O 5
    PLAY P 5 A_XScream
    PLAY Q 5 A_NoBlocking
    PLAY RSTUV 5
    PLAY W -1
    Stop
  SplitInHalf:  
	PLEG A 2 A_PlayerScream
    PLEG B 5 A_XScream
    PLEG C 2 A_NoBlocking
	PLEG C 0 A_SkullPop("MarineTorso")
    PLEG DEFG 10 A_NoBlocking
    PLEG H -1 A_NoBlocking
    Stop
This is the main thing I see when it doesn't crash in game:
Spoiler: (Open)

Code: Select all

Actor of type FistStart at (557.085495,4551.584534) left without a state

[DECORATE] Re: Custom Player Death causes crashout

Posted: Thu Jun 04, 2020 7:28 pm
by Fused
My development for Zandronum has stopped long ago, but one thing I believe I vaguely remember is that a_jump used to be a nightmare online. It was often too late with jumping, causing lines after to trigger before it would jump. The only thing noticeable from your code would be that.

[DECORATE] Re: Custom Player Death causes crashout

Posted: Thu Jun 04, 2020 7:58 pm
by HellBlade64
So is there another way I could implement those custom death animations?

[DECORATE] Re: Custom Player Death causes crashout

Posted: Fri Jun 05, 2020 7:35 am
by Fused
HellBlade64 wrote:
Thu Jun 04, 2020 7:58 pm
So is there another way I could implement those custom death animations?
One think I did was A_(Named)ExecuteAlways().
A script seems to execute immediatley, and you can apply randomization in there as an alternative (think about giving a random amount of a dummy item).
You can check for this dummy item using A_JumpIfInventory().

[DECORATE] Re: Custom Player Death causes crashout

Posted: Thu Jul 02, 2020 11:15 am
by Ænima
Here’s the problem.

Code: Select all

  Death:
     TNT1 A 0 A_Jump(255,"RegularDeath","AltDeath")
     Stop
Try this instead:

Code: Select all


  Death:
     TNT1 A 0 A_Jump(255,"RegularDeath","AltDeath")
  RegularDeath:
     ... etc etc
And the same for your XDeath A_Jump frame. Remove the “Stop” after that jump call and let it just “fall through” to the next state.


Try it and let me know if it works.



EDIT:
Fused wrote:
Thu Jun 04, 2020 7:28 pm
It was often too late with jumping, causing lines after to trigger before it would jump. The only thing noticeable from your code would be that.
Yes, this is what is happening. Even though you listed 255 as the jump chance (basically “always”), the server may be saving that jump synchronization math “for later” and instead look to the very next frame, which is a “Stop” in your case. And for player bodies, that’s bad. If you remove the body of a player who hasn’t respawned yet (that is, their camera view is still the player actor), you will crash the client for that player or possibly all of them.

[DECORATE] Re: Custom Player Death causes crashout

Posted: Thu Jul 02, 2020 1:44 pm
by penguin
Use 256 instead of 255 if you always want to jump. 255 may very rarely not perform a jump.
Don't place a "Stop" on the next frame of "A_Jump" anyway.

[DECORATE] Re: Custom Player Death causes crashout

Posted: Mon Jul 20, 2020 8:14 pm
by HellBlade64
So the main issue is fixed, thank you Penguin.
The gibbing works online as intended.

Now I need help with another issue.
The spewing effect doesn't run right online for some reason.
Below is a video demonstration:

phpBB [video]
The [youtube] tag is deprecated, please use the [media] tag

[DECORATE] Re: Custom Player Death causes crashout

Posted: Tue Jul 21, 2020 2:11 am
by penguin
Please post a code that includes the bleeding code as it isn't included in the first post.

[DECORATE] Re: Custom Player Death causes crashout

Posted: Tue Jul 21, 2020 2:45 am
by HellBlade64
Here is the code for the Marine Torso.
Spoiler: (Open)

Code: Select all

Actor MarineTorso : PlayerChunk
{
Mass 100
Radius 8
Height 8
Gravity 0.2
Speed 15
BounceCount 2
+Missile
+DoomBounce
+DropOff
+NOBLOCKMAP
-LOWGRAVITY
+CANNOTPUSH
+SKYEXPLODE
+NOBLOCKMONST
+NOSKIN
States
{
Spawn:
TNT1 A 0 NoDelay A_ChangeVelocity(velx*4,vely*4,velz*4,CVF_REPLACE) //Doubles current velocity
SpawnLoop:
PTOR A 1
PTOR AAAAAAAA 0 A_SpawnItemEx("Blood2",random(-5,5),random(-5,5),0,random(-5,5),random(-5,5))
Loop
Death:
PTOR BCD 4
PTOR E -1 A_NoBlocking
Stop
}
}

[DECORATE] Re: Custom Player Death causes crashout

Posted: Tue Jul 21, 2020 4:12 am
by penguin
Blood2 needs to spawn on the client side only.
It is recommended that effect actors, not just Blood2, spawn on the client side only.

[DECORATE] Re: Custom Player Death causes crashout

Posted: Tue Jul 21, 2020 4:30 am
by penguin
To be precise, Blood has collision. So it just looks like it hits Marine Torso and doesn't spawn.
Give THRUACTORS to Blood2 and have it spawn clientside.

[DECORATE] Re: Custom Player Death causes crashout

Posted: Tue Jul 21, 2020 4:42 pm
by Ænima
Replace this line

Code: Select all

 PTOR AAAAAAAA 0 A_SpawnItemEx("Blood2",random(-5,5),random(-5,5),0,random(-5,5),random(-5,5))

with this:

Code: Select all

 PTOR AAAAAAAA 0 A_SpawnItemEx("Blood2",random(-5,5),random(-5,5),0,random(-5,5),random(-5,5),0,0,160)

[DECORATE] Re: Custom Player Death causes crashout

Posted: Sat Jul 25, 2020 3:52 am
by HellBlade64
Not sure what the extra numbers on the end change, but thank you all nonetheless.
It works a charm now!

New issue:
So uh, I have a ammo that replaces Cell.
Cell2, but for some reason the ammo pools are still divided.

Like, on the oldschool HUD the right hand side total ammo count shows I have maybe 200 cells but when I switch to my BFG I only have like 26.
I dun-gettit.

[DECORATE] Re: Custom Player Death causes crashout

Posted: Sat Jul 25, 2020 4:01 am
by HellBlade64
Like; the Cell ammo type isn't being completely replaced for some reason.

[DECORATE] Re: Custom Player Death causes crashout

Posted: Sat Jul 25, 2020 9:16 am
by penguin
Weapon.AmmoType "Cell2" instead of Weapon.AmmoType "Cell".

[DECORATE] Re: Custom Player Death causes crashout

Posted: Sat Jul 25, 2020 9:19 am
by penguin
The number 160 at the end of A_SpawnItemEx is a combination of a flag to spawn only on the client side and a flag to ignore the position check on spawn.
You can use a constant names instead.

Code: Select all

SXF_NOCHECKPOSITION | SXF_CLIENTSIDE
For more information, please click here.
https://zdoom.org/wiki/A_SpawnItemEx