[SOLVED] Custom weapons not working.

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
lonleyglobe0
Posts: 13
Joined: Sat Jun 17, 2017 10:17 am
Location: The Matrix

[SOLVED] Custom weapons not working.

Post by lonleyglobe0 »

I am in development of making a TC for doom, BUT! The custom weapon I made is not working. This is my first custom weapon. Whenever I place it on the map it comes up with a red triangle and a ! mark. And when I use IDKFA I cannot equip it.

Code: Select all

 ACTOR Lewisgun : Weapon 666
 {
 Inventory.PickupMessage "You got the Lewis obliterator, Make it rain lead!"
 Weapon.SelectionOrder 350
 Weapon.AmmoType "Clip"
 Weapon.AmmoUse 1
 Weapon.AmmoGive 16
 Weapon.SlotNumber 4
 AttackSound "sounds/lewisgun"
 States
 {
	Spawn:
	LEWP A -1
	Stop
	Ready:
	LEWS A 1 A_WeaponReady
	Loop
	Select:
	LEWS A 1 A_Raise
	Loop
	Deselect:
	LEWS A 1 A_Lower
	Loop
	Fire:
	LEWS B 1 A_FireBullets(5.5, 3, 8, 4, "BulletPuff", 1)
	LEWS C 1 A_FireBullets(5.5, 3, 8, 4, "BulletPuff", 1)
 
	Goto Ready
	Flash:
	LEWS B 2 BRIGHT A_Light1
	LEWS C A_Light0
	Goto LightDone
	}
 }
Last edited by lonleyglobe0 on Mon Jun 19, 2017 3:01 am, edited 1 time in total.
User avatar
Exosphere
Posts: 168
Joined: Sun Jun 11, 2017 11:42 am
Location: New England, US

Re: Custom weapons not working.

Post by Exosphere »

lonleyglobe0 wrote:I am in development of making a TC for doom, BUT! The custom weapon I made is not working. This is my first custom weapon. Whenever I place it on the map it comes up with a red triangle and a ! mark. And when I use IDKFA I cannot equip it.

Code: Select all

 ACTOR Lewisgun : Weapon 666
 {
 Inventory.PickupMessage "You got the Lewis obliterator, Make it rain lead!"
 Weapon.SelectionOrder 350
 Weapon.AmmoType "Clip"
 Weapon.AmmoUse 1
 Weapon.AmmoGive 16
 Weapon.SlotNumber 4
 AttackSound "sounds/lewisgun"
 States
 {
	Spawn:
	LEWP A -1
	Stop
	Ready:
	LEWS A 1 A_WeaponReady
	Loop
	Select:
	LEWS A 1 A_Raise
	Loop
	Deselect:
	LEWS A 1 A_Lower
	Loop
	Fire:
	LEWS B 1 A_FireBullets(5.5, 3, 8, 4, "BulletPuff", 1)
	LEWS C 1 A_FireBullets(5.5, 3, 8, 4, "BulletPuff", 1)
 
	Goto Ready
	Flash:
	LEWS B 2 BRIGHT A_Light1
	LEWS C A_Light0
	Goto LightDone
	}
 }
Welcome,

You forgot to add "A_Refire" and "Goto Ready" at the end of the fire mode. The correct way is below.

Code: Select all

Fire:
	LEWS B 1 A_FireBullets(5.5, 3, 8, 4, "BulletPuff", 1)
	LEWS C 1 A_FireBullets(5.5, 3, 8, 4, "BulletPuff", 1)
        LEWS C 1 A_Refire
        Goto Ready
Here is also an excellent resource for Doom Coding with regards to items, weapons, and sprites.
http://gunlabs.blogspot.com/

Good luck in your TC.
User avatar
lonleyglobe0
Posts: 13
Joined: Sat Jun 17, 2017 10:17 am
Location: The Matrix

Re: Custom weapons not working.

Post by lonleyglobe0 »

Exosphere wrote:
lonleyglobe0 wrote:I am in development of making a TC for doom, BUT! The custom weapon I made is not working. This is my first custom weapon. Whenever I place it on the map it comes up with a red triangle and a ! mark. And when I use IDKFA I cannot equip it.

Code: Select all

 ACTOR Lewisgun : Weapon 666
 {
 Inventory.PickupMessage "You got the Lewis obliterator, Make it rain lead!"
 Weapon.SelectionOrder 350
 Weapon.AmmoType "Clip"
 Weapon.AmmoUse 1
 Weapon.AmmoGive 16
 Weapon.SlotNumber 4
 AttackSound "sounds/lewisgun"
 States
 {
	Spawn:
	LEWP A -1
	Stop
	Ready:
	LEWS A 1 A_WeaponReady
	Loop
	Select:
	LEWS A 1 A_Raise
	Loop
	Deselect:
	LEWS A 1 A_Lower
	Loop
	Fire:
	LEWS B 1 A_FireBullets(5.5, 3, 8, 4, "BulletPuff", 1)
	LEWS C 1 A_FireBullets(5.5, 3, 8, 4, "BulletPuff", 1)
 
	Goto Ready
	Flash:
	LEWS B 2 BRIGHT A_Light1
	LEWS C A_Light0
	Goto LightDone
	}
 }
Welcome,

You forgot to add "A_Refire" and "Goto Ready" at the end of the fire mode. The correct way is below.

Code: Select all

Fire:
	LEWS B 1 A_FireBullets(5.5, 3, 8, 4, "BulletPuff", 1)
	LEWS C 1 A_FireBullets(5.5, 3, 8, 4, "BulletPuff", 1)
        LEWS C 1 A_Refire
        Goto Ready
Here is also an excellent resource for Doom Coding with regards to items, weapons, and sprites.
http://gunlabs.blogspot.com/

Good luck in your TC.
Thank you for pointing out that error but still it is not working. I suspect it has something to do with sprites not showing up, As the pick-up does not appear on the ground and the weapon works with regular doom sprites. have read a gunlabs tutorial on custom weapon sprites and followed everything correctly. I know the sprites work in the doom engine as I am using the tarpan machinegun sprite from Russian overkill (Don't worry, I'm only using it until I finished spriting my lewis gun). If you want I can send the .PK3 with my weapon, Sound and current map inside.
User avatar
TensorMatrix
Posts: 41
Joined: Wed Mar 29, 2017 7:05 am

Re: Custom weapons not working.

Post by TensorMatrix »

Have you tried adding "offsets" to your weapons sprites using SLADE?
User avatar
lonleyglobe0
Posts: 13
Joined: Sat Jun 17, 2017 10:17 am
Location: The Matrix

Re: Custom weapons not working.

Post by lonleyglobe0 »

TensorMatrix wrote:Have you tried adding "offsets" to your weapons sprites using SLADE?
Yes I have.
User avatar
TensorMatrix
Posts: 41
Joined: Wed Mar 29, 2017 7:05 am

Re: Custom weapons not working.

Post by TensorMatrix »

Sprites are invisible, am i correct? Can you still pickup the weapon and use it?
Accensus
Posts: 2383
Joined: Thu Feb 11, 2016 9:59 am

Re: Custom weapons not working.

Post by Accensus »

Try "use weaponnamehere" from console after you've picked up the weapon. That would force the player to equip it.
User avatar
lonleyglobe0
Posts: 13
Joined: Sat Jun 17, 2017 10:17 am
Location: The Matrix

Re: Custom weapons not working.

Post by lonleyglobe0 »

Lud wrote:Try "use weaponnamehere" from console after you've picked up the weapon. That would force the player to equip it.
I fixed it. The folder the weapon sprites were in was not named sprites.
Locked

Return to “Editing (Archive)”