Custom Unit Problem

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
ARCTroopaNate
Jedi
Jedi
Posts: 1161
Joined: Mon Mar 21, 2011 8:12 pm
Projects :: Star Wars Battlefront - Tides of War
Games I'm Playing :: SWBF2 RC EAW
xbox live or psn: I have ps4
Location: STALKER!
Contact:

Custom Unit Problem

Post by ARCTroopaNate »

I've been working on a project with custom sides and everything was going fine and dandy, I was adding my eighth Rebel Unit, I create him, go through the motions of creating a custom unit and go to play. Boom, a crash. Since then I have clean munged and manual cleaned. I took out the unit and everything worked fine. With him ingame, it's not working at all, it crashes after loading. I have no clue why this is not working, there are no sev 3 errors in my log. Please help.

kas2b_con
Hidden/Spoiler:
ReadDataFile("sound\\kas.lvl;kas2gcw")
ReadDataFile("dc:SIDE\\all.lvl",
"all_inf_rifleman_fleet",
"all_inf_rocketeer_fleet",
"all_inf_sniper_fleet",
"all_inf_wookiee_fleet",
"all_inf_assault_fleet",
"all_inf_smuggler_fleet",
"all_inf_pilot")
ReadDataFile("SIDE\\all.lvl",
"all_hover_combatspeeder",
"all_hero_chewbacca")
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_dark_trooper",
"imp_hover_fightertank",
"imp_hover_speederbike",
"imp_inf_officer",
--"imp_walk_atst",
"imp_hero_bobafett")
ReadDataFile("SIDE\\wok.lvl",
"wok_inf_basic")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_beam",
"tur_bldg_recoilless_kas")


SetupTeams{

all={
team = ALL,
units = 29,
reinforcements = 150,
soldier = {"all_inf_rifleman_fleet",10, 25},
heavy = {"all_inf_rocketeer_fleet",1, 4},
pilot = {"all_inf_pilot",1, 4},
sniper = {"all_inf_sniper_fleet",1, 4},
assault = {"all_inf_assault_fleet",1, 4},
special = {"all_inf_wookiee_fleet",1, 4},
custom = {"all_inf_smuggler_fleet",1, 4},

},

imp={
team = IMP,
units = 29,
reinforcements = 150,
soldier = {"imp_inf_rifleman",10, 25},
heavy = {"imp_inf_rocketeer",1, 4},
pilot = {"imp_inf_engineer",1, 4},
sniper = {"imp_inf_sniper",1, 4},
assault = {"imp_inf_officer",1, 4},
special = {"imp_inf_dark_trooper",1, 4},
}
}

-- Alliance Stats
SetHeroClass(ALL, "all_hero_chewbacca")

-- Imperial Stats
SetHeroClass(IMP, "imp_hero_bobafett")
Unit req
Hidden/Spoiler:
ucft
{
REQN
{
"class"
"all_inf_smuggler_fleet"
}
}
Side req
Hidden/Spoiler:
ucft
{
REQN
{
"lvl"
"all_inf_assault_fleet"
"all_inf_elite_fleet"
"all_inf_pilot"
"all_inf_rifleman_fleet"
"all_inf_rocketeer_fleet"
"all_inf_smuggler_fleet"
"all_inf_sniper_fleet"
"all_inf_wookiee_fleet"
}
}
Unit odf
Hidden/Spoiler:
[GameObjectClass]
ClassParent = "all_inf_default_smuggler"
GeometryName = "all_inf_stormtrooperhansolo.msh"

[Properties]
GeometryName = "all_inf_stormtrooperhansolo"
GeometryLowRes = "all_inf_stormtrooperhansolo_low1"
FirstPerson = "all\allhstrm;all_1st_stormtrooper"
Parent odf
Hidden/Spoiler:
[GameObjectClass]
ClassParent = "all_inf_default"


[Properties]
MaxSpeed = "8.0"
MaxStrafeSpeed = "6.0"
UnitType = "pilot"

WEAPONSECTION = 1
WeaponName = "all_weap_inf_elite_pistol"
WeaponAmmo = 0

WEAPONSECTION = 2
WeaponName = "all_weap_inf_invisibility"
WeaponAmmo = 0

WEAPONSECTION = 3
WeaponName = "all_weap_inf_fusioncutter"
WeaponAmmo = 1

WEAPONSECTION = 5
WeaponName = "all_weap_inf_powerup_dispenser"
WeaponAmmo = 5
WeaponChannel = 1

VOUnitType = 1
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Custom Unit Problem

Post by Marth8880 »

kas2b_con.lua wrote:custom = {"all_inf_smuggler_fleet",1, 4},
This. You can't just make up class types; you have to use a class type that already exists in the setup_teams script. For example, you'd open up setup_teams.lua and add the desired class to typeList.

Here's my mod's setup_teams script for a reference.
setup_teams.lua wrote:-- list of types
local typeList = { "soldier", "assault", "sniper", "engineer", "adept", "sentinel", "vanguard", "shock", "destroyer", "prime", "support", "scion" }
Or, alternatively, you could just go with AddUnitClass(), like such:

Code: Select all

AddUnitClass(teamID, "all_inf_smuggler_fleet",1, 4)
ARCTroopaNate
Jedi
Jedi
Posts: 1161
Joined: Mon Mar 21, 2011 8:12 pm
Projects :: Star Wars Battlefront - Tides of War
Games I'm Playing :: SWBF2 RC EAW
xbox live or psn: I have ps4
Location: STALKER!
Contact:

Re: Custom Unit Problem

Post by ARCTroopaNate »

It's in the setup teams function, I used it for other sides for this mod as well.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Custom Unit Problem

Post by lucasfart »

Have you tried adding

Code: Select all

custom = {"",1, 4},
to the other side? If your setup teams is looking for a class named custom and it isn't defined for one side, it could be crashing your map.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Custom Unit Problem

Post by AQT »

That is false.
Hidden/Spoiler:
[quote="hot1g_hunt.lua"][code] SetupTeams{

all={
team = ALL,
units = 32,
reinforcements = -1,
soldier = {"all_inf_rifleman_snow"},
assault = {"all_inf_rocketeer_snow"},
engineer = {"all_inf_engineer_snow"},
sniper = {"all_inf_sniper_snow"},
officer = {"all_inf_officer_snow"},
special = {"all_inf_wookiee_snow"},

},

wampa={
team = IMP,
units = 32,
reinforcements = -1,
soldier = {"snw_inf_wampa", 8},
}
}[/code][/quote]
Doing that is unnecessary. If anything, it forces the game to look for a nonexistent unit.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: Custom Unit Problem

Post by lucasfart »

Really? Oops. Ignore my post then. :?
Post Reply