Page 1 of 1
Does not pick up
Posted: Wed Jul 12, 2017 6:20 pm
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?
Re: Does not pick up
Posted: Wed Jul 12, 2017 6:59 pm
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
Re: Does not pick up
Posted: Wed Jul 12, 2017 7:10 pm
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.
Re: Does not pick up
Posted: Wed Jul 12, 2017 8:12 pm
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?
Re: Does not pick up
Posted: Wed Jul 12, 2017 9:31 pm
by Voros
1. Add a Weapon.SlotNumber property. Preferably
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"
}
Re: Does not pick up
Posted: Wed Jul 12, 2017 10:10 pm
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.
Re: Does not pick up
Posted: Wed Jul 12, 2017 11:07 pm
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.
Re: Does not pick up
Posted: Wed Jul 12, 2017 11:09 pm
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.
Re: Does not pick up
Posted: Wed Jul 12, 2017 11:36 pm
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.
Re: Does not pick up
Posted: Fri Jul 21, 2017 2:29 pm
by Kuroii-iioruK
Thank you guys, finaly i fix the weapon. the problem was that i named wrong the sprites...
Now the weapon works great
Re: Does not pick up
Posted: Fri Jul 21, 2017 4:30 pm
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.
Re: Does not pick up
Posted: Sun Jul 23, 2017 7:59 am
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