Change the order of units [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
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Change the order of units [Solved]

Post by Noobasaurus »

How do I change the order of the units? It doesn't seem to be the lua that does this, nor the points to unlock, so what could it be?
Hidden/Spoiler:
I want my pole clone in front of my special ops clone.
Last edited by Noobasaurus on Sun Jul 03, 2011 4:33 pm, edited 1 time in total.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Change the order of units

Post by AQT »

Noobasaurus wrote:It doesn't seem to be the lua that does this
It is the .lua that does this.
setup_teams.lua wrote:

Code: Select all

    local typeList = { "soldier", "pilot", "assault", "sniper", "marine", "engineer", "officer", "special" }
The positions will always be in that order. Any additional AddUnitClass functions will follow consecutively in order.
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: Change the order of units

Post by Jendo7 »

You can change the number of points to unlock a unit by either using the SetClassProperty function in the .lua, for example:

Code: Select all

ReadDataFile("dc:SIDE\\rep.lvl",
                             "rep_inf_ep3_officer")

SetClassProperty("rep_inf_ep3_officer", "PointsToUnlock", 16)
or alternatively put it in the default units .odf under Properties:

Code: Select all

[Properties]
PointsToUnlock      = 16
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Change the order of units

Post by Noobasaurus »

AQT wrote:
Noobasaurus wrote:It doesn't seem to be the lua that does this
It is the .lua that does this.
setup_teams.lua wrote:

Code: Select all

 local typeList = { "soldier", "pilot", "assault", "sniper", "marine", "engineer", "officer", "special" }
The positions will always be in that order. Any additional AddUnitClass functions will follow consecutively in order.
Well, the thing is, I set the pilot after special and marine after pilot, and it works for the CIS but for the republic the pilot is in front of the special.

Pilot's odf:
Hidden/Spoiler:
[GameObjectClass]
ClassLabel = "soldier"
ClassParent = "rep_inf_default_rocketeer_ep"

[Properties]
UnitType = "pilot"
IconTexture = "rep_gunner_icon"

GeometryName = "rep_inf_arctrooper"
FirstPerson = "REP\reparc;rep_1st_arctrooper"
GeometryLowRes = "rep_inf_arctrooper_low1"
ClothODF = "rep_inf_arctrooper_cape"

MaxHealth = 450.0

OverrideTexture = "rep_inf_arc_blue"
OverrideTexture2 = "rep_inf_arc_pack_blue"


WEAPONSECTION = 1
WeaponName1 = "comstaf"
WeaponAmmo1 = 0
and the marine's odf:
Hidden/Spoiler:
[GameObjectClass]
ClassParent = "rep_inf_default_spec"

[Properties]
Label = "Arc Trooper"
UnitType = "marine"
IconTexture = "rep_htrooper_icon"

GeometryName = "rep_inf_jettrooper"
GeometryLowRes = "rep_inf_jettrooper_low1"
FirstPerson = "REP\repjettp;rep_1st_jettrooper"
Not sure if you wanted these or the default ones.
Jendo7 wrote:You can change the number of points to unlock a unit by either using the SetClassProperty function in the .lua, for example:

Code: Select all

ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_ep3_officer")

SetClassProperty("rep_inf_ep3_officer", "PointsToUnlock", 16)
or alternatively put it in the default units .odf under Properties:

Code: Select all

[Properties]
PointsToUnlock = 16
Well, thanks, now I know another way to set points to unlock, but my question was how to change the order of the units. (Ex. Engineer in front of solider)
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Change the order of units

Post by THEWULFMAN »

The name of the "class" type has nothing to do with how a unit behaves, so you can just change the order of which they are in. For example,if you want the engineer in front of the soldier, simpley change the lua from
Hidden/Spoiler:
soldier = { "all_inf_rifleman",9, 25},
assault = { "all_inf_rocketeer",1,4},
engineer = { "all_inf_engineer",1,4},

sniper = { "all_inf_sniper",1,4},
officer = { "all_inf_officer",1,4},
special = { "all_inf_wookiee",1,4},
To this
Hidden/Spoiler:
soldier = { "all_inf_engineer",9, 25},
assault = { "all_inf_rifleman",1,4},
engineer = { "all_inf_rocketeer",1,4},

sniper = { "all_inf_sniper",1,4},
officer = { "all_inf_officer",1,4},
special = { "all_inf_wookiee",1,4},
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Change the order of units

Post by Noobasaurus »

Oh...well that's a simple fix. :lol:

Thanks for the help! :)
Post Reply