Award weapons without losing defaults? [NEW INQUIRY]

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
CloudCleaver
Recruit Womprat Killer
Posts: 9
Joined: Tue Sep 06, 2016 9:20 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Award weapons without losing defaults? [NEW INQUIRY]

Post by CloudCleaver »

I would have thought this mod existed, but extensive Googling has turned up nothing. I want to mod my game such that getting an award weapon (from earning a medal or from having a Legendary status) will not replace your default armaments. E.g. The stupid award sniper rifle won't condemn you if you have to swap to a pistol, because you still have the normal rifle in addition to the award weapon.

If there IS a mod for this, do tell me. Otherwise, where should I start? I'm using the Steam version (so 1.1), and I'm planning to install the unofficial 1.3 today. I've modded other games (JK2, JK3, Battle for Middle Earth series, Elder Scrolls) but haven't done anything to Battlefront 2 before.

Thanks!

[EDIT]: Now that I have this change working, is there a way to make this change compatible with Unofficial Patch 1.3 r129's full version? Especially the graphics upgrades; as of right now my mod is mutually exclusive with any of the model or texture changes implemented by the patch.
Last edited by CloudCleaver on Sat Sep 10, 2016 11:16 pm, edited 2 times in total.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Award weapons without losing defaults?

Post by Anakin »

go to your "base" weapon odf and remove LockForMedalsType. That way it is like the rocket. You'll get both weapons. If you want to completely remove the Award weapon, remove it from the unit's odf, too.
CloudCleaver
Recruit Womprat Killer
Posts: 9
Joined: Tue Sep 06, 2016 9:20 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Award weapons without losing defaults?

Post by CloudCleaver »

How exactly do I access the ODF file to edit it? Perusing the resources here, it seems like the actual change will be simple (similar to an .ini edit in an EA game). But I can't find anything actually describing how to find or open ODF files. Are they locked in some kind of archive, similar to a .bsa?

EDIT: To clarify, I am not making a map. I would like to make a drop-in mod that works globally across maps, not a specific system for one modded map.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Award weapons without losing defaults?

Post by Anakin »

You need to install modtools. Then you get all source. These will be munged to lvl files and these can be replaced or added.

All you need: viewtopic.php?f=27&t=13806
CloudCleaver
Recruit Womprat Killer
Posts: 9
Joined: Tue Sep 06, 2016 9:20 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Award weapons without losing defaults?

Post by CloudCleaver »

So I'll need to basically make this mod for every map in the game?
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Award weapons without losing defaults?

Post by Teancum »

No, luckily. You replace the default sides, as they're known, for each faction. The characters load separate from the levels. So you'll need to rebuild the four main faction lvl files: REP, CIS, IMP, and ALL. Everything is included in the mod tools to do so. Just be aware that if you want to make changes to the default sides it will affect your ability to play online. Alternatively you can make a mod with a new era (like the Old Republic, but whatever you'd name it) and add in references to every stock map, then include your modded sides.

The short version: If you don't mind not being able to play online you can just rebuild and replace the side lvls. If you want to play online there's an additional step of creating a mod that will reference every stock map scenario.
CloudCleaver
Recruit Womprat Killer
Posts: 9
Joined: Tue Sep 06, 2016 9:20 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Award weapons without losing defaults?

Post by CloudCleaver »

I've poked around in the assets folder of the Mod Tools, and found a number of weapon related ODFs for each faction. Neither the award weapons nor the base weapons appear to have a LockForMedalsType attribute. Am I looking in the wrong place?
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Award weapons without losing defaults?

Post by Anakin »

Hidden/Spoiler:
[code]
[WeaponClass]
ClassParent = "com_weap_inf_rifle"
GeometryName = "rep_weap_inf_rifle.msh"

[Properties]
GeometryName = "rep_weap_inf_rifle"
HighResGeometry = "rep_1st_weap_inf_rifle"
OrdnanceName = "rep_weap_inf_rifle_ord"
FirePointName = "hp_fire"

//******************************************************
//*************** SOUND ****************
//******************************************************

MuzzleFlash = "small_muzzle_flash"
FlashColor = "80 80 255 255"
FlashLength = 0.025
FlashColor = "100 100 255 255"
FlashLength = 0.025
FlashLightColor = "220 220 255 175"
FlashLightRadius = "2.0"
FlashLightDuration = "0.25"
Discharge = "small_smoke_effect"


FireSound = "rep_weap_inf_rifle_fire"
ReloadSound = "com_weap_inf_reload_med"
ChangeModeSound = "com_weap_inf_equip_med"
FireEmptySound = "com_weap_inf_ammo_empty"
WeaponChangeSound = "com_weap_inf_equip_med"
JumpSound = "com_weap_inf_rifle_mvt_jump"
LandSound = "com_weap_inf_rifle_mvt_land"
RollSound = "com_weap_inf_rifle_mvt_roll"
//ProneSound = "com_weap_inf_rifle_mvt_lie"
SquatSound = "com_weap_inf_rifle_mvt_squat"
//StandSound = "com_weap_inf_rifle_mvt_getup"
[/code]
The "ClassParent" line tells you that, this odf inherits from com_weap_inf_rifle. So take a look at this file and find this:
ok it's called MedalsTypeToLock and not LockForMedalsType. My fault.
Hidden/Spoiler:
[code]
[WeaponClass]
ClassLabel = "cannon"

[Properties]
ScoreForMedalsType = 1
MedalsTypeToLock = 1

AnimationBank = "rifle"

[...]
[/code]
CloudCleaver
Recruit Womprat Killer
Posts: 9
Joined: Tue Sep 06, 2016 9:20 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Award weapons without losing defaults?

Post by CloudCleaver »

Ah, so since this property is in a parent/common file for each weapon, I need to just edit and munge the common side folder rather than each side individually?
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Award weapons without losing defaults?

Post by Anakin »

No. You need to check if all weapons inherit from common first.
And then you will notice, that there is no common.lvl file for the sides.

When you munge your sides (let's say rep) everything that have been munged before in common will be added to that lvl, too. You see that it is not good to put side specific things in the common folder, because everyone will get it. And before you do anything munge the common folder first. Otherwise if you munge only rep, the common changes will not be munged into it.
CloudCleaver
Recruit Womprat Killer
Posts: 9
Joined: Tue Sep 06, 2016 9:20 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Award weapons without losing defaults?

Post by CloudCleaver »

So...

1. Copy common and all four side folders from assets to the working directory
2. Munge common
3. Copy the line about medal locking from a parent class, paste into each faction's base weapon odfs (but set equal to 0 instead of 1 like default)
4. Munge the faction files
5. Edit scripts (which?) to make the game read the modified versions instead of the defaults
6. Munge everything
7. Copy working directory contents into addon\data of steam BFII install folder

Sound right?
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Award weapons without losing defaults?

Post by Anakin »

CloudCleaver wrote:So...

1. Copy common and all four side folders from assets to the working directory
2. delete the line from the common odf. 1 = rifle, 2 = pistol (?),... so 0 does not remove it. Just delete the line
3. Munge common
4. Munge the faction files
option 1: 5.-7. overwrite the rep.lvl, cis.lvl,... file
option 2: 5. Edit scripts addme.lua, copy the stock lua and mission, modify the lua to make the game read the modified versions instead of the defaults, make sure your addme is loaded AFTER all stock maps (3letter name needs to be behind the stock (XXX for example)
6. Munge everything
7. Copy working directory contents into addon\data of steam BFII install folder

Sound right?
CloudCleaver
Recruit Womprat Killer
Posts: 9
Joined: Tue Sep 06, 2016 9:20 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Award weapons without losing defaults?

Post by CloudCleaver »

Okay, thanks. Will overwriting the lvl files cause issues with unofficial patch 1.3 or the bf1 conversion mod? I have both of those installed at the moment
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Award weapons without losing defaults?

Post by Teancum »

It shouldn't, but it will break online compatibility.
CloudCleaver
Recruit Womprat Killer
Posts: 9
Joined: Tue Sep 06, 2016 9:20 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Award weapons without losing defaults?

Post by CloudCleaver »

All right, I've isolated the files that need changing: com_weap_inf_shotgun, com_weap_inf_rifle, com_weap_inf_pistol, and com_weap_inf_sniper. I've created a map with the ModTools (ZZZ), copied the folders in assets/sides/(all,rep,imp,cis,common) into data_ZZZ/Sides, and edited the four files in the common folder there by commenting out the lines with MedalstoLock. (None of the faction-specific weapon ODFs for the base versions of the pistol, rifle, shotgun, or sniper rifle contain MedalsToLock, that I've found; they all seem to inherit that from their Common versions).

I munged common (went very quickly) then individually munged each of the four factions.

After doing so, I can't find any new .lvl files for the four sides, or for common. Where would these go? Did I do something incorrectly?
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Award weapons without losing defaults?

Post by Anakin »

They should be at two places:
C:\BF2_ModTools\data_ZZZ\_LVL_PC\SIDE
Your virtual path to BF2\addon\ZZZ\...\SIDE

You may one check the first path. If there is nothing, look for some log txt files that may tell you some errors.

Did you install the fixed munge bats?? viewtopic.php?f=27&t=13806
CloudCleaver
Recruit Womprat Killer
Posts: 9
Joined: Tue Sep 06, 2016 9:20 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Award weapons without losing defaults? [NEW INQUIRY]

Post by CloudCleaver »

Thanks, guys, that got it! Had to install those fixes, delete the mod, start over, and then it worked like a charm.

EDIT
[EDIT for new question]: Now that I have this change working, is there a way to make this change compatible with Unofficial Patch 1.3 r129's full version? Especially the graphics upgrades; as of right now my mod is mutually exclusive with any of the model or texture changes implemented by the patch.

Double posting is against the RULES; please EDIT your post instead -Staff
Post Reply