lua error for adding Rising Son [Solved]

Discussion, progress updates, and downloads for the Dark Times and Rising Son mods.

Moderator: Moderators

Post Reply
User avatar
Jendo7
Sith
Sith
Posts: 1303
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

lua error for adding Rising Son [Solved]

Post by Jendo7 »

Had an error with the lua script, and mission\TDS1_con.req script. Not sure how to resolve it.
Below is the mungelog, and my lua.

Mungelog:
Hidden/Spoiler:
[code]C:\BF2_ModTools\data_TDS\_BUILD\..\..\ToolsFL\Bin\luac.exe: ..\..\common\scripts\TDS\TDS1_con.lua:298: `end' expected (to close `function' at line 20) near `<eof>'
ERROR[scriptmunge scripts\TDS\TDS1_con.lua]:Could not read input file.ERROR[scriptmunge scripts\TDS\TDS1_con.lua]:Could not read input file. [continuing]
2 Errors 0 Warnings

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

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

ucft <--
[continuing]
2 Errors 0 Warnings

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

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

ucft <--
[continuing]
2 Errors 0 Warnings[/code]
TDS1_con.lua :
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("TFURandom")
ScriptCB_DoFile("AIHeroSupport")

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

ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\core.lvl")

function ScriptPostLoad()

if not ScriptCB_InMultiplayer() then
herosupport = AIHeroSupport:New{AIATTHeroHealth = 4000, AIDEFHeroHealth = 4000, gameMode = "NonConquest",}
herosupport:SetHeroClass(ALL, herostrAll)
herosupport:SetHeroClass(IMP, herostrEmp)
herosupport:AddSpawnCP("CP1","CP1SpawnPath")
herosupport:AddSpawnCP("CP2","CP2SpawnPath")
herosupport:AddSpawnCP("CP3","CP3SpawnPath")
herosupport:AddSpawnCP("CP4","CP4SpawnPath")
herosupport:AddSpawnCP("CP5","CP5SpawnPath")
herosupport:AddSpawnCP("CP6","CP6SpawnPath")
herosupport:Start()
else


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()

gcwera = math.random(1,4)

if not ScriptCB_InMultiplayer() then
bothan = "all_inf_bothan_offline"
if gcwera < 3 then
DecideUnitsANH(1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2)
allsoldier = "all_inf_soldier_anh"
allheavy = "all_inf_heavy_anh"
allmarksman = "all_inf_marksman_anh"
impsoldier = "imp_inf_soldier_anh"
impheavy = "imp_inf_heavy_anh"
impmarksman = "imp_inf_marksman_anh"
allsupport = "all_inf_honorguard"
impsupport = "imp_inf_darktrooper_p1"
elseif gcwera > 2 then
DecideUnits(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
allsoldier = "all_inf_soldier"
allheavy = "all_inf_heavy"
allmarksman = "all_inf_marksman"
impsoldier = "imp_inf_soldier"
impheavy = "imp_inf_heavy"
impmarksman = "imp_inf_marksman"
allsupport = "all_inf_durosmerc"
impsupport = "imp_inf_heavymelee"
end
elseif ScriptCB_InMultiplayer() then
allsoldier = "all_inf_soldier"
allheavy = "all_inf_heavy"
allmarksman = "all_inf_marksman"
impsoldier = "imp_inf_soldier"
impheavy = "imp_inf_heavy"
impmarksman = "imp_inf_marksman"
allsupport = "all_inf_durosmerc"
impsupport = "imp_inf_heavymelee"
bothan = "all_inf_bothan"
herostrAll = "all_hero_kento"
supportstrAll = "all_inf_clone"
herostrEmp = "imp_hero_marek"
supportstrEmp = "imp_inf_commander"
end

--tell the game to load our loading image
ReadDataFile("dc:Load\\common.lvl")

SetMaxFlyHeight(90)
SetMaxPlayerFlyHeight (80)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",30) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",500) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",400) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",4000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",88) -- should be ~1x #combo

ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\ingame.lvl")

ReadDataFile("ingame.lvl")

ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\sound\\tes.lvl;tescw")
ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\sound\\bgl.lvl;bglgcw")
ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\SIDE\\dark.lvl",
"all_hero_bail",
allsoldier,
allheavy,
allmarksman,
"all_inf_moncaleng",
allsupport,
bothan,
impsoldier,
impmarksman,
impheavy,
"imp_inf_gunner",
impsupport,
"imp_inf_commando",
"imp_inf_jumptrooper",
supportstrAll,
supportstrEmp)

ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\SIDE\\lead.lvl",
herostrAll,
herostrEmp)

ReadDataFile("SIDE\\des.lvl",
"tat_inf_tuskenraider")

ReadDataFile("dc:SIDE\\TLS.lvl",
"tat_inf_tuskenhunter")

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

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { allsoldier,9, 25},
assault = { allheavy,1,4},
engineer = { "all_inf_moncaleng",1,4},
sniper = { allmarksman,1,4},
officer = { allsupport,1,4},
special = { bothan,1,4},

},
imp = {
team = IMP,
units = 20,
reinforcements = 150,
soldier = { impsoldier,9, 25},
assault = { impheavy,1,4},
engineer = { "imp_inf_gunner",1,4},
sniper = { impmarksman,1,4},
officer = { impsupport,1,4},
special = { "imp_inf_jumptrooper",1,4},
},

}




AddUnitClass(IMP, supportstrEmp, 1, 4)
AddUnitClass(ALL, supportstrAll, 1, 4)

if ScriptCB_InMultiplayer() then
SetHeroClass(ALL, herostrAll)
SetHeroClass(IMP, herostrEmp)
else
end


SetTeamName (3, "Tuskens")
AddUnitClass (3, "tat_inf_tuskenraider", 10,15)
AddUnitClass (3, "tat_inf_tuskenhunter", 2)
SetUnitCount (3, 15)
AddAIGoal(3, "Deathmatch", 100)
SetTeamAsEnemy(ATT,3)
SetTeamAsEnemy(3,ATT)
SetTeamAsEnemy(DEF,3)
SetTeamAsEnemy(3,DEF)



-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- 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", 100)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 5)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoldierAnimation", 900)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:TDS\\TDS.lvl", "TDS_conquest")
ReadDataFile("dc:TDS\\tat1.lvl", "tat1_conquest")
SetDenseEnvironment("false")




-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_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", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

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

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(1, "repleaving")
SetOutOfBoundsVoiceOver(2, "cisleaving")

SetAmbientMusic(REP, 1.0, "rep_tat_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_tat_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2,"rep_tat_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_tat_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_tat_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2,"cis_tat_amb_end", 2,1)

SetVictoryMusic(REP, "rep_tat_amb_victory")
SetDefeatMusic (REP, "rep_tat_amb_defeat")
SetVictoryMusic(CIS, "cis_tat_amb_victory")
SetDefeatMusic (CIS, "cis_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")



--OpeningSateliteShot
AddCameraShot(0.906136, -0.116214, 0.403404, 0.051737, -309.639801, 30.941639, 121.537041);

AddCameraShot(0.983436, -0.082039, -0.161070, -0.013437, -120.546829, 23.164709, 115.404213);
AddCameraShot(-0.388369, -0.015572, -0.920633, 0.036914, -79.814339, 18.477957, 154.671814);
AddCameraShot(-0.049420, 0.001219, -0.998473, -0.024638, -127.077797, 23.053442, -42.468227);
AddCameraShot(0.894305, 0.040977, -0.445111, 0.020395, -270.660736, 14.216214, 105.867706);
AddCameraShot(0.798602, 0.040403, 0.599735, -0.030342, -203.025803, 24.507858, 169.962845);
AddCameraShot(-0.432969, 0.026587, -0.899323, -0.055224, 31.364191, 12.099824, 128.130707);
AddCameraShot(0.062538, -0.000352, -0.998027, -0.005617, -160.603210, 6.261599, -223.010620);
AddCameraShot(0.970116, -0.013466, -0.242244, -0.003363, -279.433777, 26.094082, 34.852585);

end

[/code]
Last edited by Jendo7 on Thu Aug 05, 2010 10:45 am, edited 1 time in total.
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: lua error for adding Rising Son

Post by lucasfart »

Look at the first line of the log. It needs another end to close the one at line 20. Add another end at the end of scriptpostload, and you should be right :wink: .
User avatar
Jendo7
Sith
Sith
Posts: 1303
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: lua error for adding Rising Son

Post by Jendo7 »

Thanks, that got rid of the error log problem, but DT conquest crashes to desktop before it even loads. Here is my addme script if that will help:
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




ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\dtshell.lvl")

--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 = "TDS%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1, mode_ctf_g = 1, mode_ctf_c = 1, mode_eli_g = 1, mode_hunt_g = 1, era_1 = 1, mode_con_1 = 1, change = {
era_1 = { name="Dark Times", icon2="darktimes_icon" },
},}

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("TDS","TDSg_con",4)
AddDownloadableContent("TDS","TDSc_con",4)
AddDownloadableContent("TDS","TDSg_ctf",4)
AddDownloadableContent("TDS","TDSc_ctf",4)
AddDownloadableContent("TDS","TDSg_eli",4)
AddDownloadableContent("TDS","TDSg_hunt",4)
AddDownloadableContent("TDS","TDS1_con",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\TDS\\data\\_LVL_PC\\core.lvl")
[/code]
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: lua error for adding Rising Son

Post by lucasfart »

Could you post your bfront2.log
User avatar
Jendo7
Sith
Sith
Posts: 1303
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: lua error for adding Rising Son

Post by Jendo7 »

Bfront2.log:
Hidden/Spoiler:
[code]Opened logfile BFront2.log 2010-08-05 1239
shell_interface: Entered
shell_interface: gPlatformStr, gOnlineServiceStr, gLangStr, gLangEnum: PC GameSpy english 0
ifs_era_handler - Entered
ifs_era_handler - Exited
shell_interface: No custom_gc_0.lvl
shell_interface: No custom_gc_1.lvl
shell_interface: No custom_gc_2.lvl
shell_interface: No custom_gc_3.lvl
shell_interface: No custom_gc_4.lvl
shell_interface: No custom_gc_5.lvl
shell_interface: No custom_gc_6.lvl
shell_interface: No custom_gc_7.lvl
shell_interface: No custom_gc_8.lvl
shell_interface: No custom_gc_9.lvl
shell_interface: Found custom_gc_10.lvl
custom_gc_10: Entered
custom_gc_10: Found custom_gc_11.lvl
custom_gc_11: Entered
ifs_freeform_init_dt.lua
ifs_freeform_start_dt.lua
custom_gc_11: Taking control of custom_GetGCButtonList()...
custom_gc_11: Taking control of custom_PressedGCButton()...
custom_gc_11: Exited
custom_gc_10: No custom_gc_12.lvl. Will stop searching for any more cGC scripts.
custom_gc_10: Exited
custom_EraButtonList(): Finished building era button table Known eras buttons: 28
custom_GetGMapEras(): Finished building era table Known eras: 28
custom_GetGMapModes(): Finished building game mode table Known Modes: 39
custom_GetMPGameModeList(): Finished building game mode list table List Length: 40
custom_SetMovieLocation()
custom_gc_11: custom_GetGCButtonList(): Entered
custom_GetGCButtonList()
custom_gc_11: custom_GetGCButtonList(): Exited
custom_SetMovieLocation()
custom_GetFreeformBattleModeList(): Finished building freeform battle mode list Known Modes: 39
ingame stream movies\crawl.mvs
shell_interface: Opening movie: movies\shell.mvs
shell_interface: Leaving
Mission Checker: Entered addme
Mission Checker: addme: Now listening in on AddDownloadableContent() calls
Mission Checker: Exited addme
Cannot find ..\..\addon\BFX\data\_LVL_PC\mission.lvl. Skipping BFX's extra missions
Cannot find ..\..\addon\BFX\data\_LVL_PC\mission.lvl. Skipping BFX's extra missions
Found ..\..\addon\BDT\data\_LVL_PC\SIDE\dark.lvl. Adding DT's missions
prev = none iLastPage = nil
prev = texture iLastPage = 1
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameMovie.cpp(399)
Unable to find open movie segment shell_main

ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadProfile
ifs_saveop_DoOps LoadProfile
ifs_sp_campaign: Input_Accept(): Entered: _tab_instant
missionlist_ExpandMapList()
ifs_missionselect_pcMulti_fnSetMapPreview(): Defaulting index to 1
this.CurButton = check_mode1
cur_button = nil
Checkbox for check_era27 clicked
this.CurButton = check_era27
cur_button = nil
this.CurButton = nil
cur_button = nil
DoubleClicked
custom_AddMapNew()
custom_printTable(): table: 04F3BEE0
The key, value is: mode_hunt_g 1
The key, value is: change table: 04F3BF0C
The key, value is: era_g 1
The key, value is: mode_con_c 1
The key, value is: isModLevel 1
The key, value is: bSelected 1
The key, value is: mode_con_1 1
The key, value is: era_1 1
The key, value is: era_c 1
The key, value is: mode_eli_g 1
The key is mapluafile, the formated value is: TDS<A>_<B>
The key, value is: mode_con_g 1
The key, value is: mode_ctf_g 1
The key, value is: mode_ctf_c 1
custom_printTable(): Returning
custom_printTable(): table: 04B26B4C
The key, value is: key mode_con
The key, value is: subst con
The key, value is: showstr modename.name.con
The key, value is: descstr modename.description.con
The key, value is: icon mode_icon_con
custom_printTable(): Returning
gMapEras.key = era_1 Era = era_1 subst = 1
Adding map: TDS1_con idx: 1
this.CurButton = Launch
cur_button = nil
[/code]
User avatar
lucasfart
Sith
Sith
Posts: 1440
Joined: Tue Feb 24, 2009 5:32 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Australia

Re: lua error for adding Rising Son

Post by lucasfart »

I have absolutely no idea why it wouldn't even start an error log of your map. Try a manual clean and munge.
User avatar
Jendo7
Sith
Sith
Posts: 1303
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: lua error for adding Rising Son

Post by Jendo7 »

Same problem after manual cleaning. Thanks for your help, I'm sure I've probably missed something.

Edit: Thu Aug 05, 2010 10:46 am. Finally got it working. I left out quite a lot from the lua mainly defining the cps and objective, so I changed it to this:
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("TFURandom")
ScriptCB_DoFile("AIHeroSupport")

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

ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\core.lvl")

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"}
cp5 = CommandPost:New{name = "cp5"}
cp6 = CommandPost:New{name = "cp6"}



--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:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)

conquest:Start()

EnableSPHeroRules()

if not ScriptCB_InMultiplayer() then
herosupport = AIHeroSupport:New{AIATTHeroHealth = 4000, AIDEFHeroHealth = 4000, gameMode = "NonConquest",}
herosupport:SetHeroClass(ALL, herostrAll)
herosupport:SetHeroClass(IMP, herostrEmp)
herosupport:AddSpawnCP("CP1","CP1SpawnPath")
herosupport:AddSpawnCP("CP2","CP2SpawnPath")
herosupport:AddSpawnCP("CP3","CP3SpawnPath")
herosupport:AddSpawnCP("CP4","CP4SpawnPath")
herosupport:AddSpawnCP("CP5","CP5SpawnPath")
herosupport:AddSpawnCP("CP6","CP6SpawnPath")
herosupport:Start()
else
end

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()

--tell the game to load our loading image
ReadDataFile("dc:Load\\common.lvl")

gcwera = math.random(1,4)

if not ScriptCB_InMultiplayer() then
bothan = "all_inf_bothan_offline"
if gcwera < 3 then
DecideUnitsANH(1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2)
allsoldier = "all_inf_soldier_anh"
allheavy = "all_inf_heavy_anh"
allmarksman = "all_inf_marksman_anh"
impsoldier = "imp_inf_soldier_anh"
impheavy = "imp_inf_heavy_anh"
impmarksman = "imp_inf_marksman_anh"
allsupport = "all_inf_honorguard"
impsupport = "imp_inf_darktrooper_p1"
elseif gcwera > 2 then
DecideUnits(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
allsoldier = "all_inf_soldier"
allheavy = "all_inf_heavy"
allmarksman = "all_inf_marksman"
impsoldier = "imp_inf_soldier"
impheavy = "imp_inf_heavy"
impmarksman = "imp_inf_marksman"
allsupport = "all_inf_durosmerc"
impsupport = "imp_inf_heavymelee"
end
elseif ScriptCB_InMultiplayer() then
allsoldier = "all_inf_soldier"
allheavy = "all_inf_heavy"
allmarksman = "all_inf_marksman"
impsoldier = "imp_inf_soldier"
impheavy = "imp_inf_heavy"
impmarksman = "imp_inf_marksman"
allsupport = "all_inf_durosmerc"
impsupport = "imp_inf_heavymelee"
bothan = "all_inf_bothan"
herostrAll = "all_hero_kento"
supportstrAll = "all_inf_clone"
herostrEmp = "imp_hero_marek"
supportstrEmp = "imp_inf_commander"
end

ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\ingame.lvl")
ReadDataFile("ingame.lvl")



SetMaxFlyHeight(90)
SetMaxPlayerFlyHeight (80)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",30) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",500) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",400) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",4000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",88) -- should be ~1x #combo


ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\sound\\tes.lvl;tescw")
ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\sound\\bgl.lvl;bglgcw")
ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\SIDE\\dark.lvl",
"all_hero_bail",
allsoldier,
allheavy,
allmarksman,
"all_inf_moncaleng",
allsupport,
bothan,
impsoldier,
impmarksman,
impheavy,
"imp_inf_gunner",
impsupport,
"imp_inf_commando",
"imp_inf_jumptrooper",
supportstrAll,
supportstrEmp)

ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\SIDE\\lead.lvl",
herostrAll,
herostrEmp)

ReadDataFile("SIDE\\des.lvl",
"tat_inf_tuskenraider")

ReadDataFile("dc:SIDE\\TLS.lvl",
"tat_inf_tuskenhunter")

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

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { allsoldier,9, 25},
assault = { allheavy,1,4},
engineer = { "all_inf_moncaleng",1,4},
sniper = { allmarksman,1,4},
officer = { allsupport,1,4},
special = { bothan,1,4},

},
imp = {
team = IMP,
units = 20,
reinforcements = 150,
soldier = { impsoldier,9, 25},
assault = { impheavy,1,4},
engineer = { "imp_inf_gunner",1,4},
sniper = { impmarksman,1,4},
officer = { impsupport,1,4},
special = { "imp_inf_jumptrooper",1,4},
},

}

SetTeamName (3, "Tuskens")
AddUnitClass (3, "tat_inf_tuskenraider", 10,15)
AddUnitClass (3, "tat_inf_tuskenhunter", 2)
SetUnitCount (3, 15)
AddAIGoal(3, "Deathmatch", 100)
SetTeamAsEnemy(ATT,3)
SetTeamAsEnemy(3,ATT)
SetTeamAsEnemy(DEF,3)
SetTeamAsEnemy(3,DEF)

AddUnitClass(IMP, supportstrEmp, 1, 4)
AddUnitClass(ALL, supportstrAll, 1, 4)

if ScriptCB_InMultiplayer() then
SetHeroClass(ALL, herostrAll)
SetHeroClass(IMP, herostrEmp)
else
end

-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- 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", 100)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 5)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoldierAnimation", 900)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:TDS\\TDS.lvl", "TDS_conquest")
ReadDataFile("dc:TDS\\tat1.lvl", "tat1_conquest")
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
AddCameraShot(0.906136, -0.116214, 0.403404, 0.051737, -309.639801, 30.941639, 121.537041);

AddCameraShot(0.983436, -0.082039, -0.161070, -0.013437, -120.546829, 23.164709, 115.404213);
AddCameraShot(-0.388369, -0.015572, -0.920633, 0.036914, -79.814339, 18.477957, 154.671814);
AddCameraShot(-0.049420, 0.001219, -0.998473, -0.024638, -127.077797, 23.053442, -42.468227);
AddCameraShot(0.894305, 0.040977, -0.445111, 0.020395, -270.660736, 14.216214, 105.867706);
AddCameraShot(0.798602, 0.040403, 0.599735, -0.030342, -203.025803, 24.507858, 169.962845);
AddCameraShot(-0.432969, 0.026587, -0.899323, -0.055224, 31.364191, 12.099824, 128.130707);
AddCameraShot(0.062538, -0.000352, -0.998027, -0.005617, -160.603210, 6.261599, -223.010620);
AddCameraShot(0.970116, -0.013466, -0.242244, -0.003363, -279.433777, 26.094082, 34.852585);

end
[/code]
Post Reply