Does not pick up

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.
Kuroii-iioruK
Posts: 7
Joined: Wed Nov 30, 2016 6:26 pm

Does not pick up

Post by Kuroii-iioruK »

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?
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: Does not pick up

Post by Nevander »

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
Kuroii-iioruK
Posts: 7
Joined: Wed Nov 30, 2016 6:26 pm

Re: Does not pick up

Post by Kuroii-iioruK »

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
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.
User avatar
Matt
Posts: 9670
Joined: Sun Jan 04, 2004 5:37 pm
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Does not pick up

Post by Matt »

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?
User avatar
Voros
Posts: 151
Joined: Fri Feb 03, 2017 11:47 pm

Re: Does not pick up

Post by Voros »

1. Add a Weapon.SlotNumber property. Preferably

Code: Select all

    Weapon.SlotNumber 3
2. Create a new Player.txt:

Code: Select all

ACTOR Player : DoomPlayer 
{
    Player.WeaponSlot 3 Shotgun, SuperShotgun, GoldenShotgun
    Player.SpawnClass "Player"
}
Create a new MAPINFO.txt

Code: Select all

GameInfo
{
    PlayerClasses = "Player"
}
User avatar
Matt
Posts: 9670
Joined: Sun Jan 04, 2004 5:37 pm
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: Does not pick up

Post by Matt »

I don't see how 2-3 would help any if the problem is that the pickup on the ground cannot be picked up.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: Does not pick up

Post by Nevander »

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.
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.
User avatar
wildweasel
Moderator Team Lead
Posts: 21447
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10, 21H1
Graphics Processor: nVidia with Vulkan support

Re: Does not pick up

Post by wildweasel »

Nevander wrote:
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.
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).
In those cases, the item can potentially still enter your inventory, it just will not be selectable.
User avatar
Blue Shadow
Posts: 4904
Joined: Sun Nov 14, 2010 12:59 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Does not pick up

Post by Blue Shadow »

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.
Kuroii-iioruK
Posts: 7
Joined: Wed Nov 30, 2016 6:26 pm

Re: Does not pick up

Post by Kuroii-iioruK »

Thank you guys, finaly i fix the weapon. the problem was that i named wrong the sprites...
ty.png
Now the weapon works great
You do not have the required permissions to view the files attached to this post.
User avatar
Jekyll Grim Payne
 
 
Posts: 936
Joined: Mon Jul 21, 2008 4:08 am
Graphics Processor: nVidia (Modern GZDoom)

Re: Does not pick up

Post by Jekyll Grim Payne »

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.
User avatar
Voros
Posts: 151
Joined: Fri Feb 03, 2017 11:47 pm

Re: Does not pick up

Post by Voros »

Jekyll 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.
I could use this to my advantage >:D

Return to “Editing (Archive)”