Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
CaptainManiac

How to alter the ammotype of the weapon?

Question

Is there a way to alter the ammo like in  Brutal Doom?For example,a pistol which can use 9mm or 10mm for ammo and fires projectiles wjth different damage.Is there a way to make it using custominventories and acs?

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 1

To produce a gun with different ammo is very simple. There are a few things you need to know first though.

First, what ammo do you wanna use? 9mm? 10mm? .45 cal? etc... Once you got what you want, make a sprite of that ammo so that you have a visible "object" you pick up. I will use this mana as an example.

 

MANAA0.png.baee9588a60ae30b47ce97bb4d52acc2.png

Okay now you have your ammo, next you will need to make an actor property that inherits from "Ammo". Now the following part uses SLADE3 so if you utilise a different WAD editor, I'm not sure I'd be able to assist. This is all done inside a DECORATE script.

 

Okay so I'm going to assume for now you know how to make a gun but no idea how to implement custom ammo. Let's just say you have a gun (even if it's the doom pistol XD) and you want it to fire with mana rather than bullets. Below me is a few important steps.

 

 

WEAPON ORDER = Allows you to organize guns if multiple ones are in the same slot. (Fairly useless in my experience but some may find a use for it)

WEAPON.AMMOUSE = Does firing your gun cost 1 bullet, 1 shell, 10 mana, 25 rockets, etc...? How much you use for every time you fire is defined here

WEAPON.AMMOGIVE = Picking up this gun gives you this much ammo. In the example, you gain 100 mana.

WEAPON.AMMOTYPE "Mana" = The name of the ammo you wish to use. It says Mana down below since that's this gun's custom ammo. I'll show custom ammo a wee bit later

INVENTORY.PICKUPMESSAGE = Literally type whatever you want here but make sure it makes sense when you pick up the gun

TAG = Weirdly enough I don't know what this means so I just name it identical to the gun. Helps reduce confusion :)

 

GunHelp1.png.6931ddd99bd49791ed1933c65663c718.png

 

 

This actor is the name of the ammo. When you do Weapon.AmmoType remember to USE THE SAME NAME AS THIS ACTOR!!!

Also inherit from Ammo so that the game knows it is an ammo type. The ID on the end just helps you find it in whatever editor you use.

Okay so the next few bits will break down this text block

 

INVENTORY.AMOUNT 100 = How much ammo you gain for every ammo item you pick up. In the example, 1 mana cube = 100 mana

INVENTORY.MAXAMOUNT 1000 = The maximum ammo your gun will hold BEFORE you pick up a backpack

AMMO.BACKPACKAMOUNT 350 = How much will a backpack fill your ammo supply? In the example it only gives 350

AMMO.BACKPACKMAXAMOUNT 2000 = The maximum ammo your gun will hold AFTER you pick up a backpack

INVENTORY.PICKUPSOUND "misc/i_pkup" = This is the default DooM pickup sound effect

INVENTORY.PICKUPMESSAGE "Absorbed some mana." = What will be displayed every time you pick up ammo

INVENTORY.ICON "MANAA0" = The icon of your gun's ammo on the HUD. Do bare in mind this is for the fancy hud in GZDooM. For the regular HUD... It's complicated... >_>

 

And the state at the end is just an animation for your ammo if your ammo has an animation to it (For example if you want it to pulsate)

 

 

GunHelp2.png.203d012716af9ddd72eabc5684685262.png

 

Okay so if you need anymore help, call me. I'll happily share any other details if you need more assistance. :)

 

Share this post


Link to post
  • 0
14 hours ago, DynamiteKaitorn said:

To produce a gun with different ammo is very simple. There are a few things you need to know first though.

First, what ammo do you wanna use? 9mm? 10mm? .45 cal? etc... Once you got what you want, make a sprite of that ammo so that you have a visible "object" you pick up. I will use this mana as an example.

 

MANAA0.png.baee9588a60ae30b47ce97bb4d52acc2.png

Okay now you have your ammo, next you will need to make an actor property that inherits from "Ammo". Now the following part uses SLADE3 so if you utilise a different WAD editor, I'm not sure I'd be able to assist. This is all done inside a DECORATE script.

 

Okay so I'm going to assume for now you know how to make a gun but no idea how to implement custom ammo. Let's just say you have a gun (even if it's the doom pistol XD) and you want it to fire with mana rather than bullets. Below me is a few important steps.

 

 

WEAPON ORDER = Allows you to organize guns if multiple ones are in the same slot. (Fairly useless in my experience but some may find a use for it)

WEAPON.AMMOUSE = Does firing your gun cost 1 bullet, 1 shell, 10 mana, 25 rockets, etc...? How much you use for every time you fire is defined here

WEAPON.AMMOGIVE = Picking up this gun gives you this much ammo. In the example, you gain 100 mana.

WEAPON.AMMOTYPE "Mana" = The name of the ammo you wish to use. It says Mana down below since that's this gun's custom ammo. I'll show custom ammo a wee bit later

INVENTORY.PICKUPMESSAGE = Literally type whatever you want here but make sure it makes sense when you pick up the gun

TAG = Weirdly enough I don't know what this means so I just name it identical to the gun. Helps reduce confusion :)

 

 

 

This actor is the name of the ammo. When you do Weapon.AmmoType remember to USE THE SAME NAME AS THIS ACTOR!!!

Also inherit from Ammo so that the game knows it is an ammo type. The ID on the end just helps you find it in whatever editor you use.

Okay so the next few bits will break down this text block

 

INVENTORY.AMOUNT 100 = How much ammo you gain for every ammo item you pick up. In the example, 1 mana cube = 100 mana

INVENTORY.MAXAMOUNT 1000 = The maximum ammo your gun will hold BEFORE you pick up a backpack

AMMO.BACKPACKAMOUNT 350 = How much will a backpack fill your ammo supply? In the example it only gives 350

AMMO.BACKPACKMAXAMOUNT 2000 = The maximum ammo your gun will hold AFTER you pick up a backpack

INVENTORY.PICKUPSOUND "misc/i_pkup" = This is the default DooM pickup sound effect

INVENTORY.PICKUPMESSAGE "Absorbed some mana." = What will be displayed every time you pick up ammo

INVENTORY.ICON "MANAA0" = The icon of your gun's ammo on the HUD. Do bare in mind this is for the fancy hud in GZDooM. For the regular HUD... It's complicated... >_>

 

And the state at the end is just an animation for your ammo if your ammo has an animation to it (For example if you want it to pulsate)

 

 

GunHelp2.png.203d012716af9ddd72eabc5684685262.png

 

Okay so if you need anymore help, call me. I'll happily share any other details if you need more assistance. :)

 

14 hours ago, DynamiteKaitorn said:

 

So,i need to make a weapin change its ammo in real time,so if i use your example,to change the weapon's ammo,for example,this weapon can use mana and also can use souls ammo.So,i need to know:
does the ammotype property accepts string array values,for example to be str ammo[2] = {"Mana","Souls"} and via function similar to A_ChangeFlags that works for properties to change the ammotype property in the corresponding state as well as fire different projectiles.is that possible?

Share this post


Link to post
  • 0

To produce multiple ammo usage is beyond my expertise HOWEVER you CAN add an alt-fire which uses a different ammo type all together.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×