Weapons and ammo compatability

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.
Apr 11, 2002
796
0
16
Dallas, TX
www.google.com
In 2.9, ammo must be incorperated into the weapon package. I was wondering
if it would be possible to assign ammo to a class, such as 40mm, and and assign
the class to the weapon/magazine and the magazine to the weapon. I would
imagine that this would allow for easier expansion of the armory post release.
As it is now, you can't have two mutators that add ammo to the same weapon
AFAIK.
 

jaunty

Active Member
Apr 30, 2000
2,506
0
36
I've been wanting this for a while, too. Not being able to share magazines between the FAMAS and M16 makes me sad.
 

Dr.J

Staying Alive.
Nov 25, 2001
444
0
16
Hong Kong
www.alkdjflakdjfksj.com
really? i thought that since you grab STANAGs for both the FAMAS and M16 in the shooting range that they are interchangable... have to check that out when i get home..

but yeah, something like the JAM mutator for OFP would be nice.
 

Arethusa

We will not walk in fear.
Jan 15, 2004
1,081
0
0
No, he's asking for the ability to vary ammunition types independantly. As it is now, if I install a mutator that give me some new 40mm grenades, I can't run any other mutators that touch the 40mms. And this sucks.
 

ecale3

Sniper - May be harmful to your health.
Jul 13, 2001
1,725
0
0
38
Maryland Bitch.
www.ecale25.netfirms.com
Well, i don't think that is entirely true arethusa. Say yurche's 40mm muttie is your favorite 40mm muttie and you have it turned on, every additional 40mm mutator you have turned on would have to be written so as to be compatible with yurches muttie.

I'm sure i made some mistakes trying to get the point across. but basically mutators that want to be compatible with other mutators affecting the same objects must be written with those other mutators in mind.
 

Shrap

Beaver
Oct 29, 2000
1,013
0
0
Well I never coded in UnrealScript but let's says...

If we have the class named "40mmNades" and all new new mutators heritates from this class to create their new 40mm. Now if the launchers uses the 40mmNades objects, why shouldn't it work ?
 
Apr 11, 2002
796
0
16
Dallas, TX
www.google.com
The type of grenade fired is built into the weapon class. We have yurches grenades. Someone else wants to add some grenades. They have to include yurches grenades in with their own package, because they are replacing the M16 and HK69. Let's say a third person wants to add some grenades. That person now must include the Yourch grenades and the other guys grenades into his package, because you can't combine the two M16a2s and the two HK69s.

There is a way to detect the various grenades and build a new weapon on the fly, but that would take a lot of coding, and the end user (you) would have to dig around through a large.ini file and put in the classes you want.
 

yurch

Swinging the clue-by-four
May 21, 2001
5,781
0
0
USA, Maryland.
Visit site
ecale3 said:
I'm sure i made some mistakes trying to get the point across. but basically mutators that want to be compatible with other mutators affecting the same objects must be written with those other mutators in mind.
It's pretty damned hard to get mutators compatable with anything if you are 'reclassing' things, without at least one having knowlage of the other.
If all the mutator does is call one of the basic mutator functions, that's fine, like a mutator that amplified damage or the ones that reinforce loadouts...
But you can never actually remove a class and replace it with a new one for everything, only extend the properties of the class to a new one. Mutators like the new40mm or RA basically take a default class as-is, and then modify the functionality of that class to fit thier own needs. The next mutator to try and do the same thing will work properly, but they will be using the default class again, not the previous mutator's extended class. It is most likely only one of the mutators will then physically take effect for players.
It may be possible to have weapons look at thier ammo type assigned when spawned and dynamically load the projectile type from information the ammo class carries (or from added information), but I'm not aware of any standard existing in inf at the moment for that sort of thing. Even with something like that, new40mm modifies the weapons that fire the 40mm's so they both can have the proper trajectory and are capable of cycling through/using that ammunition in the first place. (Inf weapons originally have a maximum of four ammunition types, and the m16 is already using three - see a problem?) Behavior like this from many mutators would make having a set ammo-type standard near impossible.
 
Last edited:

Beppo

Infiltration Lead-Programmer
Jul 29, 1999
2,290
5
38
52
Aachen, Germany
infiltration.sentrystudios.net
The different ammo types in INF are limited to an array of four as yurch already said. We implemented this a long time ago and were not in need to increase these values. In addition the weapons have a default setting of the useable ammo types that a mutator would be able to change on the fly... but for the M16/M203 combo the 'iteration' thru these ammo types is pretty much hardcoded and not dynamic. So yurch was forced to make his own version of the M16/M203 that allows some more ammo types and can iterate thru them more or less dynamically.

These are 'design mistakes' you have to make to avoid them later on. You can be sure that this concept of stuffing everything into predefined arrays aso is nothing we will do again in future releases. The new UT versions allow dynamic arrays (old UT'99 did not) for example and so you can easily add ammo types on the fly. You can even add multiple 'ammo slots' this way to allow switching between the standard M16 ammo types and the M203/40mm ammo types this way. At the moment they use the same array of ammo types... and that's the reason for the hardcoded cycling thru them. Again, future stuff will use dynamic codes and arrays in these places to allow adding new ammo types the very easy way.