Page 1 of 1

Problems w/ a decorate weapon

Posted: Thu Nov 24, 2005 2:26
by MaxPower8905
I've been working on a decorate weapons mod, and my latest weapon is giving me some problems. Here's the code for the weapon:

Code: Select all

ACTOR Spaz12 : Weapon
{
 Weapon.SelectionOrder 510
 Weapon.KickBack 300
 Inventory.PickupSound "misc/w_pkup"
 Inventory.PickupMessage "Picked up a Spaz 12 Combat Shotgun."
 Weapon.AmmoType1 "ShellIn"
 Weapon.AmmoGive1 0
 Weapon.AmmoUse1 1
 Weapon.AmmoType2 "Shell"
 Weapon.AmmoGive2 8
 Weapon.AmmoUse2 0
 AttackSound "weapons/spaz12"
 +AMMO_OPTIONAL
 States
 {
  Spawn:
   SPZP A -1
   Stop
  Ready:
   SPAZ A 1 A_WeaponReady
   Loop
  Deselect:
   SPAZ A 1 A_Lower
   Loop
  Select:
   SPAZ A 1 A_Raise
   Loop
  Fire:
   SPAZ A 0 A_JumpIfNoAmmo(13)
   SPAZ A 4
   SPZF A 3 A_FireBullets(8, 8, 10, 7, 0, 1)
   SPZF B 3 A_Recoil(2)
   SPAZ AB 5
   SPAZ CD 5
   SPAZ A 0 A_FireCustomMissile("ShellCase", 270, 0, 5, 0)
   SPAZ C 5
   SPAZ B 5
   SPAZ A 4 A_ReFire
   Goto Ready
  Altfire:
   SPAZ A 0 A_JumpIfInventory("ShellIn",8,2)
   SPAZ A 0 A_JumpIfInventory("Shell",1,2)
   SPAZ A 0
   Goto Ready
   SPAZ AF 4
   SPAZ E 10
   SPAZ HG 5
   SPAZ H 5 A_PlaySound("weapons/shellin")
   SPAZ A 0 A_TakeInventory("Shell", 1)
   SPAZ A 0 A_GiveInventory("ShellIn", 1)
   SPAZ A 0 A_JumpIfInventory("ShellIn",8,2)
   SPAZ A 0 A_JumpIfInventory("Shell",1,2)
   SPAZ A 0
   Goto Altfire+18
   SPAZ A 0
   Goto Altfire+6
   SPAZ E 6
   SPAZ FA 4
   Goto Ready
 }
}
Now here's the problem. AltFire is supposed to reload the gun, and it works fine until it's loading in the last shell. At this point GZDoom just crashes and asks me if I want to send an error report. I can't find any errors with the code and I've used the same reloading method for another weapon and it works perfectly fine. So can anyone see the problem?

Posted: Mon Nov 28, 2005 14:00
by Cutmanmike
Try posting in the Zdoom forums, they're decorate freaks there so i'm sure they'll fix you up

Posted: Mon Nov 28, 2005 17:29
by TheDarkArchon
AltFire+18 is outside the weapon. +15 is the offset you want.