New Unit
Moderator: Moderators
-
TimberWolf
New Unit
Alright, I have a question that will, for once, be very easily answered. How do you make a new unit selectable on the spawn screen? Or, more generally, how to make it in-game? I have .class, .lvl, .model, .msh, .odf, .option, and .req files in place -- I just don't know what the final straw is. Most of these files were borrowed from an existing unit and I changed their names; it is highly likely that I missed some because I added them as I found a place that it looked like they needed to go in. Yes, I'm a nub, have pity. 
- General_Grievous_4
- Rebel Sergeant

- Posts: 214
- Joined: Sun Mar 26, 2006 10:07 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
RE: New Unit
Did you call for the unit correctly in the LUA? Such as putting ("dc:SIDE) in?
-
TimberWolf
- AceMastermind
- Gametoast Staff

- Posts: 3285
- Joined: Mon Aug 21, 2006 6:23 am
- Contact:
AddUnitClass
Did you add it to the "SetUpTeams" section in your LUA like this(without the arrow) :
Code: Select all
SetupTeams{
rep = {
team = REP,
units = 26,
reinforcements = -1,
pilot = { "all_inf_pilot",2},
marine = { "all_inf_marine",14},
AddUnitClass(REP,"rep_inf_clone_commando",1,10), <======
},-
TimberWolf
-
t551
- General

- Posts: 791
- Joined: Sat Jul 16, 2005 3:23 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
-
TimberWolf
-
t551
- General

- Posts: 791
- Joined: Sat Jul 16, 2005 3:23 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
-
TimberWolf
Okay, I've seen the error of my ways and I made a new side. It still won't show up in-game, though. My new side is called Alladdon, by the way. Here's my LUA:
In my alladdon sides folder (and in their respective folders) I have...
-The infantry default, my unit's default, my unit, and his weapon ODFs
-My unit's normal and low-quality MSHs with their option files, my unit's TGA, and weapon MSH and option files (in PC subfolder)
-My unit's Req file
-Nothing in the Munged folder
-Nothing in the effects folder
The unit is listed in the Side's req file. I don't think I need anything in the Munged or Effect folders because he's just a soldier.
Hidden/Spoiler:
-The infantry default, my unit's default, my unit, and his weapon ODFs
-My unit's normal and low-quality MSHs with their option files, my unit's TGA, and weapon MSH and option files (in PC subfolder)
-My unit's Req file
-Nothing in the Munged folder
-Nothing in the effects folder
The unit is listed in the Side's req file. I don't think I need anything in the Munged or Effect folders because he's just a soldier.
-
Hebes24
- Sith Master

- Posts: 2594
- Joined: Sat Jun 03, 2006 5:15 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: In An Epic Space Battle!
- Contact:
Change this:
to this:myTeamConfig = {
all = {
team = ALL,
units = 16,
reinforcements = -1,
pilot = { "all_inf_pilot",12},
marine = { "all_inf_marine",4},
saboteur = { ALLADDON,"alladdon_inf_saboteur",3,0},
},
imp = {
team = IMP,
units = 32,
reinforcements = -1,
pilot = { "imp_inf_pilot",26},
marine = { "imp_inf_marine",6},
}
}
and make sure you have this in the lua:myTeamConfig = {
all = {
team = ALL,
units = 16,
reinforcements = -1,
pilot = { "all_inf_pilot",12},
marine = { "all_inf_marine",4},
saboteur = { ALLADDON,"alladdon_inf_saboteur",3,0},
},
imp = {
team = IMP,
units = 32,
reinforcements = -1,
pilot = { "imp_inf_pilot",26},
marine = { "imp_inf_marine",6},
}
}
AddUnitClass(ALL,"alladdon_inf_saboteur", 1, 3)
ReadDataFile("dc:SIDE\\ALLaddon.lvl",
"alladdon_inf_saboteur")
-
TimberWolf
I did those two things but it still won't appear ingame. When I munged, I got two errors, as follows.
ERROR[levelpack mission\SWSg_Diet Dr. Pepper.req]:Expecting bracket, but none was found.
File : munged\pc\swsg_cmn.script.req(1)...
ucft <--
ERROR[levelpack mission\SWSg_Diet Dr. Pepper.req]:Expecting bracket, but none was found.
File : munged\pc\swsg_cmn.script.req(1)...
ucft <--
2 Errors 0 Warnings
-
Hebes24
- Sith Master

- Posts: 2594
- Joined: Sat Jun 03, 2006 5:15 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: In An Epic Space Battle!
- Contact:
-
Hebes24
- Sith Master

- Posts: 2594
- Joined: Sat Jun 03, 2006 5:15 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: In An Epic Space Battle!
- Contact:
-
TimberWolf
Still not working.F:\BF2_ModTools\ToolsFL\Bin\luac.exe: ..\..\common\scripts\SWS\SWSg_cmn.lua:43: `)' expected (to close `(' at line 34) near `ReadDataFile'
ERROR[scriptmunge scripts\SWS\SWSg_cmn.lua]:Could not read input file.ERROR[scriptmunge scripts\SWS\SWSg_cmn.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings
ERROR[levelpack mission\SWSg_Diet Dr. Pepper.req]:Expecting bracket, but none was found.
File : munged\pc\swsg_cmn.script.req(1)...
ucft <--
ERROR[levelpack mission\SWSg_Diet Dr. Pepper.req]:Expecting bracket, but none was found.
File : munged\pc\swsg_cmn.script.req(1)...
ucft <--
2 Errors 0 Warnings
-
t551
- General

- Posts: 791
- Joined: Sat Jul 16, 2005 3:23 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
-
Hebes24
- Sith Master

- Posts: 2594
- Joined: Sat Jun 03, 2006 5:15 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
- Location: In An Epic Space Battle!
- Contact:
Right Here....:
....you forgot to close the parentheses for the ReadDataFile.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"
-
t551
- General

- Posts: 791
- Joined: Sat Jul 16, 2005 3:23 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
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"
ReadDataFile("dc:SIDE\\ALLaddon.lvl",
"alladdon_inf_saboteur")
) <======================
end
What is that doing there (another problem)... Actually, I think it's the closing parenthesis of the tur.lvl ReadDataFile block.
-
TimberWolf
It's a conspiracy! Alright. I made those changes and, miraculously, there were no errors when I munged. Alas, my unit perseveres in its efforts to avoid being in-game. Ugh. Here's the LUA.
Meh, I don't know. I must be missing something fundamental and 'duh-inspiring.' It just won't appear to be spawnable as. If you're thinking "he must have done that...." and move on, don't -- I'm a total newb. 
Hidden/Spoiler:
-
t551
- General

- Posts: 791
- Joined: Sat Jul 16, 2005 3:23 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
AddUnitClass(ALL,"alladdon_inf_saboteur", 1, 3) =====> I'm fairly certain that this is wrong -- it's not inside one fo the team setups. Instead, it should be:
myTeamConfig = {
all = {
team = ALL,
units = 16,
reinforcements = -1,
soldier = { "alladon_inf_saboteur", <a number>}, <===============
pilot = { "all_inf_pilot",12},
marine = { "all_inf_marine",4},
},
myTeamConfig = {
all = {
team = ALL,
units = 16,
reinforcements = -1,
soldier = { "alladon_inf_saboteur", <a number>}, <===============
pilot = { "all_inf_pilot",12},
marine = { "all_inf_marine",4},
},
