Part 21. Having more than 6 Classes
So you want more unit classes, eh? Okay, so now you’ll learn how.
There are 2 ways to do this: Using the Setup Teams function, and using te AddUnitClass function. I never got the addunitclass thing to work, so we’ll go with the other one. I’ll tell you how to add up to 8 units.
So, first go to data_MAP/common/scripts. There are lots of different scripts in here.
Go find the script titled “setup_teams”. Open it.
Go find this part in the script:
local typeList = { "soldier", "pilot", "assault", "sniper", "marine", "engineer", "officer", "special" }
That lists the kind of units there are. There are 2 ones not being used here – pilot and marine.
Okay, let’s rename those. Rename pilot to “commander” and rename marine to “stealth”. Now, for the moment, these units will be the exact same as 2 other units in the game, but different skins. That’s okay for now. To change that, you would change the name of the daddy (remember him?), then go make your own daddy.
Now, go to your lua, and down to the loading part:
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")
We are going to add in the (your character here) and the (your character here). So, add them to the reading list:
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",
“rep_inf_ep2_rocketeer”,
“rep_inf_ep2_sniper”)
Now down to this part:
SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_ep3_rifleman",9, 25},
assault = { "rep_inf_ep3_rocketeer",1, 4},
engineer = { "rep_inf_ep3_engineer",1, 4},
sniper = { "rep_inf_ep3_sniper",1, 4},
officer = {"rep_inf_ep3_officer",1, 4},
special = { "rep_inf_ep3_jettrooper",1, 4},
},
cis = {
team = CIS,
units = 20,
reinforcements = 150,
soldier = { "cis_inf_rifleman",9, 25},
assault = { "cis_inf_rocketeer",1, 4},
engineer = { "cis_inf_engineer",1, 4},
sniper = { "cis_inf_sniper",1, 4},
officer = {"cis_inf_officer",1, 4},
special = { "cis_inf_droideka",1, 4},
I hope you are getting used to it down here!
So, let’s add a couple more classes.
Add this onto the Republic Setup Teams:
commander = {"your character here ",1, 4},
stealth = { "your character here",1, 4},
That will add those 2 classes into the game!
SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_ep3_rifleman",9, 25},
assault = { "rep_inf_ep3_rocketeer",1, 4},
engineer = { "rep_inf_ep3_engineer",1, 4},
sniper = { "rep_inf_ep3_sniper",1, 4},
officer = {"rep_inf_ep3_officer",1, 4},
special = { "rep_inf_ep3_jettrooper",1, 4},
commander = {"your character here",1, 4},
stealth = { "your character here",1, 4},