Page 1 of 1

Changing equipments through the ODF files [Solved]

Posted: Fri Jan 20, 2017 6:08 pm
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?

Re: Changing equipments through the ODF files

Posted: Fri Jan 20, 2017 7:43 pm
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:

Re: Changing equipments through the ODF files

Posted: Fri Jan 20, 2017 9:12 pm
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()

Re: Changing equipments through the ODF files

Posted: Fri Jan 20, 2017 10:03 pm
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

Re: Changing equipments through the ODF files

Posted: Sat Jan 21, 2017 5:17 pm
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.

Re: Changing equipments through the ODF files

Posted: Sun Jan 22, 2017 11:07 pm
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")

Re: Changing equipments through the ODF files

Posted: Wed Jan 25, 2017 4:07 pm
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?

Re: Changing equipments through the ODF files

Posted: Wed Jan 25, 2017 5:12 pm
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.

Re: Changing equipments through the ODF files

Posted: Wed Jan 25, 2017 10:33 pm
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

Re: Changing equipments through the ODF files

Posted: Thu Jan 26, 2017 3:06 am
by KolSkywalker
My thanks for all the help! :)