Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
KamkrazyIan

*SOLVED* Having Trouble with Custom Weapons

Recommended Posts

Back again but this time with a more advanced issue I'm trying add custom weapons to a wad I'm working on and as far as I can find it works the same way as adding monsters. But when I follow those steps for weapons 2 things happen.

 

1. My DECORATE looks like this

 

actor QuadShotgun : Weapon    //29999
{
//$Category Weapons
//$Title Quad-Shotgun
  Tag "Quad-Shotgun"
  obituary "%o was obliterated by %k's Quad-Shotgun!"
  radius 20
  height 16
  inventory.pickupmessage "You got the Quad-Barrelled shotgun!"
  weapon.selectionorder 1335
  Weapon.SlotNumber 3
  weapon.kickback 350
  Weapon.AmmoType1 "Shell"
  Weapon.AmmoType2 "Shell"
  Weapon.AmmoGive 8
  Weapon.AmmoUse1 1
  Weapon.AmmoUse2 4
  +Weapon.NoAlert
  Decal "BulletChip"
  states
  {
  Ready:
   SHT4 A 1 A_WeaponReady
    loop
  Deselect: 
   SHT4 A 1 A_Lower
   loop
  Select:
    SHT4 A 1 A_Raise
    loop
  Fire:
    SHT4 A 6 A_CheckReload
    TNT1 A 0 A_JumpIfInventory("QuadCheck",4,"Reload")
    TNT1 A 0 A_AlertMonsters
    TNT1 A 0 A_PlaySound("QuadShotgun/SingleFire",Chan_Weapon)
    TNT1 A 0 A_CustomPunch(Random(12,18),0,CPF_NOTURN,"BulletPuff",96) //12-18 x Default Melee Random, without turning to face target.
    TNT1 A 0 Bright A_FireBullets (5.5, 3.2, 6, 7, "Bulletpuff")
    TNT1 A 0 A_GunFlash
    TNT1 A 0 A_GiveInventory("QuadCheck", 1)
    TNT1 A 0 A_GiveInventory("BarrelChange",1)
    SHT4 AB 3 Bright
    SHT4 CB 3 Bright
    SHT4 A 3 A_CheckReload
    TNT1 A 0 A_JumpIfInventory("QuadCheck",4,"Reload")
    SHT4 A 1 A_ReFire
    Goto Ready
    Reload:
    SHT4 ABCDEFGHI 2
    SHT4 J 5 A_PlaySound("QuadShotgun/Open",6)
    SHT4 KL 5
    TNT1 A 0 A_TakeInventory("QuadCheck", 4)//Resets the cap Counter to 0
    TNT1 A 0 A_TakeInventory("BarrelChange",3) //Changes Flash
    TNT1 A 0 A_PlaySound("QuadShotgun/ReloadAll",Chan_Auto)
    SHT4 MNO 5
    SHT4 P 5 A_PlaySound("QuadShotgun/Close",6)
    SHT4 A 5 A_CheckReload
    Goto Ready
  AltFire: //Quad-Shot (Need at least 4 shells & not fired Primary Shot yet)
    SHT4 A 6 A_CheckReload
    TNT1 A 0 A_JumpIfInventory("QuadCheck", 3, "Reload")//Checks Counter Value, reloads if it's 3
    TNT1 A 0 A_JumpIfInventory("QuadCheck", 2, "Reload")//Checks Counter Value, reloads if it's 2
    TNT1 A 0 A_JumpIfInventory("QuadCheck", 1, "Reload")//Checks Counter Value, reloads if it's 1
    TNT1 A 0 Bright A_AlertMonsters
    TNT1 A 0 A_TakeInventory("BarrelChange",3)
      SHT4 A 3 Bright A_PlaySound("QuadShotgun/QuadFire",Chan_Weapon)
    TNT1 A 0 Bright A_GiveInventory("QuadCheck", 4)
    TNT1 A 0 A_CustomPunch(Random(20,32),0,CPF_NOTURN,"BulletPuff",96) //20-32 x Default Melee Random, without turning to face target.
    QSSF B 0 Bright A_FireBullets (11.2, 9.1, 25, 7, "BulletPuff")
    TNT1 A 0 A_GunFlash("AltFlash")
    SHT4 B 6 Bright
    SHT4 A 3 A_CheckReload
    SHT4 A 3 A_JumpIfInventory("QuadCheck", 4, "Reload")
    Goto Ready
  Flash:
    TNT1 A 0 A_JumpIfInventory("BarrelChange",1,"Flash2")
    SH4X A 1 Bright A_Light1
    SH4X E 1 Bright A_Light2
    Goto LightDone
  Flash2:
    TNT1 A 0 A_JumpIfInventory("BarrelChange",2,"Flash3")
    SH4X B 1 Bright A_Light1
    SH4X F 1 Bright A_Light2
    Goto LightDone
  Flash3:
    TNT1 A 0 A_JumpIfInventory("BarrelChange",3,"Flash4")
    SH4X C 1 Bright A_Light1
    SH4X G 1 Bright A_Light2
    Goto LightDone
  Flash4:
    SH4X D 1 Bright A_Light1
    SH4X H 1 Bright A_Light2
    Goto LightDone
    AltFlash:
    SH4X I 4 Bright A_Light1
    SH4X J 3 Bright A_Light2
    TNT1 A 0 A_Light0
    Goto LightDone
  Spawn:
    QSGW A -1
    stop
  }
}
ACTOR BarrelChange : Inventory { Inventory.MaxAmount 3 } //Single-Shot Barrel Flash Alteration
ACTOR QuadCheck : Inventory { Inventory.MaxAmount 4 } //Reload Check

 

and the weapon won't even show up when I open my builder. 

 

or 2: 

 

actor QuadShotgun 29999
{
//$Category Weapons
//$Title Quad-Shotgun
  Tag "Quad-Shotgun"
  obituary "%o was obliterated by %k's Quad-Shotgun!"
  radius 20
  height 16
  inventory.pickupmessage "You got the Quad-Barrelled shotgun!"
  weapon.selectionorder 1335
  Weapon.SlotNumber 3
  weapon.kickback 350
  Weapon.AmmoType1 "Shell"
  Weapon.AmmoType2 "Shell"
  Weapon.AmmoGive 8
  Weapon.AmmoUse1 1
  Weapon.AmmoUse2 4
  +Weapon.NoAlert
  Decal "BulletChip"
  states
  {
  Ready:
   SHT4 A 1 A_WeaponReady
    loop
  Deselect: 
   SHT4 A 1 A_Lower
   loop
  Select:
    SHT4 A 1 A_Raise
    loop
  Fire:
    SHT4 A 6 A_CheckReload
    TNT1 A 0 A_JumpIfInventory("QuadCheck",4,"Reload")
    TNT1 A 0 A_AlertMonsters
    TNT1 A 0 A_PlaySound("QuadShotgun/SingleFire",Chan_Weapon)
    TNT1 A 0 A_CustomPunch(Random(12,18),0,CPF_NOTURN,"BulletPuff",96) //12-18 x Default Melee Random, without turning to face target.
    TNT1 A 0 Bright A_FireBullets (5.5, 3.2, 6, 7, "Bulletpuff")
    TNT1 A 0 A_GunFlash
    TNT1 A 0 A_GiveInventory("QuadCheck", 1)
    TNT1 A 0 A_GiveInventory("BarrelChange",1)
    SHT4 AB 3 Bright
    SHT4 CB 3 Bright
    SHT4 A 3 A_CheckReload
    TNT1 A 0 A_JumpIfInventory("QuadCheck",4,"Reload")
    SHT4 A 1 A_ReFire
    Goto Ready
    Reload:
    SHT4 ABCDEFGHI 2
    SHT4 J 5 A_PlaySound("QuadShotgun/Open",6)
    SHT4 KL 5
    TNT1 A 0 A_TakeInventory("QuadCheck", 4)//Resets the cap Counter to 0
    TNT1 A 0 A_TakeInventory("BarrelChange",3) //Changes Flash
    TNT1 A 0 A_PlaySound("QuadShotgun/ReloadAll",Chan_Auto)
    SHT4 MNO 5
    SHT4 P 5 A_PlaySound("QuadShotgun/Close",6)
    SHT4 A 5 A_CheckReload
    Goto Ready
  AltFire: //Quad-Shot (Need at least 4 shells & not fired Primary Shot yet)
    SHT4 A 6 A_CheckReload
    TNT1 A 0 A_JumpIfInventory("QuadCheck", 3, "Reload")//Checks Counter Value, reloads if it's 3
    TNT1 A 0 A_JumpIfInventory("QuadCheck", 2, "Reload")//Checks Counter Value, reloads if it's 2
    TNT1 A 0 A_JumpIfInventory("QuadCheck", 1, "Reload")//Checks Counter Value, reloads if it's 1
    TNT1 A 0 Bright A_AlertMonsters
    TNT1 A 0 A_TakeInventory("BarrelChange",3)
      SHT4 A 3 Bright A_PlaySound("QuadShotgun/QuadFire",Chan_Weapon)
    TNT1 A 0 Bright A_GiveInventory("QuadCheck", 4)
    TNT1 A 0 A_CustomPunch(Random(20,32),0,CPF_NOTURN,"BulletPuff",96) //20-32 x Default Melee Random, without turning to face target.
    QSSF B 0 Bright A_FireBullets (11.2, 9.1, 25, 7, "BulletPuff")
    TNT1 A 0 A_GunFlash("AltFlash")
    SHT4 B 6 Bright
    SHT4 A 3 A_CheckReload
    SHT4 A 3 A_JumpIfInventory("QuadCheck", 4, "Reload")
    Goto Ready
  Flash:
    TNT1 A 0 A_JumpIfInventory("BarrelChange",1,"Flash2")
    SH4X A 1 Bright A_Light1
    SH4X E 1 Bright A_Light2
    Goto LightDone
  Flash2:
    TNT1 A 0 A_JumpIfInventory("BarrelChange",2,"Flash3")
    SH4X B 1 Bright A_Light1
    SH4X F 1 Bright A_Light2
    Goto LightDone
  Flash3:
    TNT1 A 0 A_JumpIfInventory("BarrelChange",3,"Flash4")
    SH4X C 1 Bright A_Light1
    SH4X G 1 Bright A_Light2
    Goto LightDone
  Flash4:
    SH4X D 1 Bright A_Light1
    SH4X H 1 Bright A_Light2
    Goto LightDone
    AltFlash:
    SH4X I 4 Bright A_Light1
    SH4X J 3 Bright A_Light2
    TNT1 A 0 A_Light0
    Goto LightDone
  Spawn:
    QSGW A -1
    stop
  }
}
ACTOR BarrelChange : Inventory { Inventory.MaxAmount 3 } //Single-Shot Barrel Flash Alteration
ACTOR QuadCheck : Inventory { Inventory.MaxAmount 4 } //Reload Check

 

The difference between the two being line 1

 

and the gun will show up in the editor but when I try to launch GZDOOM it tells me that "script error, "testmap.wad:decorate" line xxx: '@property@pickupmessage' is an unknown actor property"

 

What am I screwing up?

Edited by KamkrazyIan

Share this post


Link to post
2 hours ago, KamkrazyIan said:

actor QuadShotgun : Weapon    //29999

You're commenting our the editor number, so the editor will not show this to you because it does not have an editor number, so the editor does not have a number it can use that would allow you to put it in the map.

 

2 hours ago, KamkrazyIan said:

actor QuadShotgun 29999

You're removing the inheritance from Weapon, so your weapon is not a weapon, it's not even an inventory item, it's just a standard basic actor that 1. cannot be picked up by the player, 2. cannot go in the player's inventory, 3. cannot be selected, and 4. cannot shoot.

 

The conclusion here is that removing bits of code arbitrarily without knowing what they do is like taking an animal and removing random organs. Chances are the critter isn't going to survive.

 

actor QuadShotgun : Weapon 29999

Try this and it should work.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×