Jump to content

Ammo and ammo types - Allowing weapons to use multiple ammo types.


Slayerjerman

Recommended Posts

So I was tinkering and got to thinking why should weapons be limited to a single ammo type. I spent a whole day experimenting with weapons & ammos.

Using weapon.rocketlauncher as a template since that's the only weapon I know that can change ammo types, i was able to create a test rifle that allows for switching ammo magazines and shoots bullets with various effects and such. However, it's kind of a sloppy hack as I simply made a copy of the default assault rifle, and created ammos called weapon.rocket.AP. weapon.rocket.HE, weapon.rocket.ZAP.... and edited weapons_gc.xml to fire the various new ammo types.

The side effect of this is that the test rifle had to be given the ammo property in weapons.xml as "ammo.rocket" to allow it to accept the multiple ammos and place the new ammo magazines under equipment/Rockets in the GUI. Trying to assign it "ammo.ballistic.rifle" resulted in the gun only accepting the standard magazine as valid ammo even though I have other ammos set up in weapons_gc...so that was no good.

While the test rifle cannot load ammo.ballistic.rifle magazines directly, it does work with any rocket ammo (which again, is a sloppy hack), including the new rocket ammos I made. I set up the weapon so that if it loaded any other rocket ammo it'd in effect fire as if it was standard rifle ammo (so that if you loaded weapon.rocket.frag, it would act as a standard rifle magazine), with the exception of the 3 new ammo types. You can load standard assault rifle magazines in combat if you use the quick reload on the UI, but not if you drag standard rifle mags onto the gun in the inventory screen, which is interesting, so its partially working there.

The downside is that with this method, weapons accept any rockets as magazine ammo and that new rocket ammo is treated globally, meaning that you would have sniper/MG/assault/shotgun/pistol all sharing the same ammo pool, effectively making ammo universal.... thats no good :(

I tried also creating ammo.ballistic.rifle and ammo.ballistic.rifleHE....both ammos work but only for the specific gun its assigned to be used. If a rifle is assigned ammo.ballistic.rifle, it wont load the other type and vice-versa. So thats no good either!

ANYWAY - TLDR;

Inside weapons.xml, under the "AMMO" column, is there anyway to allow a gun to accept multiple ammo types and/or somehow make all entries for "ammo.ballistic" act the same as ammo.rocket? I want 1 gun to use 5 ammos, like the rocket launcher to avoid having 5 guns for 5 ammo types.

Edited by Slayerjerman
Link to comment
Share on other sites

Calming music, calming music... *ahem*

You are teetering over a hole which both I and Gauddlike have fallen into. The answer is no. The closest you'll get is what you've already done, and asking people to pretty please not load the weapon with rockets.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...