Page 1 of 1

New unit question

Posted: Thu Jan 24, 2008 7:16 am
by Silas
Let's say I wanted to use the ep2 heavy trooper AND ep3 heavy trooper in the same map, but with different weapons. I tried just copying the two odf's for the heavy trooper, renaming them, switching weapons, and putting them in the .lua. I can't get the unit to show up in the game. Here's my .lua and odf files. i called it the jungle commando
Hidden/Spoiler:
ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep2_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper_felucia",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper",
"rep_inf_ep2_junglecommando",
"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")


ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_laser",
"tur_bldg_tower")

SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_ep3_rifleman",9, 25},
assault = { "rep_inf_ep2_rocketeer",1, 4},
engineer = { "rep_inf_ep3_engineer",1, 4},
sniper = { "rep_inf_ep3_sniper_felucia",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},
}
}



AddUnitClass(REP, "rep_inf_ep2_junglecommando",1,4)
AddUnitClass(REP, "rep_inf_ep2_rifleman",1,4)
heres my odfs:
Hidden/Spoiler:
[GameObjectClass]
ClassParent = "rep_inf_default"

[Properties]
UnitType = "commando"

MaxHealth = 550.0

MaxSpeed = 8.0 // base forward speed
MaxStrafeSpeed = 4.5 // base right/left speed

WEAPONSECTION = 1
WeaponName = "rep_weap_inf_rifle"
WeaponAmmo = 5

WEAPONSECTION = 2
WeaponName = "rep_weap_inf_pistol"
WeaponAmmo = 0

WEAPONSECTION = 3
WeaponName = "rep_weap_inf_theremaldetonator"
WeaponAmmo = 4
WeaponChannel = 1

WEAPONSECTION = 4
WeaponName = "rep_weap_inf_mine_dispenser"
WeaponAmmo = 3
WeaponChannel = 1

WEAPONSECTION = 5
WeaponName = "rep_weap_award_rifle"
WeaponAmmo = 6

WEAPONSECTION = 6
WeaponName = "rep_weap_award_rocket_launcher"
WeaponAmmo = 4

VOUnitType = 121
Hidden/Spoiler:
[GameObjectClass]
ClassLabel = "soldier"
ClassParent = "rep_inf_default_junglecommando"

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

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

OverrideTexture = "rep_inf_arc_blue"
OverrideTexture2 = "rep_inf_arc_pack_blue"
anyone see my problem?

Re: New unit question

Posted: Thu Jan 24, 2008 8:17 am
by Grev
I dont think you should rename them. Try adding them into your .lua, and adding the ep2 heavy trooper with the add new class code. Its simple, I just dont remember it.

*Note, not code, its just a messsage that this is an extra dude.

Re: New unit question

Posted: Thu Jan 24, 2008 8:22 am
by TheDarkMask
Silas wrote: heres my odfs:
Hidden/Spoiler:
[GameObjectClass]
ClassParent = "rep_inf_default"

[Properties]
UnitType = "commando"

MaxHealth = 550.0

MaxSpeed = 8.0 // base forward speed
MaxStrafeSpeed = 4.5 // base right/left speed

WEAPONSECTION = 1
WeaponName = "rep_weap_inf_rifle"
WeaponAmmo = 5

WEAPONSECTION = 2
WeaponName = "rep_weap_inf_pistol"
WeaponAmmo = 0

WEAPONSECTION = 3
WeaponName = "rep_weap_inf_theremaldetonator"
WeaponAmmo = 4
WeaponChannel = 1

WEAPONSECTION = 4
WeaponName = "rep_weap_inf_mine_dispenser"
WeaponAmmo = 3
WeaponChannel = 1

WEAPONSECTION = 5
WeaponName = "rep_weap_award_rifle"
WeaponAmmo = 6

WEAPONSECTION = 6
WeaponName = "rep_weap_award_rocket_launcher"
WeaponAmmo = 4

VOUnitType = 121
change the rocketlauncher to rep_weap_inf_award_pistol

Then: do you have a .req file?

Re: New unit question

Posted: Thu Jan 24, 2008 11:20 am
by Caleb1117
Did you make req files for the new unit? and add him to the side req?

Re: New unit question

Posted: Thu Jan 24, 2008 4:41 pm
by Silas
Caleb1117 wrote:Did you make req files for the new unit? and add him to the side req?
um, no i did not make the req files. that would do it, wouldn't it? lol. can you teach me how?

also, im pretty sure that the awards thign doesnt matter. i've switched around weapons a lot without touching the awards

Re: New unit question

Posted: Thu Jan 24, 2008 4:42 pm
by NullCommando
Wait both heavy ep3 and ep2 with different weapons is what you want? If so it's simple.

What the..

Code: Select all

UnitType = "commando"
If Im not mistaken that Unit Type doesn't exist..

Re: New unit question

Posted: Thu Jan 24, 2008 5:22 pm
by Silas
originally, it was just as a way to add more units to the map (like 8 instead of 6). each unit has a class like scout, special, etc. apparently you can add/make your own. i went with commando.

edit: hmm...is there a guide anywhere to making new units? i can't find it if there is.

Re: New unit question

Posted: Fri Jan 25, 2008 11:05 am
by MercuryNoodles
As far as I know the unittypes are hardcoded, or so I would think. Never use anything other than the known values, as it designates the unit's AI type. They determine which set of AI behaviors are displayed by the unit, and which VOs get triggered by the other units.

The named unit slots in the lua are in no way related to anything in the game, outside of setting which unit shows in the selection screen, and the min/max values. It's purely for organizational purposes. For example, you could call for a pilot odf in the sniper slot, and not affect anything other than where the unit shows in the selection screen.