Custom ammo pickups give no ammo whatsoever

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
AzureNorthwing
Posts: 4
Joined: Mon Jan 08, 2018 5:41 pm

Custom ammo pickups give no ammo whatsoever

Post by AzureNorthwing »

Hey guys!
I'm having a bit of a problem with making custom ammo, i made all the necessary stuff with the weapon and it's ammo and it all works fine but for some reason, picking up boxes of my newly created custom ammo gives no ammo to it whatsoever!
Note : Weapon pickups and Backpacks still give the specified amount, its just the boxes of ammo that are supposed to give the - Inventory.Amount - of ammo to the player that don't work for some reason, i can walk over and pick them up, and the game registers that but doesn't increase the players ammo amount at all.

Here's the code

Code: Select all

actor HeavyRounds : Ammo 12555
{
  Inventory.PickupMessage "Picked up a box of heavy rounds"
  Inventory.Amount 100
  Inventory.MaxAmount 300
  Inventory.Icon "AMORA0"
  Ammo.BackpackAmount 10
  Ammo.BackpackMaxAmount 600
  states
  {
  Spawn:
    AMOR A -1
    stop
  }
}
And i don't want to replace any of the four (Clip, Shell, Rocket, Cell) ammo types that the base Doom games use to get it to work, i want a completely new ammo type to be used by my weapon...
Any ideas what may be going wrong here? What am i missing to get this to work right?
User avatar
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: Custom ammo pickups give no ammo whatsoever

Post by wildweasel »

Nothing looks wrong here; the Inventory.Amounts are all set correctly. The only thing I can guess: is your weapon set to use HeavyRounds as its ammo type?
AzureNorthwing
Posts: 4
Joined: Mon Jan 08, 2018 5:41 pm

Re: Custom ammo pickups give no ammo whatsoever

Post by AzureNorthwing »

Yes, it is

Code: Select all

ACTOR Minigun : Weapon 7077
{
    Inventory.PickupMessage "You got the Minigun!"
    Inventory.PickupSound "misc/w_pkup"
    Weapon.SelectionOrder 400
    Weapon.Kickback 90
    Weapon.AmmoType "HeavyRounds"
    Weapon.AmmoGive 100
    Weapon.AmmoUse 1
And, picking up other instances of the same weapon will give ammo to it's respective cap ( 300 / 600 ) as well as picking Backpacks up... So my guess is that the ammo itself works properly... but...
Just the boxes themselves don't give any ammo whatsoever, i've tried some workaround with A_GiveInventory in a Pickup state but that also failed...

I'm playing and making this for GZDoom (If that has any relevance to the issue)
User avatar
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: Custom ammo pickups give no ammo whatsoever

Post by wildweasel »

I'm out of ideas. I suspect someone could help you if you could upload your project somewhere to look at - there's probably something obscure going wrong here.
AzureNorthwing
Posts: 4
Joined: Mon Jan 08, 2018 5:41 pm

Re: Custom ammo pickups give no ammo whatsoever

Post by AzureNorthwing »

I've tried making a dummy test map in a different .WAD and loading the wad with the weapons and ammo as a resource, and there everything works correctly. But any maps placed in the same wad as the new weapons and ammo have this issue... I guess I'll have to separate my maps and resources into different wads for it to work, since I can't pinpoint what's going wrong in the original wad
AzureNorthwing
Posts: 4
Joined: Mon Jan 08, 2018 5:41 pm

Re: Custom ammo pickups give no ammo whatsoever

Post by AzureNorthwing »

Alright, I fixed the situation (kinda) by making a new WAD and moving all the maps from the original into it. Everything works the way it should now all I have to do is to make sure the original WAD file loads the secondary WAD with all the maps in it...

I still have no idea what is the problem in the original WAD though, but at least custom ammo works now...
User avatar
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: Custom ammo pickups give no ammo whatsoever

Post by wildweasel »

AzureNorthwing wrote:I still have no idea what is the problem in the original WAD though
Which is why I asked if you could upload it somewhere for someone to look at. There is probably something strange going on, a bug that can be fixed somewhere along the chain of WAD to GZDoom.
Post Reply

Return to “Scripting”