Page 1 of 1

Dark trooper not ingame [Solved]

Posted: Sun Feb 20, 2011 8:20 pm
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")

Re: Dark trooper not ingame

Posted: Sun Feb 20, 2011 8:26 pm
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?

Re: Dark trooper not ingame

Posted: Sun Feb 20, 2011 8:26 pm
by ACEwithSPADES
did u delete him from your imp .req anywhere?
darn AQT beat me

Re: Dark trooper not ingame

Posted: Sun Feb 20, 2011 8:31 pm
by acryptozoo
maybe post a bf2log ??

Re: Dark trooper not ingame

Posted: Sun Feb 20, 2011 10:19 pm
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

Re: Dark trooper not ingame

Posted: Sun Feb 20, 2011 10:56 pm
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?

Re: Dark trooper not ingame

Posted: Mon Feb 21, 2011 12:13 am
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

Re: Dark trooper not ingame

Posted: Mon Feb 21, 2011 10:27 am
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
   

Re: Dark trooper not ingame

Posted: Mon Feb 21, 2011 11:48 am
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

Re: Dark trooper not ingame

Posted: Mon Feb 21, 2011 2:05 pm
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:

Re: Dark trooper not ingame

Posted: Mon Feb 21, 2011 11:44 pm
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")

Re: Dark trooper not ingame

Posted: Tue Feb 22, 2011 12:58 am
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

Re: Dark trooper not ingame

Posted: Fri Feb 25, 2011 11:26 pm
by modmaster13
Thanks guys! :thumbs: