Adding weapon - what am I missing?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
Hibachi
Posts: 11
Joined: Sat Mar 31, 2018 2:40 pm

Adding weapon - what am I missing?

Post by Hibachi »

Hey.
I started making my own WAD recently and decided to import some weapons from other people. Everything worked flawlessly until SLADE decided to crash and remove all data from my WAD. I started again but I can't get new weapon to work. It appears in Doom Builder and I can see it on the ground but it's impossible to pick up. I added player class and set up the gun as starting weapon, but it doesn't show or shoot, I can only see my hud and crosshair. Sprites seem fine, code seems fine too since I compared it to other weapons.

Any ideas? Here's my DECORATE file:

Code: Select all

Actor 64Rifle : Weapon 801
{
    Weapon.SelectionOrder 500
	Weapon.SlotNumber 2
	Weapon.AmmoUse 1
	Weapon.AmmoGive 0
	AttackSound "sounds/RIFLE"
	Weapon.AmmoType "Clip"
	Inventory.PickupMessage "You got an assault rifle!"
	Obituary "$OB_MPCHAINGUN"
	Tag "$TAG_CHAINGUN"
	Scale 0.82
	States
	{
  Spawn:
	RIFD A 1
	RIFD A -1
	Stop
  
  Ready:
	RIFG A 1 A_WeaponReady
	TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
	Loop
	
  Select:
	TNT1 AAAAA 1 A_Raise
	TNT1 AAAAAAAAAA 0 A_Raise
	Goto SelectAnimation

 SelectAnimation:
    TNT1 A 1
	TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, "ReplaceTactical")
	RIFS ABCD 1
	Goto Ready
	
  ReplaceTactical:
    RIFS A 1
    TNT1 A 0 A_GiveInventory("64RifleTactical", 1)
	TNT1 A 0 A_TakeInventory("64Rifle", 1)
    Goto Ready	
	
 Deselect:
	RIFS DCBA 1
	TNT1 AAAAAAAAAA 0 A_Lower
	TNT1 A 1 A_Lower
	Wait
	
  Fire:
    TNT1 A 0
	TNT1 A 0 A_SetPitch (pitch-1.2)
    RIFF A 1 BRIGHT
	TNT1 A 0 A_JumpIfInventory("FiredRifle", 4, "Fire4")
	TNT1 A 0 A_JumpIfInventory("FiredRifle", 3, "Fire3")
	TNT1 A 0 A_JumpIfInventory("FiredRifle", 2, "Fire2")
	TNT1 A 0 A_JumpIfInventory("FiredRifle", 1, "Fire1")
	
	
  Fire0:	
	TNT1 A 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,40)
	TNT1 A 0 A_FireCustomMissile("Tracer", random(-3,3), 0, -1, -12, 0, random(-2,2))
	SHTG A 0 A_FireBullets (0.0, 0.0, -1, 7, "HItPuff")
	TNT1 A 0 A_PlaySound("RIFLE", 1)
	
	RIFF BC 1 A_SetPitch (pitch+0.6)
	TNT1 A 0 A_Firecustommissile("50CaseSpawn",0,0,-6,-18)
	TNT1 A 0 A_GiveInventory("FiredRifle", 1)
	RIFG A 1
	TNT1 A 0 A_Refire
	Goto FinishFire
	
 Fire1:	
	TNT1 A 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,40)
	TNT1 A 0 A_FireCustomMissile("Tracer", random(-3,3), 0, -1, -12, 0, random(-2,2))
	SHTG A 0 A_FireBullets (0.6, 0.6, -1, 7, "HItPuff")
	TNT1 A 0 A_PlaySound("RIFLE", 1)
	RIFF BC 1 A_SetPitch (pitch+0.6)
	TNT1 A 0 A_Firecustommissile("50CaseSpawn",0,0,-6,-18)
	TNT1 A 0 A_GiveInventory("FiredRifle", 1)
	RIFG A 1
	TNT1 A 0 A_Refire
	Goto FinishFire	
	
 Fire2:	
	TNT1 A 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,40)
	TNT1 A 0 A_FireCustomMissile("Tracer", random(-3,3), 0, -1, -12, 0, random(-2,2))
	SHTG A 0 A_FireBullets (2.0, 2.0, -1, 7, "HItPuff")
	TNT1 A 0 A_PlaySound("RIFLE", 1)
	RIFF BC 1 A_SetPitch (pitch+0.6)
	TNT1 A 0 A_Firecustommissile("50CaseSpawn",0,0,-6,-18)
	TNT1 A 0 A_GiveInventory("FiredRifle", 1)
	RIFG A 1
	TNT1 A 0 A_Refire
	Goto FinishFire	
	
 Fire3:	
	TNT1 A 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,40)
	TNT1 A 0 A_FireCustomMissile("Tracer", random(-3,3), 0, -1, -12, 0, random(-2,2))
	SHTG A 0 A_FireBullets (4.0, 4.0, -1, 7, "HItPuff")
	TNT1 A 0 A_PlaySound("RIFLE", 1)
	RIFF BC 1 A_SetPitch (pitch+0.6)
	TNT1 A 0 A_Firecustommissile("50CaseSpawn",0,0,-6,-18)
	TNT1 A 0 A_GiveInventory("FiredRifle", 1)
	RIFG A 1
	TNT1 A 0 A_Refire
	Goto FinishFire	
	
 Fire4:	
	TNT1 A 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,40)
	TNT1 A 0 A_FireCustomMissile("Tracer", random(-3,3), 0, -1, -12, 0, random(-2,2))
	SHTG A 0 A_FireBullets (7.0, 7.0, -1, 7, "HItPuff")
	TNT1 A 0 A_PlaySound("RIFLE", 1)
	RIFF BC 1 A_SetPitch (pitch+0.6)
	TNT1 A 0 A_Firecustommissile("50CaseSpawn",0,0,-6,-18)
	TNT1 A 0 A_GiveInventory("FiredRifle", 1)
	RIFG A 1
	TNT1 A 0 A_Refire
	Goto FinishFire	
	
 FinishFire:	
	RIFG A 1
	TNT1 A 0 A_TakeInventory("FiredRifle", 4)
    Goto Ready
	
	}
}
It's a rifle from Brutal Doom 64 if you were wondering.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

Re: Adding weapon - what am I missing?

Post by Blue Shadow »

Hibachi wrote:I can see it on the ground but it's impossible to pick up.
Someone encountered a similar issue recently: viewtopic.php?f=122&t=59812
User avatar
Hibachi
Posts: 11
Joined: Sat Mar 31, 2018 2:40 pm

Re: Adding weapon - what am I missing?

Post by Hibachi »

Ah, I see. Thank you for your reply.

Return to “Scripting”