SteelDrake Posted August 21, 2008 hello, i tried to use Xaser's "COPGun" so i could use the altfire to reload. heres the portion of the DECORATE lump that zdoom crashes on, ACTOR ZenII : Weapon 2005 { +NOALERT +AMMO_OPTIONAL +STRIFEDAMAGE Inventory.PickupSound "weapons/zenreload1" Inventory.PickupMessage "You got the Zen II SMG!" Weapon.AmmoType "Clip" Weapon.AmmoGive 60 Weapon.AmmoUse 1 Weapon.Kickback 20 AttackSound "weapons/zenfire" States { Spawn: ZSMG A -1 Loop Ready: ZENG A 1 A_WeaponReady Loop Deselect: ZENX ABCDEF 1 Loop Select: ZENG A 1 A_Raise Loop Fire: ZENG A 0 A_JumpIfInventory("Zen2InClip", 1, 2) ZENG A 1 Goto Ready ZENG A 0 A_GunFlash ZENG A 0 A_FireCustomMissile("CheapAlert",0,0,0,0) ZENG A 0 A_TakeInventory("Zen2InClip",1) ZENG BC 1 Bright A_FireBullets(2,2,1,10,0,0) ZENG C 1 Bright ZENG A 1 A_ReFire Goto Ready Hold: ZENG A 1 ZENG A 1 A_ReFire Goto Ready AltFire: ZENG A 0 A_JumpIfInventory("Zen2InClip", 30, 2) ZENG A 0 A_JumpIfInventory("Clip", 1, 2) ZENG A 0 Goto Ready ZENG D 1 A_PlaySound("weapons/zenreload2") ZENG E 1 ZENG FG 1 ZENG H 1 ZENG IJKLMNOPQRST 1 ZENG T 0 A_TakeInventory("Clip",15) <--- somewhere between here ZENG T 0 A_GiveInventory("zen2InClip",15) ZENG T 0 A_JumpIfInventory("zen2inclip",30,2) ZENG T 0 A_JumpIfInventory("Clip",1,2) ZENG T 0 <--- and here. Goto AltFire+22 ZENG T 0 Goto AltFire+16 ZENG T 1 A_PlaySound("weapons/zenreload1") ZENG U 1 ZENG V 1 ZENG W 1 ZENG XYZ 1 ZENG "[" 1 ZENG "" 1 ZENG A 1 Goto Ready Flash: MAGG K 1 Bright A_Light2 MAGG K 1 Bright A_Light1 MAGG K 1 Bright A_Light0 Stop } } it crashes when Zen2InClip gets to 30. [out of AlternateWeps3.wad] 0 Share this post Link to post
Kirby Posted August 21, 2008 Two things - 1) Perhaps you could denote WHERE line 30 is in your code or at least post the error message that you got (it would help a LOT) 2) Which version of ZDoom were you running? EDIT - Nevermind, my lack of knowledge has been displaced by superior means :P 0 Share this post Link to post
TheDarkArchon Posted August 21, 2008 change Goto AltFire+22 to AltFire+25. As things stand, you're creating a zero duration infinite loop 0 Share this post Link to post
SteelDrake Posted August 21, 2008 To Kirby: ZDoom 2.2.0 (r748) oh, TheDarkArchon, that fixed the crashing, not the loop. 0 Share this post Link to post
TheDarkArchon Posted August 21, 2008 AltFire+16 changes to AltFire+21. The gives and takes should only be 1 a piece to account for having less than a full clip in reserve 0 Share this post Link to post
SteelDrake Posted August 21, 2008 ok, i think i figured it out. one more thing, how do you replace, say the pistol, in decorate? thanks. 0 Share this post Link to post
TheDarkArchon Posted August 21, 2008 Create a custom player class. Inherit from the Doomguy, have Player.StartItem's for the weapon, magazine ammo and reserve ammo. 0 Share this post Link to post
Graf Zahl Posted August 21, 2008 Better use labels to jump to instead of counting states. It's much less error-prone. 0 Share this post Link to post