Adding a side/unit to shipped maps? [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

Jawa26
Private Recruit
Posts: 23
Joined: Sun Nov 16, 2014 8:53 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Adding a side/unit to shipped maps? [Solved]

Post by Jawa26 »

Hello everyone!

I am sorry for opening a new topic about adding sides to shipped maps.
I did some research but could not find how to add a unit/side to shipped maps.
After I played a mod which allowed me to play a Pirate/Hutt/Blacksun side I thought I would be nice to create my own side/mod.
I followed all the instructions from different tutorials but never got a good result. Maps crashed,units did not show up in selection screen and whole map was
broken. I am familiar with creating maps and changing skins and weapons. It is jsut the sides/units I cant get to work.

The acutal question, does anyone know a tutorial about adding units/sides to shipped maps or perhaps even self created maps?
offtopic question: Is there a way to create own models like droids,humans or vehicles?

I hope anyone can help me.
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: Adding a side/unit to shipped maps?

Post by commanderawesome »

It works the same way as adding new units to a mod map. Just copy the mission you want and add to data_***\common\scripts\[name of shipped map] (you'll have to make that last folder), make the changes you want then add the script to mission.req and addme.lua. Please note that you will not be able to play that map online until you uninstall your mod. If you want to add a new era and/or game mode to a shipped map, follow this tutorial: http://www.gametoast.com/viewtopic.php? ... 96#p287596

If you have other questions, I'd suggest looking here first: http://www.gametoast.com/viewtopic.php?f=27&t=13806
Jawa26
Private Recruit
Posts: 23
Joined: Sun Nov 16, 2014 8:53 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Adding a side/unit to shipped maps?

Post by Jawa26 »

I used this tutorial = http://www.gametoast.com/viewtopic.php?f=27&t=12729
But still I did not work. The strange thing there is no error log or anything else.
The unit is just not showing up.
Is it possible to play as rep or cis against a new era/side ?
Do I have to replace a unit from the side like the cis?

I hope anyone can help I am about to give up=(.




EDIT
I finally got the custom side and units running.

Now the problem is how do I change the sides and the untis name
and how do I add them to a orginal battlefront 2 map?

I found a tutorial here on Gametoast but to be honest I dont get it.
Where can I find the scripts from the maps that need to be changed?

Is there another tutorial for adding a side to shipped maps?
I searched for hours in the internet but it seems like battlefront 2 modding
is rather rare.

I would be very happy if someone can help because I want to play the Black Sun on Tatooine :D
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: Adding a side/unit to shipped maps?

Post by commanderawesome »

Read my above post on how to add them to an original Battlefront II map. The scripts can be found in the Scripts folder in Assets, where there will be a sub-folder for each map.
Hidden/Spoiler:
COR = Coruscant
DAG = Dagobah
END = Endor
FEL = Felucia
GEO = Geonosis
HOT = Hoth
KAS = Kashyyyk
NAB = Naboo
TAT = Tatooine (Mos Eisley and Jabba's Palace)
DEA = Death Star
KAM = Kamino
MUS = Mustafar
MYG = Mygeeto
POL = Polis Massa
SPA = Space
TAN = Tantive IV
UTA = Utapau
YAV = Yavin 4
Jawa26
Private Recruit
Posts: 23
Joined: Sun Nov 16, 2014 8:53 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Adding a side/unit to shipped maps?

Post by Jawa26 »

First of all thank you for your help.

About the addme.lua tutorial.
I tried to follow the instructions in the add.lua but I dont understand what to do.
I just want to add the black sun era to Mos Eisley
I dont know what to add it in the addme lua.
Could you perhaps explain in a short but easy way.

I am modding battlefront 2 the first time and I was supprised how fast
I actually created a custom era.

I hope you or anyone else can help me.
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: Adding a side/unit to shipped maps?

Post by commanderawesome »

Ok, first you will need a letter for your era (I think other characters might work, but I don't know for certain.) I'll use "s" and Mos Eisley conquest mode in this demonstration. So, I assume you already have tat2s_con.lua written out, so next you will go to mission.req and add your new script(s) like so:
Hidden/Spoiler:
ucft
{
REQN
{
"config"
"ingame_movies"
}

REQN
{
"script"
"setup_teams"
"gametype_conquest"
"gametype_capture"
"Objective"
"MultiObjectiveContainer"
"ObjectiveCTF"
"ObjectiveAssault"
"ObjectiveSpaceAssault"
"ObjectiveConquest"
"ObjectiveTDM"
"ObjectiveOneFlagCTF"
"SoundEvent_ctf"
"ObjectiveGoto"
"LinkedShields"
"LinkedDestroyables"
"LinkedTurrets"
"Ambush"
"PlayMovieWithTransition"
}

REQN
{
"lvl"
"***g_con" --These would be the scripts that came with the project.
"***c_con"
"tat2s_con"
}
}
Then make a new file in the mission folder for each of your new scripts called (the name of the script).req, with the following contents:

Code: Select all

ucft
{
	REQN
	{
		"script"
		"tat2s_con"
	}
}
Then modify your addme.lua file like this: http://www.gametoast.com/viewtopic.php? ... 94#p281998
Jawa26
Private Recruit
Posts: 23
Joined: Sun Nov 16, 2014 8:53 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Adding a side/unit to shipped maps?

Post by Jawa26 »

Yes I have done all the parts with the mission req and so on.
Its just the addme.lua which I do not understand what to change their.

I used the tutorial and just copied the whole thing changed map name, saved it and munged.
Then I tried to open the game and got a instant crash.

Can you tell me what exactly I have to changed in the addme.lua.
BTW. where do I find the addme.lua? I used the one in my Test map folder with the side in it.
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: Adding a side/unit to shipped maps?

Post by commanderawesome »

Here's a regular, unchanged addme.lua:
Hidden/Spoiler:
[code]--Search through the missionlist to find a map that matches mapName,
--then insert the new flags into said entry.
--Use this when you know the map already exists, but this content patch is just
--adding new gamemodes (otherwise you should just add whole new entries to the missionlist)
function AddNewGameModes(missionList, mapName, newFlags)
for i, mission in missionList do
if mission.mapluafile == mapName then
for flag, value in pairs(newFlags) do
mission[flag] = value
end
end
end
end




--insert totally new maps here:
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)

sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "***%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1,}
mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]

-- associate this mission name with the current downloadable content directory
-- (this tells the engine which maps are downloaded, so you need to include all new mission lua's here)
-- first arg: mapluafile from above
-- second arg: mission script name
-- third arg: level memory modifier. the arg to LuaScript.cpp: DEFAULT_MODEL_MEMORY_PLUS(x)

AddDownloadableContent("***","***g_con",4)
AddDownloadableContent("***","***c_con",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\***\\data\\_LVL_PC\\core.lvl")
[/code]
And here's the edited version for comparison:
Hidden/Spoiler:
[code]--Search through the missionlist to find a map that matches mapName,
--then insert the new flags into said entry.
--Use this when you know the map already exists, but this content patch is just
--adding new gamemodes (otherwise you should just add whole new entries to the missionlist)
function AddNewGameModes(missionList, mapName, newFlags)
for i, mission in missionList do
if mission.mapluafile == mapName then
for flag, value in pairs(newFlags) do
mission[flag] = value
end
end
end
end




--insert totally new maps here:
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)

--add my modes to the singleplayer map selection screen

AddNewGameModes( sp_missionselect_listbox_contents, "myg1%s_%s", {era_* = 1, mode_con_* = 1,} )

AddNewGameModes( mp_missionselect_listbox_contents, "myg1%s_%s", {era_* = 1, mode_con_* = 1,} )

-- associate this mission name with the current downloadable content directory
-- (this tells the engine which maps are downloaded, so you need to include all new mission lua's here)
-- first arg: mapluafile from above
-- second arg: mission script name
-- third arg: level memory modifier. the arg to LuaScript.cpp: DEFAULT_MODEL_MEMORY_PLUS(x)

AddDownloadableContent("myg1","myg1*_con",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\***\\data\\_LVL_PC\\core.lvl")[/code]
I hope that clears things up.
Jawa26
Private Recruit
Posts: 23
Joined: Sun Nov 16, 2014 8:53 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Adding a side/unit to shipped maps?

Post by Jawa26 »

Thank you again!

I saw the changes but everytime I do the same a new map shows up on the selection screen.
When I start the map it crashes and says "could not open MISSION"tat2bg_con.

What must I put here:
AddNewGameModes( sp_missionselect_listbox_contents, "myg1%s_%s", {era_* = 1, mode_con_* = 1,} )

AddNewGameModes( mp_missionselect_listbox_contents, "myg1%s_%s", {era_* = 1, mode_con_* = 1,} )
What does the myg1 stand for? Is it the map or is it the something else?

And here?
AddDownloadableContent("myg1","myg1*_con",4)

It says myg1. It cant be a map name because I checked the mission reqs and found no myg1.
I only found myg1c_con and so on.

I am sorry for not understanding so thank you for the help you give me.
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: Adding a side/unit to shipped maps?

Post by commanderawesome »

Replace myg1 with tat2, myg1 means mygeeto, tat2 means mos eisley (see my earlier post) and con means conquest mode. Replace * with your era letter.
Jawa26
Private Recruit
Posts: 23
Joined: Sun Nov 16, 2014 8:53 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Adding a side/unit to shipped maps?

Post by Jawa26 »

Now it worked but non of my units are in game? :(

I the script of my side mod I replaced the rebels by replacing the laoding part units with my units.
Like this:
Hidden/Spoiler:
[code]ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee",
"all_hero_hansolo_tat")

ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_dark_trooper",
"imp_hero_bobafett",
"imp_fly_destroyer_dome" )

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

ReadDataFile("dc:SIDE\\bsm.lvl",
"bsm_inf_soldier",
"bsm_inf_fallenhunter",
"bsm_inf_ig88guard",
"bsm_inf_mercenary",
"bsm_inf_ep3_jettrooper",
"bsm_inf_plexsoldier")

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { "bsm_inf_soldier",9, 25},
assault = { "bsm_inf_plexsoldier",1,4},
engineer = { "bsm_inf_mercenary",1,4},
sniper = { "bsm_inf_fallenhunter",1,4},
officer = { "bsm_inf_ig88guard",1,4},
special = { "bsm_inf_ep3_jettrooper",1,4},

},
imp = {
team = IMP,
units = 20,
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},[/code]
The addme.lua looks like this:
Hidden/Spoiler:
[code]--Search through the missionlist to find a map that matches mapName,
--then insert the new flags into said entry.
--Use this when you know the map already exists, but this content patch is just
--adding new gamemodes (otherwise you should just add whole new entries to the missionlist)
function AddNewGameModes(missionList, mapName, newFlags)
for i, mission in missionList do
if mission.mapluafile == mapName then
for flag, value in pairs(newFlags) do
mission[flag] = value
end
end
end
end




--insert totally new maps here:
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)

sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "tat2%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1,}
mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]

-- associate this mission name with the current downloadable content directory
-- (this tells the engine which maps are downloaded, so you need to include all new mission lua's here)
-- first arg: mapluafile from above
-- second arg: mission script name
-- third arg: level memory modifier. the arg to LuaScript.cpp: DEFAULT_MODEL_MEMORY_PLUS(x)

AddDownloadableContent("ZZZ","ZZZg_con",4)


-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\ZZZ\\data\\_LVL_PC\\core.lvl")[/code]

Hopefully you can help me again.
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: Adding a side/unit to shipped maps?

Post by commanderawesome »

Ahh. You cannot use "g" because "g" is already used by the galactic civil war era. Use a different letter.
Jawa26
Private Recruit
Posts: 23
Joined: Sun Nov 16, 2014 8:53 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Adding a side/unit to shipped maps?

Post by Jawa26 »

Where exactly do I have to change the g?
Must I change everything with g?
Can you be more specific please?
Must I also changed the ZZZg_con aswell?
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: Adding a side/unit to shipped maps?

Post by commanderawesome »

What you need to change is in red:
--Search through the missionlist to find a map that matches mapName,
--then insert the new flags into said entry.
--Use this when you know the map already exists, but this content patch is just
--adding new gamemodes (otherwise you should just add whole new entries to the missionlist)
function AddNewGameModes(missionList, mapName, newFlags)
for i, mission in missionList do
if mission.mapluafile == mapName then
for flag, value in pairs(newFlags) do
mission[flag] = value
end
end
end
end




--insert totally new maps here:
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)

sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "tat2%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1,}
mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]

-- associate this mission name with the current downloadable content directory
-- (this tells the engine which maps are downloaded, so you need to include all new mission lua's here)
-- first arg: mapluafile from above
-- second arg: mission script name
-- third arg: level memory modifier. the arg to LuaScript.cpp: DEFAULT_MODEL_MEMORY_PLUS(x)

AddDownloadableContent("ZZZ","ZZZg_con",4)


-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\ZZZ\\data\\_LVL_PC\\core.lvl")

You also need to change ZZZ to tat2 except in the last line.
Jawa26
Private Recruit
Posts: 23
Joined: Sun Nov 16, 2014 8:53 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Adding a side/unit to shipped maps?

Post by Jawa26 »

SoI am confused now. I did what you said and changed the zzz and the zzzg.con to tat2 and tat2b.con
B instead of G . When I started the game there were 2 mos eisley maps the original one and a orange coloured map.
The first map had 3 eras, the 2 normal ones and then my one but I couldn't select my era/side.
The orange had the same and there my side work but after the mos eisley loading screen was on the blank test map for my side.

What did I do wrong this time and why are there 2 mos eisley maps now?
I just want my side on the original mos eisley map.

Which files do I need to modify?
I modified the Mission file in my map folder and the map script of mos eisley and of course the addme.lua

Battlefront 2 is indeed one of the hardest games to modify.
Hopefully someone has an idea what I'm doing wrong.

@commanderawesome thank you for helping me the whole time!
User avatar
commanderawesome
Field Commander
Field Commander
Posts: 971
Joined: Tue Aug 13, 2013 11:58 pm
Projects :: Skin Changer - Warfront - Other stuff
Games I'm Playing :: SWBF SWTOR KotOR EaW
xbox live or psn: AaTc_CmdrAwesome
Location: The Universe

Re: Adding a side/unit to shipped maps?

Post by commanderawesome »

Well, I don't know how to help you then, sorry.
Jawa26
Private Recruit
Posts: 23
Joined: Sun Nov 16, 2014 8:53 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Adding a side/unit to shipped maps?

Post by Jawa26 »

Dont worry I got it now. No second mos eisley map.

Now I only got one more thing to ask (hopefully).
There on the selction screen is a third era but I cannot play it.
I am 100% sure it is not the addme.lua
There was no errror when munging it.
It is like when you create a new unit and you forget to add a part in some script and the unit does not show up.
Please help me one more time with this.
About 99% of the side mod works its only this part.

Do mind the section above I fixed it.
something else is the problem.
I works with the third era on mos eisley but when ever I start the map
the mos eisley loading screen occurs but its still the flat Yavin map.
You got any idea why this is?
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Adding a side/unit to shipped maps?

Post by Noobasaurus »

I haven't been following along too much but you may not have changed the actual level your lua loads. Take a look at this line:

Code: Select all

    ReadDataFile("TAT\\tat2.lvl", "tat2_con")
If you don't have this in your lua, then it's going to read your custom level, AKA your flat Yavin. Find the line that looks similar to

Code: Select all

    ReadDataFile("dc:ZZZ\\ZZZ.lvl", "ZZZ_conquest")
and replace it with the one above.

This is all in your "ZZZg_con.lua"
Jawa26
Private Recruit
Posts: 23
Joined: Sun Nov 16, 2014 8:53 am
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: Adding a side/unit to shipped maps?

Post by Jawa26 »

Thank you so much!
It worked :D

Some thing else is not working now.
No troops are spawing.
That is strange because the whole time it worked on hte flat yavin map.

I also got no error log or anything else.
My addme.lua looks like this:
Hidden/Spoiler:
[code]--Search through the missionlist to find a map that matches mapName,
--then insert the new flags into said entry.
--Use this when you know the map already exists, but this content patch is just
--adding new gamemodes (otherwise you should just add whole new entries to the missionlist)
function AddNewGameModes(missionList, mapName, newFlags)
for i, mission in missionList do
if mission.mapluafile == mapName then
for flag, value in pairs(newFlags) do
mission[flag] = value
end
end
end
end




--insert totally new maps here:
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)

--add my modes to the singleplayer map selection screen

AddNewGameModes( sp_missionselect_listbox_contents, "tat2%s_%s", {era_b = 1, mode_con_b = 1,} )

AddNewGameModes( mp_missionselect_listbox_contents, "tat2%s_%s", {era_b = 1, mode_con_b = 1,} )

-- associate this mission name with the current downloadable content directory
-- (this tells the engine which maps are downloaded, so you need to include all new mission lua's here)
-- first arg: mapluafile from above
-- second arg: mission script name
-- third arg: level memory modifier. the arg to LuaScript.cpp: DEFAULT_MODEL_MEMORY_PLUS(x)

AddDownloadableContent("tat2","tat2b_con",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\***\\data\\_LVL_PC\\core.lvl")[/code]
My Map script looks like this:
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")

-- Empire Attacking (attacker is always #1)
local ALL = 2
local IMP = 1
-- These variables do not change
local ATT = 1
local DEF = 2

function ScriptPostLoad()


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)

conquest:Start()

EnableSPHeroRules()

end


---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------

function ScriptInit()

ReadDataFile("ingame.lvl")



SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)


SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo


ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman",
"all_inf_rocketeer",
"all_inf_sniper",
"all_inf_engineer",
"all_inf_officer",
"all_inf_wookiee",
"all_hero_hansolo_tat")

ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman",
"imp_inf_rocketeer",
"imp_inf_engineer",
"imp_inf_sniper",
"imp_inf_officer",
"imp_inf_dark_trooper",
"imp_hero_bobafett",
"imp_fly_destroyer_dome" )

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

ReadDataFile("dc:SIDE\\bsm.lvl",
"bsm_inf_soldier",
"bsm_inf_fallenhunter",
"bsm_inf_ig88guard",
"bsm_inf_mercenary",
"bsm_inf_ep3_jettrooper",
"bsm_inf_plexsoldier")

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { "bsm_inf_soldier",9, 25},
assault = { "bsm_inf_plexsoldier",1,4},
engineer = { "bsm_inf_mercenary",1,4},
sniper = { "bsm_inf_fallenhunter",1,4},
officer = { "bsm_inf_ig88guard",1,4},
special = { "bsm_inf_ep3_jettrooper",1,4},

},
imp = {
team = IMP,
units = 20,
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(ALL, "bsm_inf_soldier",9, 25)

SetHeroClass(ALL, "all_hero_hansolo_tat")
SetHeroClass(IMP, "imp_hero_bobafett")

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)

local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("TAT\\tat2.lvl", "tat2_con")
SetDenseEnvironment("false")


-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "des_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "all_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "gcw_music")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")

SetBleedingVoiceOver(ALL, ALL, "all_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(ALL, IMP, "all_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, ALL, "imp_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(ALL, IMP, "all_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(IMP, ALL, "imp_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(2, "Allleaving")
SetOutOfBoundsVoiceOver(1, "Impleaving")

SetAmbientMusic(ALL, 1.0, "all_tat_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_tat_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_tat_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_tat_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_tat_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_tat_amb_end", 2,1)

SetVictoryMusic(ALL, "all_tat_amb_victory")
SetDefeatMusic (ALL, "all_tat_amb_defeat")
SetVictoryMusic(IMP, "imp_tat_amb_victory")
SetDefeatMusic (IMP, "imp_tat_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")

-- Camera Stats
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);
AddCameraShot(0.390197, -0.089729, -0.893040, -0.205362, 23.563562, 12.914885, -101.465561);
AddCameraShot(0.169759, 0.002225, -0.985398, 0.012916, 126.972809, 4.039628, -22.020613);
AddCameraShot(0.677453, -0.041535, 0.733016, 0.044942, 97.517807, 4.039628, 36.853477);
AddCameraShot(0.866029, -0.156506, 0.467299, 0.084449, 7.685640, 7.130688, -10.895234);
end[/code]
Hopefully you find the error.
oh and I am sorry if it is a little bit messed up
Noobasaurus
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2006
Joined: Tue Aug 17, 2010 5:56 pm

Re: Adding a side/unit to shipped maps?

Post by Noobasaurus »

Replace
Hidden/Spoiler:
[code]

--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)

conquest:Start()

EnableSPHeroRules()[/code]
with
Hidden/Spoiler:
[code]
--This defines the CPs. These need to happen first
SetProperty("FDL-2", "IsLocked", 1)
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp6 = CommandPost:New{name = "cp6"}
cp7 = CommandPost:New{name = "cp7"}
cp8 = CommandPost:New{name = "cp8"}


--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, textATT = "game.modes.con", textDEF = "game.modes.con2", multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)

conquest:AddCommandPost(cp6)
conquest:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)


conquest:Start()
AddAIGoal(1, "conquest", 1000)
AddAIGoal(2, "conquest", 1000)
AddAIGoal(3, "conquest", 1000)[/code]
Post Reply