Weapons without infinite ammo?
Moderator: Moderators
-
Odysseus55
Weapons without infinite ammo?
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?
can anyone help?
-
Penguin
- Jedi Admin

- Posts: 2541
- Joined: Sun Mar 05, 2006 12:00 am
- Location: Australia
RE: Weapons without infinite ammo?
Check the units .odf theres also an ammo line there
-
Odysseus55
-
Penguin
- Jedi Admin

- Posts: 2541
- Joined: Sun Mar 05, 2006 12:00 am
- Location: Australia
-
Alpha-17
- Master Sergeant

- Posts: 165
- Joined: Mon Jan 22, 2007 2:26 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
-
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"
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"
-
Tuskenjedi
-
Odysseus55
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
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?)
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?)
-
Tuskenjedi
-
Odysseus55
- phazon_elite
- Rebel Colonel

- Posts: 597
- Joined: Tue Jan 16, 2007 9:10 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: I'm sorry Link, I can't give the location. Come back when you're a little...mmmh...RICHER!
- Contact:
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
"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
-
Odysseus55
-
MercuryNoodles
- Jedi

- Posts: 1003
- Joined: Sun Mar 12, 2006 7:16 pm
- Projects :: Space - Boarding Action
- xbox live or psn: No gamertag set
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?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
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.
-
RC-1290
-
MercuryNoodles
- Jedi

- Posts: 1003
- Joined: Sun Mar 12, 2006 7:16 pm
- Projects :: Space - Boarding Action
- xbox live or psn: No gamertag set
WeaponAmmo is a parameter only found in soldier odfs, particularly the ones named "default". For example, this is in imp_inf_default_officer.odf:
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.
Code: Select all
WEAPONSECTION = 2
WeaponName = "imp_weap_inf_sonic_blaster"
WeaponAmmo = 5-
MercuryNoodles
- Jedi

- Posts: 1003
- Joined: Sun Mar 12, 2006 7:16 pm
- Projects :: Space - Boarding Action
- xbox live or psn: No gamertag set
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.
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.
-
RC-1290
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...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.
