Broken Pencil Posted February 3, 2015 I Need major help with scripting a weapon in Decorate. I'm having major problems with parsing errors and classes to inherent from. Here's the code for the weapons: actor Rifle : Weapons 96439 { //$Category Weapons Weapon.SelectionOrder Weapon.AmmoUse 1 Weapon.AmmoGive 20 Weapon.AmmoType "Clip" Inventory.PickupMessage "You got the rifle!" Obituary "%k riddled %o with bullets." attacksound "dspistol" Decal "BulletChip" Weapon.SlotNumber 4 States { Ready: RIF4 A 1 A_WeaponReady Loop Deselect: RIF4 A 1 A_Lower Loop Select: RIF4 A 1 A_Raise Loop Fire: RIF2 B 1 bright A_FireBullets (3, 2, 1, 7) RIF3 B 0 bright A_GunFlash RIF2 B 0 bright A_Quake (1, 2, 0, 1) RIF3 B 0 bright A_SetPitch (pitch-0.1) RIF2 CD 1 A_SetPitch (pitch-0.075) RIF3 C 1 RIF2 A 1 A_Refire goto Ready Flash: TNT1 A 3 Bright A_Light1 Goto LightDone Spawn: RIF1 A -1 Stop } }I based the code off of another gun I got from Realm 667: http://realm667.com/index.php/en/component/docman/?task=doc_download&gid=432 Here's what happens when I go into Doom builder: The weapon I'm inheriting from is supposed to be weapon, but I slightly messed up. Either way, it never works. Not even if I inherit from a Doom weapon (Chaingun). 0 Share this post Link to post
scifista42 Posted February 3, 2015 actor Rifle : Weapons 96439Weapon, not Weapons. Update the code, save the wad and tell us what new error message do you get.Weapon.SelectionOrder There should be a number after Weapon.SelectionOrder, for example: Weapon.SelectionOrder 987 0 Share this post Link to post
Broken Pencil Posted February 4, 2015 Unable to find the DECORATE class 'Weapon' to inherit from, while parsing 'Rifle:96439' Oh, and I'm using Gzdoom builder by the way. EDIT: Also got this as well when testing the map with gzdoom: Script error, "Doom - The Viruswad (2).wad:DECORATE" line 7: SC_GetNumber: Bad numeric constant "Weapon". If you want to check the wad for anything, here's the link (Requires Gzdoom!) http://liambrocklehurst.com/uploader/files/275/Doom%20-%20The%20Viruswad%20%282%29.wad 0 Share this post Link to post
scifista42 Posted February 4, 2015 Maximum allowed editor number is 32767, you can't use 96439. http://zdoom.org/wiki/Magic_numbers And fix the Weapon.SelectionOrder as I've told you. There should be a number there. 0 Share this post Link to post
Broken Pencil Posted February 4, 2015 Oops. Heheh, I uploaded that before I read the "Number can't be below 96439" part. But yeah, I already followed those steps (it seems that it STILL doesn't work). 0 Share this post Link to post
scifista42 Posted February 4, 2015 Broken Pencil said:I already followed those steps (it seems that it STILL doesn't work). I did the same changes myself in the wad you've posted, and I've been able to run it in ZDoom without any errors or warnings. EDIT: GZDoom worked too. I've also opened the wad's MAP01 in GZDoomBuilder and launched it from there, no problems. 0 Share this post Link to post
Broken Pencil Posted February 4, 2015 Does the weapon named "Rifle" work by any chance? Because that's what I'm trying to get to work. :) 0 Share this post Link to post
scifista42 Posted February 4, 2015 I've found the problem. The wad lacks the rifle sprites. First, they should be placed between SS_START and SS_END markers inside the wad. Second, they must be named RIF1A0 etc., the A0 (B0, C0...) suffix is critical. That's why ZDoom refuses to load the weapon. 0 Share this post Link to post