Dark trooper not ingame [Solved]

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
modmaster13
General
General
Posts: 777
Joined: Wed Aug 18, 2010 4:23 pm
Games I'm Playing :: COD SWBF
xbox live or psn: KrypticcElementt
Location: Twitter @_KrypticElement
Contact:

Dark trooper not ingame [Solved]

Post by modmaster13 »

Uh...I can't seem to play as the dark trooper ingame. I double checked my lua, and I can't find any mistakes. Here is my setup teams:
Hidden/Spoiler:
ReadDataFile("sound\\nab.lvl;nab2gcw")
ReadDataFile("dc:SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_engineer",
"all_inf_sniper",
"all_inf_officer",
"all_inf_wookiee",
"all_inf_pilot",
"all_inf_marine",
"all_hover_combatspeeder")



ReadDataFile("dc:SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_dark_trooper",
"imp_inf_marine",
"imp_inf_pilot",
"imp_hero_emperor",
"imp_hover_fightertank")

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

ReadDataFile("SIDE\\gar.lvl",
"gar_inf_naboo_queen")



-- ReadDataFile("SIDE\\gar.lvl",
-- "gar_inf_soldier",
-- "gar_inf_naboo_queen",
-- "gar_inf_vanguard")





-- set up teams
SetupTeams{
all={
team = ALL,
units = 19,
reinforcements = 150,
soldier = {"all_inf_rifleman",9, 25},
assault = {"all_inf_rocketeer",1, 4},
engineer = {"all_inf_engineer",1, 4},
sniper = {"all_inf_sniper",1, 4},
officer = {"all_inf_officer",1, 4},
special = {"all_inf_wookiee",1, 4},
pilot = {"all_inf_pilot",1, 4},
marine = {"all_inf_marine",1, 4},

},

imp={
team = IMP,
units = 19,
reinforcements = 150,
soldier = {"imp_inf_rifleman",9, 25},
assault = {"imp_inf_rocketeer",1, 4},
engineer = {"imp_inf_engineer",1, 4},
sniper = {"imp_inf_sniper",1, 4},
officer = {"imp_inf_officer",1, 4},
special = {"imp_inf_dark_trooper",1, 4},
pilot = {"imp_inf_pilot",1, 4},
special = {"imp_inf_marine",1, 4},
}
}

-- SetupTeams{
-- gar = {
-- team = GAR,
-- units = 5,
-- reinforcements = -1,
-- soldier = { "gar_inf_soldier",6},
-- assault = { "gar_inf_vanguard",5},
-- }
-- }



SetHeroClass(ALL, "gar_inf_naboo_queen")

SetHeroClass(IMP, "imp_hero_emperor")
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Dark trooper not ingame

Post by AQT »

Does the Dark Trooper not show up or something? What does your imp.req file look like? Is "imp_inf_dark_trooper" referenced in it? Does "imp_inf_dark_trooper" have its own REQ?
User avatar
ACEwithSPADES
Command Sergeant Major
Command Sergeant Major
Posts: 253
Joined: Thu Jan 20, 2011 3:49 pm
Projects :: Alzoc 3
Games I'm Playing :: Battlefront 2 MW2
xbox live or psn: xundyingxace
Location: Somewhere, but most likely where i am

Re: Dark trooper not ingame

Post by ACEwithSPADES »

did u delete him from your imp .req anywhere?
darn AQT beat me
User avatar
acryptozoo
Master Bounty Hunter
Master Bounty Hunter
Posts: 1642
Joined: Wed Jun 03, 2009 3:14 pm
Projects :: Yavin Mappack
Games I'm Playing :: Homeworld 2
xbox live or psn: acryptozoo
Location: in the jungles of Yavin IV
Contact:

Re: Dark trooper not ingame

Post by acryptozoo »

maybe post a bf2log ??
User avatar
ACEwithSPADES
Command Sergeant Major
Command Sergeant Major
Posts: 253
Joined: Thu Jan 20, 2011 3:49 pm
Projects :: Alzoc 3
Games I'm Playing :: Battlefront 2 MW2
xbox live or psn: xundyingxace
Location: Somewhere, but most likely where i am

Re: Dark trooper not ingame

Post by ACEwithSPADES »

i got it lol i didn't even look carefully enough, ok so the two specials won't work in the same category so the last special read by the game is the marine and so the dark trooper will get canceled out the best thing to do in this case is to add
AddUnitClass(IMP, "imp_inf_pilot", 1, 4)
AddUnitClass(IMP, "imp_inf_marine", 1, 4)
under
sniper = { "imp_inf_sniper",1, 4},
officer = {"imp_inf_officer",1, 4},
special = { "imp_inf_dark_trooper",1, 4},
}
}
that should work! :D
modmaster13
General
General
Posts: 777
Joined: Wed Aug 18, 2010 4:23 pm
Games I'm Playing :: COD SWBF
xbox live or psn: KrypticcElementt
Location: Twitter @_KrypticElement
Contact:

Re: Dark trooper not ingame

Post by modmaster13 »

ACEwithSPADES wrote:i got it lol i didn't even look carefully enough, ok so the two specials won't work in the same category so the last special read by the game is the marine and so the dark trooper will get canceled out the best thing to do in this case is to add
AddUnitClass(IMP, "imp_inf_pilot", 1, 4)
AddUnitClass(IMP, "imp_inf_marine", 1, 4)
under
sniper = { "imp_inf_sniper",1, 4},
officer = {"imp_inf_officer",1, 4},
special = { "imp_inf_dark_trooper",1, 4},
}
}
that should work! :D
Uh..............................what? :? Didn't I do that?
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Dark trooper not ingame

Post by THEWULFMAN »

modmaster13 wrote:
ACEwithSPADES wrote:i got it lol i didn't even look carefully enough, ok so the two specials won't work in the same category so the last special read by the game is the marine and so the dark trooper will get canceled out the best thing to do in this case is to add
AddUnitClass(IMP, "imp_inf_pilot", 1, 4)
AddUnitClass(IMP, "imp_inf_marine", 1, 4)
under
sniper = { "imp_inf_sniper",1, 4},
officer = {"imp_inf_officer",1, 4},
special = { "imp_inf_dark_trooper",1, 4},
}
}
that should work! :D
Uh..............................what? :? Didn't I do that?
no. Your trying to load the same type twice.
Like ACE said, do this intead,
AddUnitClass(IMP, "imp_inf_pilot", 1, 4)
AddUnitClass(IMP, "imp_inf_marine", 1, 4)


look at the mos eisly hero deathmatch script for a better idea
User avatar
ACEwithSPADES
Command Sergeant Major
Command Sergeant Major
Posts: 253
Joined: Thu Jan 20, 2011 3:49 pm
Projects :: Alzoc 3
Games I'm Playing :: Battlefront 2 MW2
xbox live or psn: xundyingxace
Location: Somewhere, but most likely where i am

Re: Dark trooper not ingame

Post by ACEwithSPADES »

here is an example from my lua that u can use as a reference

Code: Select all

SetupTeams{
		rep = {
			team = REP,
			units = 150,
			reinforcements = 350,
			soldier  = { "rep_inf_ep3_rifleman",9, 55},
			assault  = { "rep_inf_ep3_rocketeer",1, 54},
			engineer = { "rep_inf_ep3_engineer",1, 54},
			sniper   = { "rep_inf_ep3_sniper",1, 24},
			officer = {"rep_inf_ep3_officer",1, 15},
			special = { "rep_inf_ep3_jettrooper",1, 10},
	        
		},
		cis = {
			team = CIS,
			units = 150,
			reinforcements = 350,
			soldier  = { "cis_inf_rifleman",9, 55},
			assault  = { "cis_inf_rocketeer",1, 54},
			engineer = { "cis_inf_engineer",30, 54},
			sniper   = { "cis_inf_sniper",1, 24},
			officer = {"cis_inf_officer",1, 15},
			special = { "cis_inf_droideka",1, 4},
		},
	}
    AddUnitClass(REP, "rep_inf_skytrooper", 1, 10)-- <-----added unit to rep side under all the rest
    AddUnitClass(CIS, "cis_inf_jetdroid", 1, 10)-- <-------added unit to cis side under all the rest it does not matter what side you want to add to
   
modmaster13
General
General
Posts: 777
Joined: Wed Aug 18, 2010 4:23 pm
Games I'm Playing :: COD SWBF
xbox live or psn: KrypticcElementt
Location: Twitter @_KrypticElement
Contact:

Re: Dark trooper not ingame

Post by modmaster13 »

Like this?
Hidden/Spoiler:
-- set up teams
SetupTeams{
all={
team = ALL,
units = 19,
reinforcements = 150,
soldier = {"all_inf_rifleman",9, 25},
assault = {"all_inf_rocketeer",1, 4},
engineer = {"all_inf_engineer",1, 4},
sniper = {"all_inf_sniper",1, 4},
officer = {"all_inf_officer",1, 4},
special = {"all_inf_wookiee",1, 4},
pilot = {"all_inf_pilot",1, 4},
marine = {"all_inf_marine",1, 4},

},

imp={
team = IMP,
units = 19,
reinforcements = 150,
soldier = {"imp_inf_rifleman",9, 25},
assault = {"imp_inf_rocketeer",1, 4},
engineer = {"imp_inf_engineer",1, 4},
sniper = {"imp_inf_sniper",1, 4},
officer = {"imp_inf_officer",1, 4},
special = {"imp_inf_dark_trooper",1, 4},
}
}

AddUnitClass(IMP, imp_inf_pilot",1, 4)
AddUnitClass(IMP, imp_inf_marine",1, 4)

-- SetupTeams{
-- gar = {
-- team = GAR,
-- units = 5,
-- reinforcements = -1,
-- soldier = { "gar_inf_soldier",6},
-- assault = { "gar_inf_vanguard",5},
-- }
-- }



SetHeroClass(ALL, "gar_inf_naboo_queen")

SetHeroClass(IMP, "imp_hero_emperor")
I munged and it came up with an error log like this:
Hidden/Spoiler:
C:\BF2_ModTools\data_NBT\_BUILD\Common\..\..\..\ToolsFL\Bin\luac.exe: ..\..\common\scripts\NBT\NBTg_con.lua:163: unfinished string near `",1, 4)'
ERROR[scriptmunge scripts\NBT\NBTg_con.lua]:Could not read input file.ERROR[scriptmunge scripts\NBT\NBTg_con.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings

ERROR[levelpack mission\NBTg_con.req]:Expecting bracket, but none was found.
File : munged\pc\nbtg_con.script.req(1)...

ucft <--
ERROR[levelpack mission\NBTg_con.req]:Expecting bracket, but none was found.
File : munged\pc\nbtg_con.script.req(1)...

ucft <--

2 Errors 0 Warnings
User avatar
ACEwithSPADES
Command Sergeant Major
Command Sergeant Major
Posts: 253
Joined: Thu Jan 20, 2011 3:49 pm
Projects :: Alzoc 3
Games I'm Playing :: Battlefront 2 MW2
xbox live or psn: xundyingxace
Location: Somewhere, but most likely where i am

Re: Dark trooper not ingame

Post by ACEwithSPADES »

Try taking the pilot and the marine away from the first part of the script

Code: Select all

SetupTeams{
all={
team = ALL,
units = 19,
reinforcements = 150,
soldier = {"all_inf_rifleman",9, 25},
assault = {"all_inf_rocketeer",1, 4},
engineer = {"all_inf_engineer",1, 4},
sniper = {"all_inf_sniper",1, 4},
officer = {"all_inf_officer",1, 4},
special = {"all_inf_wookiee",1, 4},
},

imp={
team = IMP,
units = 19,
reinforcements = 150,
soldier = {"imp_inf_rifleman",9, 25},
assault = {"imp_inf_rocketeer",1, 4},
engineer = {"imp_inf_engineer",1, 4},
sniper = {"imp_inf_sniper",1, 4},
officer = {"imp_inf_officer",1, 4},
special = {"imp_inf_dark_trooper",1, 4},
},
}

AddUnitClass(IMP, "imp_inf_pilot",1, 4)
AddUnitClass(IMP, "imp_inf_marine",1, 4)
AddUnitClass(ALL, "all_inf_pilot",1, 4)
AddUnitClass(ALL, "all_inf_marine",1, 4)



EDIT: i forgot a comma after the first } after the darktrooper, this will also cause a crash sorry! :runaway:
Last edited by ACEwithSPADES on Tue Feb 22, 2011 8:04 am, edited 1 time in total.
modmaster13
General
General
Posts: 777
Joined: Wed Aug 18, 2010 4:23 pm
Games I'm Playing :: COD SWBF
xbox live or psn: KrypticcElementt
Location: Twitter @_KrypticElement
Contact:

Re: Dark trooper not ingame

Post by modmaster13 »

Sorry I am so late, but it still crashed. :(
Hidden/Spoiler:
C:\BF2_ModTools\data_NBT\_BUILD\Common\..\..\..\ToolsFL\Bin\luac.exe: ..\..\common\scripts\NBT\NBTg_con.lua:160: unfinished string near `",1, 4)'
ERROR[scriptmunge scripts\NBT\NBTg_con.lua]:Could not read input file.ERROR[scriptmunge scripts\NBT\NBTg_con.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings

ERROR[levelpack mission\NBTg_con.req]:Expecting bracket, but none was found.
File : munged\pc\nbtg_con.script.req(1)...

ucft <--
ERROR[levelpack mission\NBTg_con.req]:Expecting bracket, but none was found.
File : munged\pc\nbtg_con.script.req(1)...

ucft <--

2 Errors 0 Warnings
Hidden/Spoiler:
ReadDataFile("sound\\nab.lvl;nab2gcw")
ReadDataFile("dc:SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_engineer",
"all_inf_sniper",
"all_inf_officer",
"all_inf_wookiee",
"all_inf_pilot",
"all_inf_marine",
"all_hover_combatspeeder")



ReadDataFile("dc:SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_dark_trooper",
"imp_inf_marine",
"imp_inf_pilot",
"imp_hero_emperor",
"imp_hover_fightertank")

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

ReadDataFile("SIDE\\gar.lvl",
"gar_inf_naboo_queen")



-- ReadDataFile("SIDE\\gar.lvl",
-- "gar_inf_soldier",
-- "gar_inf_naboo_queen",
-- "gar_inf_vanguard")





-- set up teams
SetupTeams{
all={
team = ALL,
units = 19,
reinforcements = 150,
soldier = {"all_inf_rifleman",9, 25},
assault = {"all_inf_rocketeer",1, 4},
engineer = {"all_inf_engineer",1, 4},
sniper = {"all_inf_sniper",1, 4},
officer = {"all_inf_officer",1, 4},
special = {"all_inf_wookiee",1, 4},
},

imp={
team = IMP,
units = 19,
reinforcements = 150,
soldier = {"imp_inf_rifleman",9, 25},
assault = {"imp_inf_rocketeer",1, 4},
engineer = {"imp_inf_engineer",1, 4},
sniper = {"imp_inf_sniper",1, 4},
officer = {"imp_inf_officer",1, 4},
special = {"imp_inf_dark_trooper",1, 4},
},
}

AddUnitClass(IMP, imp_inf_pilot",1, 4)
AddUnitClass(IMP, imp_inf_marine",1, 4)
AddUnitClass(ALL, all_inf_pilot",1, 4)
AddUnitClass(ALL, all_inf_marine",1, 4)




-- SetupTeams{
-- gar = {
-- team = GAR,
-- units = 5,
-- reinforcements = -1,
-- soldier = { "gar_inf_soldier",6},
-- assault = { "gar_inf_vanguard",5},
-- }
-- }



SetHeroClass(ALL, "gar_inf_naboo_queen")

SetHeroClass(IMP, "imp_hero_emperor")
User avatar
AceMastermind
Gametoast Staff
Gametoast Staff
Posts: 3285
Joined: Mon Aug 21, 2006 6:23 am
Contact:

Re: Dark trooper not ingame

Post by AceMastermind »

Error:
... NBTg_con.lua:160: unfinished string near `",1, 4)' ...


LUA:
...
...
AddUnitClass(IMP, "imp_inf_pilot",1, 4)
AddUnitClass(IMP, "imp_inf_marine",1, 4)
AddUnitClass(ALL, "all_inf_pilot",1, 4)
AddUnitClass(ALL, "all_inf_marine",1, 4)
...
...


Learn to read and understand what the error logs are telling you.
The error is telling you what file has the error and which line number in the file the error was found at as well as what the problem likely is. You can edit these files with Notepad but it's best to use a code editor like NotePad++ for example since they have syntax highlighting that could help you identify mistakes such as missing brackets etc.

Also, instead of using AddUnitClass for the marine and pilot you could just use this in your SetupTeams section for example:
pilot = { "all_inf_pilot",1, 4},
marine = { "all_inf_marine",1, 4},

pilot and marine are already defined in the setup_teams.lua
modmaster13
General
General
Posts: 777
Joined: Wed Aug 18, 2010 4:23 pm
Games I'm Playing :: COD SWBF
xbox live or psn: KrypticcElementt
Location: Twitter @_KrypticElement
Contact:

Re: Dark trooper not ingame

Post by modmaster13 »

Thanks guys! :thumbs:
Post Reply