Morphing crashes my game

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.
Locked
User avatar
Electronic Samurai
Posts: 177
Joined: Mon Mar 27, 2006 1:54 am
Location: Wandering the open plains

Morphing crashes my game

Post by Electronic Samurai »

Hey all, I've run into a serious issue with the Morph powerup in GZDoom. Every time I use it, it crashes the game to the desktop. This has only started happening with the most recent updates; I'm not sure what's wrong.

This is a replacement for the Berserk Pack. When used, it morphs the player into a Berserk Marine class, that only has access to the Berserk Fist weapon, which has an alternate attack that lunges forward through the air. Every sector is tinted red, and the Berserk Marine screams constantly until the powerup wears off (using the player's ActiveSound, and A_LoopActiveSound in the See state).

The Berserk Pickup:

Code: Select all

ACTOR Berserk_ : CustomInventory replaces Berserk
{
  Inventory.Pickupmessage "Berserk!"
  Inventory.Pickupsound "pickup/berserk"
  +COUNTITEM
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  States
  {
  Spawn:
	PSTR A -1
    loop
  Pickup:
    TNT1 A 0 A_SetBlend("Red",1,50)
	TNT1 A 0 ACS_Execute(800,0) //Script 800, changes fog, waits, changes fog back
	TNT1 A 0 A_SelectWeapon("Fists")
	TNT1 A 0 A_GiveInventory("BerserkHealth",1)
	TNT1 A 0 A_GiveInventory("BerserkMorph",1)
  }
}

ACTOR BerserkHealth : Health
{
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  Inventory.Amount 100
  inventory.pickupmessage ""
  inventory.usesound ""
}

ACTOR BerserkMorph : PowerMorph
{
  PowerMorph.PlayerClass "BerserkMarine"
  PowerMorph.MorphStyle (MRF_FULLHEALTH|MRF_FAILNOTELEFRAG|MRF_FAILNOLAUGH|MRF_WHENINVULNERABLE|MRF_LOSEACTUALWEAPON|MRF_UNDOBYDEATH)
  PowerMorph.MorphFlash "DummyActor"
  PowerMorph.UnMorphFlash "DummyActor"
  Powerup.Color "Red", 0.25
  Inventory.InterHubAmount 0
  inventory.pickupmessage ""
  inventory.usesound ""
  Powerup.Duration 3000
}
The Berserk Fists:

Code: Select all

ACTOR FistBerserk : Fists
{
	Weapon.Kickback 500
    obituary "%k tore %o to shreds."
	weapon.slotnumber 1
    +EXTREMEDEATH
	+FORCEPAIN
	+WEAPON.MELEEWEAPON
	+WEAPON.CHEATNOTWEAPON
    AttackSound "fistberserk/hit"
	States
	{
    Ready:
      FIST A 1 A_WeaponReady
      loop
	Deselect:
	  FIST A 0
	  FIST A 1 A_Lower
      loop
	Fire:
	  TNT1 A 0 A_Jump(128,"FireLeft")
      FIST A 0 A_PlayWeaponSound("fistberserk/ready")
      FIST BC 1
	  FIST D 0 A_Quake(3,8,0,32)
	  TNT1 A 0 A_SetBlend("Red",0.30,15)
      FIST D 6 A_CustomPunch(((random(2,20))*10),1,0,"BerserkPuff")
      FIST CB 1
      TNT1 A 2
      Goto Ready
	FireLeft:
      FIST A 0 A_PlayWeaponSound("fistberserk/ready")
      FIST FG 1
	  FIST H 0 A_Quake(3,8,0,32)
	  TNT1 A 0 A_SetBlend("Red",0.30,15)
      FIST H 6 A_CustomPunch(((random(2,20))*10),1,0,"BerserkPuff")
      FIST GF 1
      TNT1 A 2
      Goto Ready
	AltFire:
	  FIST A 1 A_CheckFloor ("AltFireReady")
	  FIST A 1
	  Goto Ready
	AltFireReady:
	  FIST A 1 ThrustThingZ (0, 41, 0, 0)
      FIST A 5 A_Recoil(-30)
	  Goto Ready
   }
}
The Berserk Marine:

Code: Select all

ACTOR BerserkMarine : PlayerPawn
{
   Game Doom 
   Speed 1.5
   Health 300
   Radius 16
   Height 56
   Mass 100
   PainChance 0
   Player.JumpZ 12
   DamageFactor 0.2
   Player.MugShotMaxHealth 100
   player.startitem FistBerserk
   player.morphweapon FistBerserk
   obituary "%o tore %k to shreds."
   hitobituary "%o tore %k to shreds."
   ActiveSound "Berserk"
   Player.ColorRange 112, 127
   Player.DisplayName "Marine"
   Player.CrouchSprite "PLYC"
   Player.RunHealth 20
   -PICKUP
   States
   {
   Spawn:
      PLAY A 1
	  PLAY A 1 A_SetBlend("Red",0.30,15)
	  PLAY A 0 A_Recoil(-3)
      PLAY A 15 A_Quake(2,16,0,32,"world/thunder")
      Loop
   See:
      PLAY A 0
      PLAY A 0 A_AlertMonsters
      PLAY A 0 A_Quake(1,16,0,32,"world/thunder")
	  PLAY A 0 A_LoopActiveSound
      PLAY ABCD 4
      goto spawn
   Missile:
      PLAY E 6
      Goto Spawn
   Melee:
      PLAY F 6 BRIGHT
      Goto Missile
   Pain:
      PLAY G 1
      Goto Spawn
   Death:
      PLAY H 10 //A_PlayerSkinCheck(AltSkinDeath)
      PLAY I 10 A_PlayerScream
      PLAY J 10 A_NoBlocking
      PLAY KLM 10
      PLAY N -1
      Stop
   XDeath:
      PLAY O 5 //A_PlayerSkinCheck(AltSkinXDeath)
      PLAY P 5 A_XScream
      PLAY Q 5 A_NoBlocking
      PLAY RSTUV 5
      PLAY W -1
      Stop
   //AltSkinDeath:
      PLAY H 6
      PLAY I 6 A_PlayerScream
      PLAY JK 6
      PLAY L 6 A_NoBlocking
      PLAY MNO 6
      PLAY P -1
      Stop
   //AltSkinXDeath:
      PLAY Q 5 A_PlayerScream
      PLAY R 0 A_NoBlocking
      PLAY R 5 A_SkullPop
      PLAY STUVWX 5
      PLAY Y -1
      Stop
   }
}
Anyone know why this is crashing? It's only started happening really recently, and I haven't made any major changes to this code for a while. Alternatively, is there a better, or cleaner way to do this?
Last edited by Electronic Samurai on Fri Jun 18, 2010 4:37 pm, edited 1 time in total.
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: Morphing crashes my game

Post by NeuralStunner »

Code: Select all

Player.DisplayName "Marine"
This may be a problem.
User avatar
Electronic Samurai
Posts: 177
Joined: Mon Mar 27, 2006 1:54 am
Location: Wandering the open plains

Re: Morphing crashes my game

Post by Electronic Samurai »

Hrm. It seems to still crash when that line is removed. It even crashes when I replace BerserkMarine with just the following:

Code: Select all

ACTOR BerserkMarine : PlayerPawn
{}
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Re: Morphing crashes my game

Post by Jimmy »

Try adding a Stop to the end of the Berserk_ powerup's pickup state.
User avatar
Electronic Samurai
Posts: 177
Joined: Mon Mar 27, 2006 1:54 am
Location: Wandering the open plains

Re: Morphing crashes my game

Post by Electronic Samurai »

Hmm, nope, still the same result - crashes to the desktop, and I get GZDoom's crash dialogue box.
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: Morphing crashes my game

Post by NeuralStunner »

Does the "Fists" actor actually exist, or did you mean [wiki=Classes:Fist]Fist[/wiki]? If the latter, no wonder it's crashing: No Select state is defined.

Code: Select all

player.startitem FistBerserk
Player.MorphWeapon will take care of giving the initial weapon, you don't need this line either.
User avatar
Electronic Samurai
Posts: 177
Joined: Mon Mar 27, 2006 1:54 am
Location: Wandering the open plains

Re: Morphing crashes my game

Post by Electronic Samurai »

Still no luck; I took that line out, but there's no change. I had put that line in so the player would have the regular fists selected when the effect of the Berserk Pack ran out, but if there's the possibility it could cause problems, I'll leave it be.
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: Morphing crashes my game

Post by NeuralStunner »

Electronic Samurai wrote:I had put that line in so the player would have the regular fists selected when the effect of the Berserk Pack ran out, but if there's the possibility it could cause problems, I'll leave it be.
I think the best it'll do is nothing. :P

Did you see my first question?
User avatar
Electronic Samurai
Posts: 177
Joined: Mon Mar 27, 2006 1:54 am
Location: Wandering the open plains

Re: Morphing crashes my game

Post by Electronic Samurai »

Yes, I removed the line "TNT1 A 0 A_SelectWeapon("Fists")", as well, but no dice.

I've made a discovery that's probably relevant - a bot can pick up the Berserk Pack, and it functions as expected. This implies to me that the game is failing to render something for the player, rather than it being a general game crash.
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: Morphing crashes my game

Post by NeuralStunner »

This is actually what I was referring to:

Code: Select all

ACTOR FistBerserk : Fists
Did you actually define a new actor called "Fists"? Note there is no S on DooM's Fist.

A much better way to achieve this overall goal, I think, would be to look into [wiki=Classes:PowerWeaponLevel2]PowerWeaponLevel2[/wiki].
User avatar
Electronic Samurai
Posts: 177
Joined: Mon Mar 27, 2006 1:54 am
Location: Wandering the open plains

Re: Morphing crashes my game

Post by Electronic Samurai »

Ah, yes, I have an actor named Fists that replaces Doom's Fist actor. Here's the code for it:

Code: Select all

ACTOR Fists : Fist replaces Fist
{
  obituary "%o chewed on %k's fist."
  weapon.selectionorder 3700
  weapon.slotnumber 1
//weapon.sisterweapon "FistBerserk"
  weapon.kickback 200
  +WEAPON.WIMPY_WEAPON
  +WEAPON.MELEEWEAPON
  +WEAPON.NOALERT
  AttackSound "fist/hit"
  states
  {
  Ready:
    FIST A 1 A_WeaponReady
    loop
  Deselect:
    FIST A 1 A_Lower
    loop
  Select: 
    FIST A 1 A_Raise
    loop
  Fire:
    FIST A 0 A_PlayWeaponSound("fist/ready")
    FIST BC 1
    FIST D 8 A_CustomPunch((random(2,20)),1,0,"FistPuff")
    FIST CB 2
    TNT1 A 4
    Goto Ready
  AltFire:
    FIST A 0 A_PlayWeaponSound("fist/ready")
    FIST FG 1
    FIST H 8 A_CustomPunch((random(2,20)),1,0,"FistPuff")
    FIST GF 2
    TNT1 A 4
    Goto Ready
  }
}
Additionally, I'm trying PowerWeaponLevel2 with my weapons, but adding Weapon.Sisterweapon "FistsBerserk" to the Fists makes it so that I can't select them at all.
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: Morphing crashes my game

Post by NeuralStunner »

Make sure to add +WEAPON.POWERED_UP to FistsBerserk, and make Fists its SisterWeapon.
Locked

Return to “Editing (Archive)”