Page 1 of 2

Weapons without infinite ammo?

Posted: Tue Feb 13, 2007 4:04 am
by Odysseus55
I am trying to make a pistol without infinate ammo can anyone help I have already done shots per clip = 10 and it shows it ingame but shooting the pistol doesnt use up ammo.?

can anyone help?

RE: Weapons without infinite ammo?

Posted: Tue Feb 13, 2007 4:09 am
by Penguin
Check the units .odf theres also an ammo line there

Posted: Tue Feb 13, 2007 4:16 am
by Odysseus55
yes I've changed that too it only seems towork with some weapons....are soem just hard coded to be a certain way? I tried to change the award sniper rifle to not shoot a beam but was not able to

Posted: Tue Feb 13, 2007 4:19 am
by Penguin
Its not hard coded. Sounds to me like your munging it wrong or have skipped files out, or missing lua stuff, etc. Basicly just sounds like you've set the custom side up wrong.

Posted: Tue Feb 13, 2007 4:33 am
by Odysseus55
So if I'm doing it wrong what do I need to change to make it right?

Posted: Tue Feb 13, 2007 2:44 pm
by Alpha-17
How did you make 10 shots per clip ?? I don't find the odf's....

Posted: Tue Feb 13, 2007 4:30 pm
by Odysseus55
Well I TRIED to make it 10 shots per clip it didnt work for some reason. It only works for me for weapons that already have x shots per clip not the infinite ammo ones.

look at the common weapons or use this line in the odf of course 10 can be whatever you want. this should work no problem for a rifle.

RoundsPerClip = "10"

Posted: Tue Feb 13, 2007 4:32 pm
by Tuskenjedi
in the soldier's odf the is a line that says how many clips there are. (the line is "weaponamount", or something like that) If it is set to 0, there will be infinite amounts.

Posted: Tue Feb 13, 2007 4:47 pm
by Odysseus55
it is not set to zero it is set to 3 and it shows there being 30 in the ammo area and 4 in the clip area but when I fire the clip is not used up

Posted: Tue Feb 13, 2007 5:10 pm
by Maveritchell
If, where the weapon is called in the .odf, you have the WeaponAmmo set to a nonzero (positive, lol) integer, and you have a specified number of RoundsPerClip, then your weapon should use up ammo. Look at the default award pistol for an example.

You say, though, that the weapon is not being used up, although it displays the right numbers. You're not firing a salvo of zero, right? (I.e. you're actually doing damage?)

Posted: Tue Feb 13, 2007 5:13 pm
by Odysseus55
I assume its a salvo of at least one I can see it firing and I can kill with it.

Posted: Tue Feb 13, 2007 5:16 pm
by Tuskenjedi
what you are saying is that,
1: you can still fire even after your ammo is depleted,
or is it,
2: the clip doesn't run out.

#2 would probably mean it still has an line refering to overheat somewhere in the weapon file which says it doesn't overheat.

Posted: Tue Feb 13, 2007 11:33 pm
by Odysseus55
its # 2 maybe it is the overheat thing I though I make it all 0 for overheat but I will double check

Posted: Tue Feb 13, 2007 11:42 pm
by phazon_elite
Did you delete the

"HeatPerShot" = "BLAH.BLOB"
"HeatThreshold" = "BLAH.M88"
"HeatRecoverRate" = "BLAH.BLAH"

lines in your odf? That might be something. I didn't do that with my chaingun one time in my Kamino: Breakout map and it overheated before it ran out of ammo.

Also, Is it calling for the ordnance (_ord)?

- EP-000782

Posted: Wed Feb 14, 2007 3:14 am
by Odysseus55
I did not delete them I set them each to zero I am modifing the standard pistol not creating a new one because I had problems getting the award upgrades to work with custom weapons.

Posted: Fri Feb 16, 2007 11:46 am
by MercuryNoodles
it is not set to zero it is set to 3 and it shows there being 30 in the ammo area and 4 in the clip area but when I fire the clip is not used up
What? Elaborate, because the game doesn't show how many clips you have directly. If you have 10 ShotsPerClip and 3 for WeaponAmmo, it should show 30 rounds in the game and nothing else. There shouldn't be 4 of anything involved anywhere. So, you're saying it does not reload after 10 shots?

Are you modifying this weapon as a part of a custom side? Loading stock lvl files in the lua will make the stock weapon override your changes even in the custom lvl, because the same weapon is also included in the stock lvl file.

Overheating has nothing to do with ammo. It just tells the weapon when to stop firing to "cool off" because of "heat" buildup. It is not connected to ammo usage at all. That is purely coincidence.

Posted: Fri Feb 16, 2007 12:56 pm
by RC-1290
There is no WeaponAmmo definition in the weapon files, neither is there one in the parents. That's the whole problem.

Posted: Fri Feb 16, 2007 1:16 pm
by MercuryNoodles
WeaponAmmo is a parameter only found in soldier odfs, particularly the ones named "default". For example, this is in imp_inf_default_officer.odf:

Code: Select all

WEAPONSECTION = 2
WeaponName         = "imp_weap_inf_sonic_blaster"
WeaponAmmo         = 5
There is no reason for WeaponAmmo to be in any weapon odf, because (beside it not working, in theory) then you would not be able to vary ammo counts per class.

Posted: Wed Feb 21, 2007 4:02 pm
by MercuryNoodles
Sorry about the double-post, but I finally understood the problem and solved it. Incidentally, I ran into the same problem today. Using a weapon like com_weap_inf_commando_pistol as the parent weapon somehow affects the child in such a way that ammo isn't used at all, though it does display an ammo count ingame. So, I decided to experiment a little.

There are two ways to fix this:

1) Use a parent weapon that wasn't made to have infinite ammo. This would be in the case that you don't want to alter all of the children of a certain weapon.

2) Alter the RoundsPerClip line in the parent infinite ammo weapon to a positive non-zero number. Once this is changed from 0, it no longer has any effect on the problematic child weapon.

Posted: Wed Feb 21, 2007 4:08 pm
by RC-1290
1) Use a parent weapon that wasn't made to have infinite ammo. This would be in the case that you don't want to alter all of the children of a certain weapon.
The whole parenting thing is quite useless to the average mod-maker, this is only usefull when you are massproducing maps(wich I'd say is a bad thing since you get a lot of maps wich are quite the same). Really it is way more usefull to just copy all the parents information in the child when you edit it. A lot easyer to edit weapon stats that way, and you get more diverse weapons...