How To: Add Unit Classes by the ODF files

Started by Led, January 03, 2012, 12:29:33 PM

Previous topic - Next topic
January 03, 2012, 12:29:33 PM Last Edit: January 03, 2012, 12:31:51 PM by Buckler
This is a WIP tutorial.  If anyone knows of a better one, please let me know.
If anyone finds errors, please let me know.



Unit types are organized by class, e.g. basic infantry for CIS is sniper, pilot, rocket, etc.


Example:  We want to and a jetdroid class with multiple jet units.


-you will need the jetdroid ODF files and associated weapon files.
see this post:  http://www.swbfgamers.com/index.php?topic=4073.msg41439#msg41439


-in the root of the CIS side folder, modify the CIS.REQ file to include the cis_inf_jetdroid class:


ucft
{
REQN
{
"lvl"
"cis_inf_basic"
"cis_inf_basic_battledroids"
"cis_inf_countdooku"
"cis_inf_droideka"
                "cis_inf_jetdroid"
"cis_tread_hailfire"
}
}



-inside the CIS REQ folder, edit the cis_inf_jetdroid.req file that defines  the elements of the class.  Each unit will have its own line.  Here, there is jetdroid and jetdroid1 units.


ucft
{
REQN
{
"class"
"cis_inf_jetdroid"   
    "cis_inf_jetdroid1"
}
}




-in the ODF folder, make your units called cis_inf_jetdroid and cis_inf_jetdroid1, etc.
note that the items defined in the ODF must exist and be in the right spots.  See ODF tutorials for more information about this.


-in your map LUA file, load  the class using this line (note, the location will change depending on where your side is at):


ReadDataFile("SWBFgamersUpdate1.0\\sides\\11-SleepKiller\\jetdroid\\side\\cis.lvl",
   "cis_inf_jetdroid");


this loads all the units in the jetdroid class


and, also in the lua, load the particular unit (in this case, jetdroid1)
by this line
--  CIS Stats
    SetTeamName(CIS, "CIS");
    SetTeamIcon(CIS, "cis_icon");
    AddUnitClass(CIS, "cis_inf_battledroid",11)
    AddUnitClass(CIS, "cis_inf_assault",3)
    AddUnitClass(CIS, "cis_inf_pilotdroid",4)
    AddUnitClass(CIS, "cis_inf_assassindroid",4)
    AddUnitClass(CIS, "cis_inf_jetdroid1",3)
    SetHeroClass(CIS, "cis_inf_countdooku")


































Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet