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.

Custom ammo pickups give no ammo whatsoever

Postby AzureNorthwing » Mon Jan 08, 2018 5:53 pm

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 allExpand view
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?
AzureNorthwing
 
Joined: 08 Jan 2018

Re: Custom ammo pickups give no ammo whatsoever

Postby wildweasel » Mon Jan 08, 2018 6:05 pm

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?
User avatar
wildweasel
change o' pace.
Moderator Team Lead
 
Joined: 15 Jul 2003

Re: Custom ammo pickups give no ammo whatsoever

Postby AzureNorthwing » Mon Jan 08, 2018 6:15 pm

Yes, it is

Code: Select allExpand view
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)
AzureNorthwing
 
Joined: 08 Jan 2018

Re: Custom ammo pickups give no ammo whatsoever

Postby wildweasel » Mon Jan 08, 2018 10:16 pm

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.
User avatar
wildweasel
change o' pace.
Moderator Team Lead
 
Joined: 15 Jul 2003

Re: Custom ammo pickups give no ammo whatsoever

Postby AzureNorthwing » Tue Jan 09, 2018 6:50 am

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
 
Joined: 08 Jan 2018

Re: Custom ammo pickups give no ammo whatsoever

Postby AzureNorthwing » Tue Jan 09, 2018 6:24 pm

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...
AzureNorthwing
 
Joined: 08 Jan 2018

Re: Custom ammo pickups give no ammo whatsoever

Postby wildweasel » Tue Jan 09, 2018 10:57 pm

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.
User avatar
wildweasel
change o' pace.
Moderator Team Lead
 
Joined: 15 Jul 2003


Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests