A question about ammo

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!)
User avatar
gabgabgab
Posts: 2
Joined: Tue Oct 31, 2017 1:29 am

A question about ammo

Post by gabgabgab »

Can you have an ammo pickup that gives out 2 ammo types?
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

Re: A question about ammo

Post by wildweasel »

For this sort of thing, I tend to create a CustomInventory pickup that gives the ammo types in its Pickup state.

Code: Select all

ACTOR DoubleAmmoThing : CustomInventory
{
	Inventory.PickupMessage "Two! TWO! Two ammos in one!"
	Inventory.PickupSound "pickups/cheesyjingle"
	States
	{
	Spawn:
		BPAK A -1
		Stop
	Pickup:
		TNT1 A 0 A_GiveInventory("SomeBeefyAmmoType", 4)
		TNT1 A 0 A_GiveInventory("ABunchaLittleBoolits", 50)
		Stop
	}
}
User avatar
gabgabgab
Posts: 2
Joined: Tue Oct 31, 2017 1:29 am

Re: A question about ammo

Post by gabgabgab »

Thanks

Return to “Scripting”