Weapons without infinite ammo?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Odysseus55

Weapons without infinite ammo?

Post 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?
Penguin
Jedi Admin
Jedi Admin
Posts: 2541
Joined: Sun Mar 05, 2006 12:00 am
Location: Australia

RE: Weapons without infinite ammo?

Post by Penguin »

Check the units .odf theres also an ammo line there
Odysseus55

Post 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
Penguin
Jedi Admin
Jedi Admin
Posts: 2541
Joined: Sun Mar 05, 2006 12:00 am
Location: Australia

Post 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.
Odysseus55

Post by Odysseus55 »

So if I'm doing it wrong what do I need to change to make it right?
Alpha-17
Master Sergeant
Master Sergeant
Posts: 165
Joined: Mon Jan 22, 2007 2:26 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by Alpha-17 »

How did you make 10 shots per clip ?? I don't find the odf's....
Odysseus55

Post 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"
Tuskenjedi

Post 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.
Odysseus55

Post 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
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Post 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?)
Odysseus55

Post by Odysseus55 »

I assume its a salvo of at least one I can see it firing and I can kill with it.
Tuskenjedi

Post 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.
Odysseus55

Post by Odysseus55 »

its # 2 maybe it is the overheat thing I though I make it all 0 for overheat but I will double check
User avatar
phazon_elite
Rebel Colonel
Rebel Colonel
Posts: 597
Joined: Tue Jan 16, 2007 9:10 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
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:

Post 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
Odysseus55

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

Post 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.
RC-1290

Post by RC-1290 »

There is no WeaponAmmo definition in the weapon files, neither is there one in the parents. That's the whole problem.
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

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

Post 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.
RC-1290

Post 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...
Post Reply