[DECORATE] Custom Player Death causes crashout

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
HellBlade64
Forum Regular
Posts: 100
Joined: Mon Aug 13, 2012 9:03 pm
Contact:

[DECORATE] Custom Player Death causes crashout

#1

Post by HellBlade64 » Thu Jun 04, 2020 7:22 pm

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
You do not have the required permissions to view the files attached to this post.

User avatar
Fused
Contributor
Posts: 658
Joined: Sat Nov 09, 2013 9:47 am
Location: Netherlands
Contact:

[DECORATE] Re: Custom Player Death causes crashout

#2

Post by Fused » Thu Jun 04, 2020 7:28 pm

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.
My mods
Image Image

My socials
Image Image

User avatar
HellBlade64
Forum Regular
Posts: 100
Joined: Mon Aug 13, 2012 9:03 pm
Contact:

[DECORATE] Re: Custom Player Death causes crashout

#3

Post by HellBlade64 » Thu Jun 04, 2020 7:58 pm

So is there another way I could implement those custom death animations?

User avatar
Fused
Contributor
Posts: 658
Joined: Sat Nov 09, 2013 9:47 am
Location: Netherlands
Contact:

[DECORATE] Re: Custom Player Death causes crashout

#4

Post by Fused » Fri Jun 05, 2020 7:35 am

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().
My mods
Image Image

My socials
Image Image

User avatar
Ænima
Addicted to Zandronum
Posts: 3523
Joined: Tue Jun 05, 2012 6:12 pm

[DECORATE] Re: Custom Player Death causes crashout

#5

Post by Ænima » Thu Jul 02, 2020 11:15 am

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.
­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !


ZandroSkins
: a pack made by our community

User avatar
penguin
 
Posts: 82
Joined: Tue Aug 28, 2018 5:05 am
Location: Japan
Contact:

[DECORATE] Re: Custom Player Death causes crashout

#6

Post by penguin » Thu Jul 02, 2020 1:44 pm

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.

User avatar
HellBlade64
Forum Regular
Posts: 100
Joined: Mon Aug 13, 2012 9:03 pm
Contact:

[DECORATE] Re: Custom Player Death causes crashout

#7

Post by HellBlade64 » Mon Jul 20, 2020 8:14 pm

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

User avatar
penguin
 
Posts: 82
Joined: Tue Aug 28, 2018 5:05 am
Location: Japan
Contact:

[DECORATE] Re: Custom Player Death causes crashout

#8

Post by penguin » Tue Jul 21, 2020 2:11 am

Please post a code that includes the bleeding code as it isn't included in the first post.

User avatar
HellBlade64
Forum Regular
Posts: 100
Joined: Mon Aug 13, 2012 9:03 pm
Contact:

[DECORATE] Re: Custom Player Death causes crashout

#9

Post by HellBlade64 » Tue Jul 21, 2020 2:45 am

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
}
}

User avatar
penguin
 
Posts: 82
Joined: Tue Aug 28, 2018 5:05 am
Location: Japan
Contact:

[DECORATE] Re: Custom Player Death causes crashout

#10

Post by penguin » Tue Jul 21, 2020 4:12 am

Blood2 needs to spawn on the client side only.
It is recommended that effect actors, not just Blood2, spawn on the client side only.

User avatar
penguin
 
Posts: 82
Joined: Tue Aug 28, 2018 5:05 am
Location: Japan
Contact:

[DECORATE] Re: Custom Player Death causes crashout

#11

Post by penguin » Tue Jul 21, 2020 4:30 am

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.

User avatar
Ænima
Addicted to Zandronum
Posts: 3523
Joined: Tue Jun 05, 2012 6:12 pm

[DECORATE] Re: Custom Player Death causes crashout

#12

Post by Ænima » Tue Jul 21, 2020 4:42 pm

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)
­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !


ZandroSkins
: a pack made by our community

User avatar
HellBlade64
Forum Regular
Posts: 100
Joined: Mon Aug 13, 2012 9:03 pm
Contact:

[DECORATE] Re: Custom Player Death causes crashout

#13

Post by HellBlade64 » Sat Jul 25, 2020 3:52 am

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.

User avatar
HellBlade64
Forum Regular
Posts: 100
Joined: Mon Aug 13, 2012 9:03 pm
Contact:

[DECORATE] Re: Custom Player Death causes crashout

#14

Post by HellBlade64 » Sat Jul 25, 2020 4:01 am

Like; the Cell ammo type isn't being completely replaced for some reason.

User avatar
penguin
 
Posts: 82
Joined: Tue Aug 28, 2018 5:05 am
Location: Japan
Contact:

[DECORATE] Re: Custom Player Death causes crashout

#15

Post by penguin » Sat Jul 25, 2020 9:16 am

Weapon.AmmoType "Cell2" instead of Weapon.AmmoType "Cell".
Last edited by penguin on Sun Jul 26, 2020 5:38 am, edited 1 time in total.

User avatar
penguin
 
Posts: 82
Joined: Tue Aug 28, 2018 5:05 am
Location: Japan
Contact:

[DECORATE] Re: Custom Player Death causes crashout

#16

Post by penguin » Sat Jul 25, 2020 9:19 am

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

Post Reply