Does not pick up
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.
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.
-
- Posts: 7
- Joined: Wed Nov 30, 2016 6:26 pm
Does not pick up
I made some basic changes to a shotgun, but when i walk above it the doomguy don´t pick up the weapon. I tried (i think) everything but i can´t fix the bug.
Here is the code
ACTOR GoldenShotgun : Shotgun 6510
{
Weapon.SelectionOrder 1301
Weapon.AmmoUse 1
Weapon.AmmoGive 4
Weapon.AmmoType "GoldenShell"
Inventory.PickupMessage "$GOTGOLDENSHOTGUN"
Obituary "$OB_MPGOLDENSHOTGUN"
Attacksound "weapons/shotgf"
States
{
Ready:
GHTG A 1 A_WeaponReady
Loop
Deselect:
GHTG A 1 A_Lower
Loop
Select:
GHTG A 1 A_Raise
Loop
Fire:
GHTG A 0 A_fireBullets(10,10,10,random(7,12),"GOLDENpuff")
GHTG A 7 A_GUNFLASH
GHTG BC 5
GHTG D 4
GHTG CB 5
GHTG A 3
GHTG A 7 A_ReFire
Goto Ready
Flash:
GHTF A 4 Bright A_Light1
GHTF B 3 Bright A_Light2
Goto LightDone
Spawn:
GHOT A -1
Stop
}
}
I try out with Skulltag, Zandronum, Gzdoom and Zdoom and still not work.
can you help me?
Here is the code
ACTOR GoldenShotgun : Shotgun 6510
{
Weapon.SelectionOrder 1301
Weapon.AmmoUse 1
Weapon.AmmoGive 4
Weapon.AmmoType "GoldenShell"
Inventory.PickupMessage "$GOTGOLDENSHOTGUN"
Obituary "$OB_MPGOLDENSHOTGUN"
Attacksound "weapons/shotgf"
States
{
Ready:
GHTG A 1 A_WeaponReady
Loop
Deselect:
GHTG A 1 A_Lower
Loop
Select:
GHTG A 1 A_Raise
Loop
Fire:
GHTG A 0 A_fireBullets(10,10,10,random(7,12),"GOLDENpuff")
GHTG A 7 A_GUNFLASH
GHTG BC 5
GHTG D 4
GHTG CB 5
GHTG A 3
GHTG A 7 A_ReFire
Goto Ready
Flash:
GHTF A 4 Bright A_Light1
GHTF B 3 Bright A_Light2
Goto LightDone
Spawn:
GHOT A -1
Stop
}
}
I try out with Skulltag, Zandronum, Gzdoom and Zdoom and still not work.
can you help me?
Re: Does not pick up
Three options:
1) Give the weapon a Weapon.SlotNumber property, it should pick up then without replacing the player class
2) Replace the player class with a new one and add this shotgun into a slot
3) Add REPLACES so that it replaces the normal Shotgun, but I assume you don't want this so I'd try option 1
1) Give the weapon a Weapon.SlotNumber property, it should pick up then without replacing the player class
2) Replace the player class with a new one and add this shotgun into a slot
3) Add REPLACES so that it replaces the normal Shotgun, but I assume you don't want this so I'd try option 1
-
- Posts: 7
- Joined: Wed Nov 30, 2016 6:26 pm
Re: Does not pick up
I tried the number 3 and still not work. the 1 and 2 i don´t know how to do but i assume that the result is the same.Nevander wrote:Three options:
1) Give the weapon a Weapon.SlotNumber property, it should pick up then without replacing the player class
2) Replace the player class with a new one and add this shotgun into a slot
3) Add REPLACES so that it replaces the normal Shotgun, but I assume you don't want this so I'd try option 1
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: Does not pick up
I see nothing in that code that would prevent a pickup.
Are you sure you're not reflexively typing IDFA on spawn whenever you test something? (I do that a lot) or doing something else that would cause you to already have the gun by the time you arrive at the pickup?
Also, have you defined the "GoldenShell" ammotype yet and are the sprites already in your wad?
Are you sure you're not reflexively typing IDFA on spawn whenever you test something? (I do that a lot) or doing something else that would cause you to already have the gun by the time you arrive at the pickup?
Also, have you defined the "GoldenShell" ammotype yet and are the sprites already in your wad?
Re: Does not pick up
1. Add a Weapon.SlotNumber property. Preferably
2. Create a new Player.txt:
Create a new MAPINFO.txt
Code: Select all
Weapon.SlotNumber 3
Code: Select all
ACTOR Player : DoomPlayer
{
Player.WeaponSlot 3 Shotgun, SuperShotgun, GoldenShotgun
Player.SpawnClass "Player"
}
Code: Select all
GameInfo
{
PlayerClasses = "Player"
}
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: Does not pick up
I don't see how 2-3 would help any if the problem is that the pickup on the ground cannot be picked up.
Re: Does not pick up
Because you can't pick up guns that aren't given either a slot number in the actor itself or assigned to a slot in the player class (or replacing the normal shotgun of course). I had this same problem before when I made guns and it was because the weapon did not have a slot number nor assigned to the slots in the replaced DoomPlayer.Vaecrius wrote:I don't see how 2-3 would help any if the problem is that the pickup on the ground cannot be picked up.
- wildweasel
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
- Contact:
Re: Does not pick up
In those cases, the item can potentially still enter your inventory, it just will not be selectable.Nevander wrote:Because you can't pick up guns that aren't given either a slot number in the actor itself or assigned to a slot in the player class (or replacing the normal shotgun of course).Vaecrius wrote:I don't see how 2-3 would help any if the problem is that the pickup on the ground cannot be picked up.
-
- Posts: 4949
- Joined: Sun Nov 14, 2010 12:59 am
Re: Does not pick up
The lack of a slot doesn't prevent the weapon from being picked up. What does though is the lack of sprites. The engine checks the first state in the Ready state sequence. If the sprite is invalid, the weapon can't be picked up.
-
- Posts: 7
- Joined: Wed Nov 30, 2016 6:26 pm
Re: Does not pick up
Thank you guys, finaly i fix the weapon. the problem was that i named wrong the sprites...
Now the weapon works great- Jekyll Grim Payne
-
- Posts: 1073
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
- Contact:
Re: Does not pick up
And another thing to keep in mind is that weapon.ammogive should be non-zero. If it is 0, you'll only be able to pick the weapon up once. Just came across it and decided to post here.
Re: Does not pick up
I could use this to my advantage >:DJekyll Grim Payne wrote:And another thing to keep in mind is that weapon.ammogive should be non-zero. If it is 0, you'll only be able to pick the weapon up once.