Cannot pick up a custom weapon

Sat Feb 19, 2022 9:58 am

Hello, I know this question has been asked before, and I have tried to search for my answer, but I ended up being unsuccessful, so I am asking here. I am new to modding in new weapons, so as you may predict, my first one was....quite a bit faulty(very faulty) :?. The problem I have is that when I change the spawn sprite to the test sprite I made, it shows a big triangle with an exclamation mark. The second problem is, when I try to change it into another sprite(just to test function), like a shotgun pickup sprite, it still doesn't pickup the weapon. So I tried to test if it works AT ALL, by using the "idfa" code, and when I pressed 1(I replaced the chainsaw with my weapon), Nothing happened. It went automatically to the fist. And to clarify, yes I did put my sprites in-between S_START and S_END, but no, nothing happened. So, I will post the code here and if anyone could help me fix it, I'd be very thankful. Thanks in advance to any responders.

ACTOR DoomMan: DoomPlayer {
Player.WeaponSlot 1, Fist, ElectricalShotgun
Player.WeaponSlot 2, Pistol
Player.WeaponSlot 3, Shotgun, SuperShotgun
Player.WeaponSlot 4, Chaingun
Player.WeaponSlot 5, RocketLauncher
Player.WeaponSlot 6, PlasmaRifle
Player.WeaponSlot 7, BFG9000
}

ACTOR ElectricalShotgun: Weapon replaces Chainsaw 20000 {
Weapon.SelectionOrder 50
Weapon.AmmoUse 2
Weapon.AmmoGive 25
Weapon.AmmoType "Clip"

Inventory.PickupMessage "You got the Electrical Shotgun!"

States {
Spawn:
SHOT A -1
Stop

Select:
ESHG A 1 A_Raise
Loop

Deselect:
ESHG A 1 A_Lower
Loop

Ready:
ESHG A 1 A_WeaponReady
Loop

Fire:
SSHG A 4
Goto ElecFire

ElecFire:
SSHG B 0 A_Recoil(4)
SSHG C 5 A_FireCustomMissile("ShockMissile",0,2,0,-8)
SSHG D 5
ESHG E 0 A_Refire("ElecFire")
Goto Ready


}
}

ACTOR ShockMissile : Actor 20001 {
+RANDOMIZE

Decal "Scorch"
Projectile

Radius 6
Height 6
Speed 20
Damage 15

DeathSound "weapons/plasmax"

States {
Spawn:
ESHG A 4 Bright
Loop

Death:
ESHG A 4 Bright
Stop
}
}

Re: Cannot pick up a custom weapon

Sat Feb 19, 2022 2:54 pm

Try by adding this line to your weapon :
Code:
   Weapon.SlotNumber 1

If it doesn't work, create a MAPINFO file in your wad and add :
Code:
GameInfo
{
   PlayerClasses = "DoomMan"
}
DoomEdNums
{
   20000 = ElectricalShotgun // If this weapon is on a map (level editor).
   20001 = ShockMissile
}

Re: Cannot pick up a custom weapon

Sun Feb 20, 2022 1:53 am

Hello Ac!d, as you might have noticed, this was created by a guest poster. (Me) I forgot to log in, and I am here to tell you that I tried both your suggestions, to no avail. I still cannot pick up the weapon, and when I give myself said weapon, it still does not exist.

Re: Cannot pick up a custom weapon

Sun Feb 20, 2022 2:25 am

There is a chance GZDoom might not be detecting your sprites.
Weapons will not be able to be picked up and selected if the sprites used in their Ready, Select and Deselect states don't exist.
Ensure your sprites are located between S_START and S_END in a wad or in a "sprites" folder in a pk3 file.

If it still doesn't work, could you upload your file here?

Re: Cannot pick up a custom weapon

Sun Feb 20, 2022 3:52 am

Of course, here is the file.

https://drive.google.com/file/d/1iULjtK ... sp=sharing

Re: Cannot pick up a custom weapon

Sun Feb 20, 2022 5:02 am

The file works if it was a .wad file. Check this page of the wiki for more informations

Here's your work in a .wad and a .pk3 format :
You do not have the required permissions to view the files attached to this post.

Re: Cannot pick up a custom weapon

Sun Feb 20, 2022 7:56 am

Ac!d thank you for your help, the weapon works now! Much appreciated.