Fixing a weapon added to a unit

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

Post Reply
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Fixing a weapon added to a unit

Post by Fiodis »

Let's say I added the clone rifleman's award rifle to a cloaked anakin model in place of his saber toss. Let's say I munged and, in-game, it worked perfectly except for the fact that the weapon's icon was floating on the screen and that once de-selected, it was impossible to re-select.

I know there's a tutorial in the FAQ section on floating weapons; I'll look into it now. But is there a fix for the de-selection bug? I suppose I could just delete his choke, so that it was impossible to de-select the rifle in the first place; but for obvious reasons I'd rather avoid that. Can it be done?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Fixing a weapon added to a unit

Post by Maveritchell »

"Let's say" we stop talking in hypotheticals.

All you have is the award weapons "bug." You've given a unit a weapon that normally has an award weapon but you didn't load the award weapon in the unit's odf. Either make a custom weapon without an award, or make sure to load the award weapon through the .odf (see stock unit .odfs for an example).
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Fixing a weapon added to a unit

Post by Fiodis »

I did put the award weapon into Anakin's odf, though. I didn't put in the normal rifle. Does that matter?

Also, in what odf and where in it can I change the amount of ammo a weapon has? I've been sifting through common and rep weapon odfs but I can't seem to find it. I can change the amount per clip, but not the maximum ammo over all.
User avatar
RED51
Jedi
Jedi
Posts: 1024
Joined: Sun Sep 07, 2008 6:25 pm
Games I'm Playing :: SWBFII

Re: Fixing a weapon added to a unit

Post by RED51 »

You increase the ammo by rising this number, found in the default unit(i.e.:rep_inf_default_rifleman):
WeaponAmmo = 4 With the normal rifle odf that has 50 rounds per clip, you will have 200 rounds
Change to
WeaponAmmo = 8 Now, you will have 400 rounds
User avatar
Fiodis
Master of the Force
Master of the Force
Posts: 4145
Joined: Wed Nov 12, 2008 9:27 pm
Projects :: Rannoch + Tientia + Tools Programming

Re: Fixing a weapon added to a unit

Post by Fiodis »

Thanks for that! It was simple, and it worked, too. I was flicking through weapon odfs; I never thought to go to the unit's odf.

Now all there is is to fix that de-selection thing. I didn't completely understand Mav's answer, although I know that he is a great modder and if I did understand his explanation, it would work. So could anyone explain his response to me, please?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Fixing a weapon added to a unit

Post by Maveritchell »

Just add these lines to your weapon's .odf:

Code: Select all

ScoreForMedalsType = -1
MedalsTypeToUnlock = -1
Post Reply