Page 1 of 1

[closed] Mysterious Crashing

Posted: Mon Feb 13, 2006 23:31
by Deathsong12
Gr! GZDoom crashes with my upgradeable weapons!

[spoiler]

Code: Select all

ACTOR DSPunchDagger : PunchDagger -1
{
    Inventory.Icon "KNFEA3A7"
    Weapon.SelectionOrder 3900
    Weapon.AmmoType2 "DSKnives"
    Weapon.AmmoGive2 3
    Weapon.AmmoUse2 1
    Weapon.UpSound "Knife/Up"
    +MELEEWEAPON
    +NOALERT
    +ALT_AMMO_OPTIONAL
    States
    {
    Select:
      PNCH A 1 A_Raise
      Loop
    Deselect:
      PNCH A 1 A_Lower
      Loop
    Ready:
      PNCH A 0 A_JumpIfInventory ("KnifeXP",10,2)
      PNCH A 1 A_WeaponReady
      Loop
      PNCH A 0
      PNCH A 1 A_Print ("You've upgraded your Throwing Knives")
      PNCH A 1 A_GiveInventory ("DSPunchDaggerA")
      PNCH A 2 A_SelectWeapon ("DSPunchDaggerA")
      Goto Deselect
    AltFire:
      KNIF A 0 A_JumpIfNoAmmo (23)
      KNIF ABCDEF 1
      TNT1 A 2
      KNIF GHI 1
      KNIF J 1 A_PlayWeaponSound ("Knife/Throw")
      KNIF KMP 1
      KNIF R 1 A_FireCustomMissile ("Knife_Throw",0+random(-10,10),1)
      KNIF TVX 1
      KNIF DCB 1
      KNIF A 1 A_GiveInventory ("KnifeXP",1)
      Goto Ready
      KNIF A 0
      Goto Fire
    }
}

ACTOR DSPunchDaggerA : DSPunchDagger
{
    Spawn 0
    Inventory.Icon "LVLKA0"
    States
    {
    Select:
      PNCH A 0 A_TakeInventory ("DSPunchDagger")
      PNCH A 1 A_Raise
      Loop
    Deselect:
      PNCH A 1 A_Lower
      Loop
    Ready:
      PNCH A 0 A_JumpIfInventory ("KnifeXP",25,2)
      PNCH A 1 A_WeaponReady
      Loop
      PNCH A 0
      PNCH A 0 A_Print ("You've upgraded your Throwing Knives")
      PNCH A 0 A_GiveInventory ("DSPunchDaggerB")
      PNCH A 4 A_SelectWeapon ("DSPunchDaggerB")
      Goto Deselect
    AltFire:
      KNIF A 0 A_JumpIfNoAmmo (23)
      KNIF ABCDEF 1
      TNT1 A 2
      KNIF GHI 1
      KNIF J 1 A_PlayWeaponSound ("Knife/Throw")
      KNIF KMP 1
      KNIF R 1 A_FireCustomMissile ("Knife_Throw",0+random(-5,5),1)
      KNIF TVX 1
      KNIF DCB 1
      KNIF A 1 A_GiveInventory ("KnifeXP",1)
      Goto Ready
      KNIF A 0
      Goto Fire
    }
}
[/spoiler]

It gets as far as the A_Print Codepointer and then crashes me. An older version of this code worked just fine. The only difference was that code played a sound and required more XP.

Posted: Mon Feb 13, 2006 23:55
by Graf Zahl
It crashes in

A_GiveInventory ("DSPunchDaggerB")

But I can't see why. Is there any chance you could send me the WAD?

Posted: Tue Feb 14, 2006 0:06
by Deathsong12
Sure. Rapidshare link headed your way.

Posted: Tue Feb 14, 2006 1:14
by Graf Zahl
I'm sorry to say that with the debugger this WAD is causing even more problems due to heap corruption. These can easily be the cause for your crashes but finding them won't be easy. Try do remove some of the DECORATEs inside to see wheher it makes a difference. My guess is that it's some minor hard to find issue but if it can get narrowed down to a specific actor I might get lucky.

Posted: Tue Feb 14, 2006 1:25
by Deathsong12
Okay. Thanks for your help. Perhaps if I moved everything to a new WAD?

Posted: Thu Feb 16, 2006 6:16
by Deathlike2
You could probably do that.. but he's just suggesting that you probably cut+paste stuff out of the scripts or whatever in an attempt to isolate the problem... so just do what he asks.

Posted: Thu Feb 16, 2006 6:28
by Deathsong12
Already have. These actors seem to crash no matter what I do, forcing me to re-write them.

Posted: Thu Feb 16, 2006 9:52
by Graf Zahl
So can you post a minimal WAD that still crashes?

Posted: Fri May 19, 2006 10:39
by Graf Zahl
I won't bother with this any further. The most recent version doesn't even load this WAD due to DECORATE errors and I have no desire to go through all the definitions.