Page 1 of 1
Maximising ammo for ChaosWeapons
Posted: Sun Aug 15, 2004 1:30 pm
by TheForgotten
I've be playing with a jailbreak addon I've created and have noticed that the MaxAmmo/MaxOutAmmo methods in the ut2k4 standard weapon class isn't overridden in the chaoswepon.uc, but the SuperMaxOutAmmo is.
Just thought I'd point this out and suggest that you consider doing so in your next release.
Posted: Mon Aug 16, 2004 6:53 pm
by jb
Ok so what are we doing wrong that you need this? Just trying to find whats "broke" so we can fix it for you. Thanks!!!
Posted: Mon Aug 16, 2004 7:21 pm
by jeditobe1
short version:
There are three different functions in the weapon class that deal with maximizing the ammo. They are MaxAmmo, MaxOutAmmo, and SuperMaxOutAmmo.
The super version is the one we have tweaked, we didnt do tweaks for the other two. The difference is that the super version sets the max ammo amounts to 999, while the others do not. At least, thats what i remember.
Posted: Wed Aug 18, 2004 3:47 pm
by TheForgotten
Spot on jeditobe.
Sorry to gripe, but it took me a while to work out what was wrong. You might also consider setting NUM_FIRE_MODES and overiding the methods that use it, such as add ammo.
Posted: Wed Aug 18, 2004 4:17 pm
by R.Flagg
I kinda curious about what Jb asked as well. What exactly isn't working?
Posted: Wed Aug 18, 2004 4:30 pm
by jeditobe1
There are a couple type of max-ammo commands, used by both mutators and the cheat codes. SuperMaxAmmo, which i referred to above as being the one that works, is used by the allammo and loaded cheats. However, it sets the maximum of each type of ammo to 999 and sets the ammo to 999. The other versions of the command dont raise it to the 999 max, but instead to whatever the maximum the weapon is set at.
To give an example:
If you have the nade launcher, and type allammo or loaded, right now you get 999 grenades of each ammo type.
If you use the maxammo/maxoutammo commands, it *should* give you 12 nades of each type excepting standard, which have a higher maximum. Right now, it doesnt, and im guessing it only gives out the maximum for whichever ammo type you have selected.
Posted: Wed Aug 18, 2004 4:36 pm
by R.Flagg
Ok, that's interesting. Thanks for the info.
But I'm (or we're) still curious about what makes this relevant, as opposed to coding trivia. What happens in-game that brought it up?
Posted: Wed Aug 18, 2004 4:40 pm
by jeditobe1
Well, for instance an invasion-style gametype might want to refresh your ammo after each wave. Likewise a LMS style gametype would want to give you ammo for each weapon but not 999.
Also looked it up in the code: the MaxAmmo function he refers to does not change your ammo, but instead is supposed to return the maximum amount of ammo for a given firing mode. The idea for this is that you can get the ratio of ammo you have versus the maximum you can have.
Posted: Wed Aug 18, 2004 4:44 pm
by R.Flagg
Ok then, are you saying we have a bug in Invasion?
Hehe, sorry, just looking for the actual bug that was spotted.
(and now having fun with you at same time)
Posted: Wed Aug 18, 2004 4:46 pm
by jeditobe1
Well as he said he was trying a jailbreak addon where it was a problem.
Also, LMS does actually use this command ingame, but we override it specifically for that gametype. The better solution would be to fix the command so it would work for any gametype that uses it
Posted: Wed Aug 18, 2004 4:48 pm
by R.Flagg
Posted: Wed Aug 18, 2004 5:44 pm
by Iceboy
And this is exactly why when I go to code stuff in my spare time my head starts to swim....
I really wish there was some sort of thing in print I could use a reference for making mutators and weapons.