Page 1 of 1

Adding units to space

Posted: Sat Jul 30, 2011 11:36 pm
by 1FGR1NightGhost
Ok, this is the script function i copied from a hero assault and added to my map
Hidden/Spoiler:
myTeamConfig = {
all = {
team = ALL,
units = 32,
reinforcements = -1,
pilot = { "reb_inf_pilot",26},
marine = { "reb_inf_marine",6},
},
}

AddUnitClass(ALL,"reb_inf_defense", 1,2)
AddUnitClass(ALL,"reb_inf_officer_space", 1,2)

imp = {
team = IMP,
units = 32,
reinforcements = -1,
pilot = { "sto_inf_pilot",26},
marine = { "sto_inf_marine",6},
},
}

AddUnitClass(IMP,"sto_inf_defense", 1,2)
AddUnitClass(IMP,"sto_inf_officer_space", 1,2)
And when i munge i get that stupid "expecting Bracket" crap that makes my map crash/freeze/ load a blank map

Does anyone know my problem?

Re: Adding units to space

Posted: Sat Jul 30, 2011 11:49 pm
by Darth_Spiderpig
You're missing a bracket somewhere, as the crap says.

Re: Adding units to space

Posted: Sat Jul 30, 2011 11:59 pm
by AceMastermind
When asking for help you should always post the exact errors you get when you encounter crashes. You only posted a snippet of your LUA so is the missing bracket error the only one? It looks like you're copying and pasting code without regard as to whether it works or not. :?

Try this instead:
myTeamConfig = {
all = {
team = ALL,
units = 32,
reinforcements = -1,
pilot = { "reb_inf_pilot",26},
marine = { "reb_inf_marine",6},
},

imp = {
team = IMP,
units = 32,
reinforcements = -1,
pilot = { "sto_inf_pilot",26},
marine = { "sto_inf_marine",6},
}
}

AddUnitClass(IMP,"sto_inf_defense", 1,2)
AddUnitClass(IMP,"sto_inf_officer_space", 1,2)
AddUnitClass(ALL,"reb_inf_defense", 1,2)
AddUnitClass(ALL,"reb_inf_officer_space", 1,2)
Brackets will always be paired up, 1 open and 1 close bracket. If you see an odd number of brackets in a block then something is wrong.
You should use a code editor that has syntax highlighting when editing LUA files so you can instantly identify these typos. Also, when you get munge errors there is no need to play your map, it didn't munge correctly and is therefore broken; munge errors must be fixed first.

Re: Adding units to space

Posted: Sun Jul 31, 2011 2:22 pm
by 1FGR1NightGhost
Thx, that script fixed the munge error problem, but failed to add the additional gaurds and commanders....

Re: Adding units to space

Posted: Sun Jul 31, 2011 2:36 pm
by AceMastermind
1FGR1NightGhost wrote:...that script ... failed to add the additional gaurds and commanders...
You only posted part of your script and you didn't provide enough details of what you've done so far, you get what you put into it. Did you actually load these new units in the ReadDataFile section? There are standard procedures for adding new units and it sounds like you didn't follow the process correctly.

Re: Adding units to space

Posted: Sun Jul 31, 2011 10:37 pm
by 1FGR1NightGhost
sorry for that...

but if you want the whole crap load of info here it is:
Hidden/Spoiler:
function SetupUnits()
ReadDataFile("SIDE\\all.lvl",
"all_fly_xwing_sc",
"all_fly_ywing_sc",
"all_fly_awing",
"all_fly_gunship_sc",
"all_veh_remote_terminal")

ReadDataFile("SIDE\\reb.lvl",
"reb_inf_pilot",
"reb_inf_defense_urban",
"reb_inf_marine",
"reb_inf_officer_space",
"all_fly_kwing",
"reb_fly_bwing",
"reb_fly_tierouge")

ReadDataFile("SIDE\\imp.lvl",
"imp_fly_tiefighter_sc",
"imp_fly_tiebomber_sc",
"imp_fly_tieinterceptor",
"imp_fly_trooptrans",
"imp_veh_remote_terminal")

ReadDataFile("SIDE\\sto.lvl",
"sto_inf_pilot",
"sto_inf_defense",
"sto_inf_marine",
"sto_inf_officer_space",
"sto_fly_tiedefender",
"sto_fly_tiestriker")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_spa_all_beam",
"tur_bldg_spa_all_recoilless",
"tur_bldg_spa_all_chaingun",
"tur_bldg_spa_imp_beam",
"tur_bldg_spa_imp_recoilless",
"tur_bldg_spa_imp_chaingun",
"tur_bldg_chaingun_roof" )
end

myTeamConfig = {
all = {
team = ALL,
units = 32,
reinforcements = -1,
pilot = { "reb_inf_pilot",26},
marine = { "reb_inf_marine",6},
},

imp = {
team = IMP,
units = 32,
reinforcements = -1,
pilot = { "sto_inf_pilot",26},
marine = { "sto_inf_marine",6},
}
}

AddUnitClass(IMP,"sto_inf_defense", 1,2)
AddUnitClass(IMP,"sto_inf_officer_space", 1,2)
AddUnitClass(ALL,"reb_inf_defense_urban", 1,2)
AddUnitClass(ALL,"reb_inf_officer_space", 1,2)

Re: Adding units to space

Posted: Mon Aug 01, 2011 12:22 am
by AceMastermind
1FGR1NightGhost wrote:...
...

ReadDataFile("SIDE\\reb.lvl",
"reb_inf_pilot",
"reb_inf_defense_urban",
"reb_inf_marine",
"reb_inf_officer_space",
"all_fly_kwing",
"reb_fly_bwing",
"reb_fly_tierouge")

...
...
...

ReadDataFile("SIDE\\sto.lvl",
"sto_inf_pilot",
"sto_inf_defense",
"sto_inf_marine",
"sto_inf_officer_space",
"sto_fly_tiedefender",
"sto_fly_tiestriker")

...
...
There are no stock sto or reb side lvls; you are trying to add custom sides and therefore need to follow the procedure in THIS thread.

Re: Adding units to space

Posted: Mon Aug 01, 2011 12:42 am
by 1FGR1NightGhost
AceMastermind wrote:There are no stock sto or reb side lvls; you are trying to add custom sides and therefore need to follow the procedure in THIS thread.
I know, i placed the sides in the DEFAULT lvl PC folder (along with rep, cis, and imp) so i know its not that because it has no problem reading the Imperial Pilot, Rebel Pilot, Imperial Marine, or K-wing (rebel marine and TIE Rouge havent been made yet, and the 2 new TIEs are riddled with problems unrelated to the scripts...)


I think ill just stick to the pilot and marine, thx for the help though...

Re: Adding units to space

Posted: Mon Aug 01, 2011 1:24 am
by AceMastermind
1FGR1NightGhost wrote:...i placed the sides in the DEFAULT lvl PC folder (along with rep, cis, and imp)...
That kind of information should've been included in your first post.

If you moved the custom side lvls to the game's DATA\_LVL_PC\SIDE folder and the units still don't show up ingame then there is a problem with how you set up those sides to begin with, maybe a typo in the req etc. You should play your map and generate a BFront2.log to see if any suspicious errors come up.

Re: Adding units to space

Posted: Mon Aug 01, 2011 10:14 am
by 1FGR1NightGhost
AceMastermind wrote:
1FGR1NightGhost wrote:...i placed the sides in the DEFAULT lvl PC folder (along with rep, cis, and imp)...
That kind of information should've been included in your first post.

If you moved the custom side lvls to the game's DATA\_LVL_PC\SIDE folder and the units still don't show up ingame then there is a problem with how you set up those sides to begin with, maybe a typo in the req etc. You should play your map and generate a BFront2.log to see if any suspicious errors come up.
Sorry if i left that part out

Its not the sides, cus i know the units work (cus they all work on ground maps and test map) and if it werent reading the side, then why would the pilots, imp marine and K-wing all still show up?

Re: Adding units to space

Posted: Mon Aug 01, 2011 10:37 am
by DarthD.U.C.K.
please make a bfron2log and post it here. you always have to give us as much information as you can in your first post already so that helpthreads dont get unnecessarily lengthy.
so do the units that dont appear in the spacemap appear in the groundmaps?
you should fit the number of the individual units to the number of all units, right now you have 32 units per side with pilot and marine already taking up 32. since they dont have a minimumnumber they might simply take up all slots and prevent the other units from spawning.

Re: Adding units to space

Posted: Mon Aug 01, 2011 1:07 pm
by 1FGR1NightGhost
@Darth D.U.C.K. wouldnt that just make AI not spawn as gaurds or ship commanders?


And, as i now realized i have failed to state, my problem is that i cant get THE ADDITIONAL 2 (added) units to appear, and i know it is not the units themselves because they work on ground maps, and when i rotate them in the scripts with the pilot or marine

Re: Adding units to space

Posted: Mon Aug 01, 2011 6:54 pm
by AceMastermind
1FGR1NightGhost wrote:...i know it is not the units themselves because they work on ground maps, and when i rotate them in the scripts with the pilot or marine
You can also use these to include additional units instead of AddUnitClass:
soldier
assault
sniper
engineer
officer
special


Also,
You should play your map and generate a BFront2.log to see if any suspicious errors come up.