Changing equipments through the ODF files [Solved]

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
KolSkywalker
Recruit Womprat Killer
Posts: 10
Joined: Tue Jan 17, 2017 5:12 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Changing equipments through the ODF files [Solved]

Post by KolSkywalker »

So say I have made a custom map with the default sides. I want to change the weapons/equipment of a Republic Jet Trooper, for example, the EMP launcher to a Shotgun.

Is it possible to achieve this without the SetClassProperty LUA and instead through the ODF?
Last edited by KolSkywalker on Thu Jan 26, 2017 3:07 am, edited 1 time in total.
User avatar
Oceans14
Command Sergeant Major
Command Sergeant Major
Posts: 296
Joined: Mon Apr 27, 2015 7:09 pm
Projects :: Athenova Campaign
Games I'm Playing :: SWBF2
Location: Planet 4546b

Re: Changing equipments through the ODF files

Post by Oceans14 »

Yes, it's possible. In order to do what you're saying, that is, change the jet trooper's weapons, you'll need to add the stock common and rep sides into your project's side folder. Then navigate to the odf directory and find "rep_inf_default_jettrooper.odf". Open that and replace the weapon names with the ones you want. Check out the FAQ for help on getting the custom side working; it's explained very well in another thread :thumbs:
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Changing equipments through the ODF files

Post by AnthonyBF2 »

Actually there are no custom sides required for just switching weapons.

The specific code you need is SetClassProperty("rep_inf_ep3_jettrooper", "WeaponName1", "rep_weap_inf_shotgun") and you put that code right after ScriptPostLoad()
SkinnyODST
Lieutenant Colonel
Lieutenant Colonel
Posts: 545
Joined: Mon Jul 04, 2016 10:56 pm
Location: My other account
Contact:

Re: Changing equipments through the ODF files

Post by SkinnyODST »

Yes, go into Data_***/sides/rep/odf. Now look for the shotgun odf file called "rep_weap_inf_shotgun". Copy that name, go into "rep_inf_default_jettropper" and where it says this -
WEAPONSECTION = 1
WeaponName = "rep_weap_inf_emp_launcher"
WeaponAmmo = 4
- simply change "rep_weap_inf_emp_launcher" to "rep_weap_inf_shotgun". This works for all weapon changing as well
KolSkywalker
Recruit Womprat Killer
Posts: 10
Joined: Tue Jan 17, 2017 5:12 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: Changing equipments through the ODF files

Post by KolSkywalker »

I am already aware and capable of the method of changing weapons through the lua scripts using the SetClassProperty line. Just wanted to know if its possible through the ODFs since I noticed the Weapon Sections and all. :)

So before posting this topic, I already tried to change a unit's weapon through the ODF, after copying the default COMMON & rep sides into my mod folder of course. However the change did not take effect and the unit still had his default weapon in his loadout.
SkinnyODST
Lieutenant Colonel
Lieutenant Colonel
Posts: 545
Joined: Mon Jul 04, 2016 10:56 pm
Location: My other account
Contact:

Re: Changing equipments through the ODF files

Post by SkinnyODST »

KolSkywalker wrote:I am already aware and capable of the method of changing weapons through the lua scripts using the SetClassProperty line. Just wanted to know if its possible through the ODFs since I noticed the Weapon Sections and all. :)

So before posting this topic, I already tried to change a unit's weapon through the ODF, after copying the default COMMON & rep sides into my mod folder of course. However the change did not take effect and the unit still had his default weapon in his loadout.
So you changed the weapons in the odf but no changes were visible? If so, try going into the LUA of the era your changing the units in, and look for this area,
Hidden/Spoiler:
[code] ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper",
"rep_hover_fightertank",
"rep_hero_anakin",
"rep_hover_barcspeeder")
ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"cis_inf_sniper",
"cis_inf_officer",
"cis_inf_droideka",
"cis_hero_darthmaul",
"cis_hover_aat")[/code]
Where it says ReadDataFile("SIDE\\rep.lvl",
Change it so it looks like this -
ReadDataFile("dc:SIDE\\rep.lvl",
(add a "dc:" right before "SIDE")
KolSkywalker
Recruit Womprat Killer
Posts: 10
Joined: Tue Jan 17, 2017 5:12 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: Changing equipments through the ODF files

Post by KolSkywalker »

SkinnyODST wrote:So you changed the weapons in the odf but no changes were visible? If so, try going into the LUA of the era your changing the units in, and look for this area,
Hidden/Spoiler:
[code] ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper",
"rep_hover_fightertank",
"rep_hero_anakin",
"rep_hover_barcspeeder")
ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"cis_inf_sniper",
"cis_inf_officer",
"cis_inf_droideka",
"cis_hero_darthmaul",
"cis_hover_aat")[/code]
Where it says ReadDataFile("SIDE\\rep.lvl",
Change it so it looks like this -
ReadDataFile("dc:SIDE\\rep.lvl",
(add a "dc:" right before "SIDE")
Alright, I will try that. Thanks for the help you're giving, mate. :)

One more question, though. When copying the stock rep side into my mod folder, do I have to copy all the folders (effects, msh, munged, odf, req), or will copying just the odf into my custom rep side work?
ARCTroopaNate
Jedi
Jedi
Posts: 1161
Joined: Mon Mar 21, 2011 8:12 pm
Projects :: Star Wars Battlefront - Tides of War
Games I'm Playing :: SWBF2 RC EAW
xbox live or psn: I have ps4
Location: STALKER!
Contact:

Re: Changing equipments through the ODF files

Post by ARCTroopaNate »

You need both the req. folder (which contains individual .req files) and the .req file in the main rep folder. msh folder contains the textures and models so those will be needed, munged has animations which you need for jedi and some vehicles, and effects has stuff like the jettrooper jet effect and the mace groundslam attack effect. I'd copy everything for now as a beginner but when you get a little more experience it really saves a massive amount of space to build up your side files from scratch, only using what you need.
SkinnyODST
Lieutenant Colonel
Lieutenant Colonel
Posts: 545
Joined: Mon Jul 04, 2016 10:56 pm
Location: My other account
Contact:

Re: Changing equipments through the ODF files

Post by SkinnyODST »

Alright, I will try that. Thanks for the help you're giving, mate. :)
No problem, always happy to help where I can!
One more question, though. When copying the stock rep side into my mod folder, do I have to copy all the folders (effects, msh, munged, odf, req), or will copying just the odf into my custom rep side work?
In short, EVERYTHING in the rep folder is needed for the sides to work, ARCTroopaNate gave you details into what each folder contains and what its used for, so yeah, copy over all of it until you become a skilled enough force user-I mean mod creator :D
KolSkywalker
Recruit Womprat Killer
Posts: 10
Joined: Tue Jan 17, 2017 5:12 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: Changing equipments through the ODF files

Post by KolSkywalker »

My thanks for all the help! :)
Post Reply