Problems w/ a decorate weapon

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

Locked
User avatar
MaxPower8905
Posts: 39
Joined: Sat Nov 19, 2005 15:03

Problems w/ a decorate weapon

Post 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?
User avatar
Cutmanmike
Posts: 482
Joined: Sat Sep 03, 2005 23:34

Post by Cutmanmike »

Try posting in the Zdoom forums, they're decorate freaks there so i'm sure they'll fix you up
User avatar
TheDarkArchon
Posts: 1000
Joined: Wed Jul 06, 2005 11:58
Location: What's that fucking smell
Contact:

Post by TheDarkArchon »

AltFire+18 is outside the weapon. +15 is the offset you want.
Locked

Return to “GZDoom”