New unit question

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
User avatar
Silas
Captain
Captain
Posts: 481
Joined: Thu Oct 11, 2007 5:30 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Contact:

New unit question

Post 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?
Grev
Hoth Battle Chief
Hoth Battle Chief
Posts: 3132
Joined: Sun Dec 09, 2007 11:45 pm
Projects :: No Mod project currently.
Games I'm Playing :: Minecraft
Location: A Certain Box Canyon

Re: New unit question

Post 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.
User avatar
TheDarkMask
Captain
Captain
Posts: 499
Joined: Sat Apr 07, 2007 4:26 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Germany-Bremen
Contact:

Re: New unit question

Post 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?
Caleb1117
2008 Most Original Avatar
Posts: 3096
Joined: Sun Aug 20, 2006 5:55 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: X-Fire: caleb1117 ಠ_ಠ

Re: New unit question

Post by Caleb1117 »

Did you make req files for the new unit? and add him to the side req?
User avatar
Silas
Captain
Captain
Posts: 481
Joined: Thu Oct 11, 2007 5:30 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Contact:

Re: New unit question

Post 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
NullCommando
Jedi
Jedi
Posts: 1010
Joined: Sat Dec 01, 2007 12:29 pm
Games I'm Playing :: Destiny
xbox live or psn: NullCommando
Location: Earth

Re: New unit question

Post 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..
User avatar
Silas
Captain
Captain
Posts: 481
Joined: Thu Oct 11, 2007 5:30 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Contact:

Re: New unit question

Post 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.
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Re: New unit question

Post 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.
Post Reply