Page 1 of 1

Change the order of units [Solved]

Posted: Sat Jul 02, 2011 11:16 pm
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.

Re: Change the order of units

Posted: Sun Jul 03, 2011 2:45 am
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.

Re: Change the order of units

Posted: Sun Jul 03, 2011 6:05 am
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

Re: Change the order of units

Posted: Sun Jul 03, 2011 11:51 am
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)

Re: Change the order of units

Posted: Sun Jul 03, 2011 12:05 pm
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},

Re: Change the order of units

Posted: Sun Jul 03, 2011 4:13 pm
by Noobasaurus
Oh...well that's a simple fix. :lol:

Thanks for the help! :)