Add me
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 = "CHR%s_%s", era_c = 1, mode_con_c = 1, mode_oct_c = 1, change = { mode_oct_c = { name="Octuptarra Combat Tri Droid Boss Battle", about="A Octuptarra Combat Tri Droid Broke of From The Main Battle. Can You Tackle The Beast Alone?"}, era_c = { name="The Clone Wars"}, mode_con = { name="Battle of Christophsis", about="The Battle of Christophsis took place for control of the planet Christophsis during the Clone Wars."},},}
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("CHR","CHRc_con",4)
AddDownloadableContent("CHR","CHRc_oct",4)
-- all done
newEntry = nil
n = nil
-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\CHR\\data\\_LVL_PC\\core.lvl")[/code]
--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 = "CHR%s_%s", era_c = 1, mode_con_c = 1, mode_oct_c = 1, change = { mode_oct_c = { name="Octuptarra Combat Tri Droid Boss Battle", about="A Octuptarra Combat Tri Droid Broke of From The Main Battle. Can You Tackle The Beast Alone?"}, era_c = { name="The Clone Wars"}, mode_con = { name="Battle of Christophsis", about="The Battle of Christophsis took place for control of the planet Christophsis during the Clone Wars."},},}
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("CHR","CHRc_con",4)
AddDownloadableContent("CHR","CHRc_oct",4)
-- all done
newEntry = nil
n = nil
-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\CHR\\data\\_LVL_PC\\core.lvl")[/code]
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
-- CIS Attacking (attacker is always #1)
CIS = 1;
REP = 2;
-- These variables do not change
ATT = CIS;
DEF = REP;
function ScriptPostLoad()
ForceHumansOntoTeam1(0)
DisableAIAutoBalance()
--SetAIDifficulty(10,10,"medium")
--SetAIDifficulty(10,10,"hard")
--SetTeamAggressiveness(CIS, 1.0)
--SetTeamAggressiveness(REP, 1.0)
SetDefenderSnipeRange(170)
SetAttackerSnipeRange(170)
-- This would go into ScriptPostLoad()
-- and you would have one for each team capturing CPs
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
--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:Start()
SetUberMode(1);
EnableSPHeroRules()
AddDeathRegion("deathregion1")
AddDeathRegion("deathregion2")
AddDeathRegion("deathregion3")
AddDeathRegion("deathregion4")
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("dc:Load\\load1.lvl")
ReadDataFile("ingame.lvl")
ForceHumansOntoTeam1(0)
DisableAIAutoBalance()
--SetAIDifficulty(10,10,"medium")
--SetAIDifficulty(10,10,"hard")
--SetTeamAggressiveness(CIS, 1.0)
--SetTeamAggressiveness(REP, 1.0)
SetDefenderSnipeRange(170)
SetAttackerSnipeRange(170)
SetMaxFlyHeight(300)
SetMaxPlayerFlyHeight (300)
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("dc:sound\\CHR.lvl")
ReadDataFile("dc:sound\\UW2.lvl;UW2cw")
ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"cis_inf_sniper",
"cis_inf_officer",
"cis_inf_droideka",
"cis_hero_darthmaul")
ReadDataFile("SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper",
"rep_hero_anakin")
ReadDataFile("dc:Load\\load2.lvl")
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_clone_trooper_C",
"cis_walk_tridroid",
"cis_inf_battle_droid_A")
SetupTeams{
cis = {
team = CIS,
units = 1,
reinforcements = -1,
soldier = {"cis_inf_battle_droid_A",0,0},
},
rep = {
team = REP,
units = 100,
reinforcements = 1500,
soldier = {"rep_inf_clone_trooper_C",1,1},
},
}
-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 25) -- special -> droidekas
AddWalkerType(1, 25) -- 1x2 (1 pair of legs)
AddWalkerType(2, 25) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 25) -- 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", weaponCnt)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", weaponCnt)
SetMemoryPoolSize("UnitController", weaponCnt)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("Music",33)
SetMemoryPoolSize("SoldierAnimation",656)
SetMemoryPoolSize("PathFollower",weaponCnt)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix",2000)
SetMemoryPoolSize("ParticleTransformer::ColorTrans",1648)
SetMemoryPoolSize("ParticleTransformer::PositionTr",2000)
SetMemoryPoolSize("ParticleTransformer::SizeTransf",1165)
SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:CHR\\CHR.lvl", "CHR_death")
ReadDataFile("dc:CHR\\CHR.lvl", "CHR_death")
SetDenseEnvironment("false")
-- Sound
SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_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("dc:sound\\CHR.lvl", "CHR_S")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1")
--OpenAudioStream("sound\\yav.lvl", "yav1_emt")
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)
SetOutOfBoundsVoiceOver(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")
SetAmbientMusic(REP, 1.0, "Christophsis_Soundtrack", 0,1)
--SetAmbientMusic(REP, 0.8, "rep_yav_amb_middle", 1,1)
--SetAmbientMusic(REP, 0.2, "rep_yav_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "Christophsis_Soundtrack", 0,1)
--SetAmbientMusic(CIS, 0.8, "cis_yav_amb_middle", 1,1)
--SetAmbientMusic(CIS, 0.2, "cis_yav_amb_end", 2,1)
SetVictoryMusic(REP, "rep_yav_amb_victory")
SetDefeatMusic (REP, "rep_yav_amb_defeat")
SetVictoryMusic(CIS, "cis_yav_amb_victory")
SetDefeatMusic (CIS, "cis_yav_amb_defeat")
SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("BirdScatter", "birdsFlySeq1")
--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.716522, -0.015740, 0.697219, 0.015316, 511.727753, 14.296076, 2.373827);
end[/code]
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
-- CIS Attacking (attacker is always #1)
CIS = 1;
REP = 2;
-- These variables do not change
ATT = CIS;
DEF = REP;
function ScriptPostLoad()
ForceHumansOntoTeam1(0)
DisableAIAutoBalance()
--SetAIDifficulty(10,10,"medium")
--SetAIDifficulty(10,10,"hard")
--SetTeamAggressiveness(CIS, 1.0)
--SetTeamAggressiveness(REP, 1.0)
SetDefenderSnipeRange(170)
SetAttackerSnipeRange(170)
-- This would go into ScriptPostLoad()
-- and you would have one for each team capturing CPs
--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
--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:Start()
SetUberMode(1);
EnableSPHeroRules()
AddDeathRegion("deathregion1")
AddDeathRegion("deathregion2")
AddDeathRegion("deathregion3")
AddDeathRegion("deathregion4")
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("dc:Load\\load1.lvl")
ReadDataFile("ingame.lvl")
ForceHumansOntoTeam1(0)
DisableAIAutoBalance()
--SetAIDifficulty(10,10,"medium")
--SetAIDifficulty(10,10,"hard")
--SetTeamAggressiveness(CIS, 1.0)
--SetTeamAggressiveness(REP, 1.0)
SetDefenderSnipeRange(170)
SetAttackerSnipeRange(170)
SetMaxFlyHeight(300)
SetMaxPlayerFlyHeight (300)
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("dc:sound\\CHR.lvl")
ReadDataFile("dc:sound\\UW2.lvl;UW2cw")
ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"cis_inf_sniper",
"cis_inf_officer",
"cis_inf_droideka",
"cis_hero_darthmaul")
ReadDataFile("SIDE\\rep.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper",
"rep_hero_anakin")
ReadDataFile("dc:Load\\load2.lvl")
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_clone_trooper_C",
"cis_walk_tridroid",
"cis_inf_battle_droid_A")
SetupTeams{
cis = {
team = CIS,
units = 1,
reinforcements = -1,
soldier = {"cis_inf_battle_droid_A",0,0},
},
rep = {
team = REP,
units = 100,
reinforcements = 1500,
soldier = {"rep_inf_clone_trooper_C",1,1},
},
}
-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 25) -- special -> droidekas
AddWalkerType(1, 25) -- 1x2 (1 pair of legs)
AddWalkerType(2, 25) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 25) -- 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", weaponCnt)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", weaponCnt)
SetMemoryPoolSize("UnitController", weaponCnt)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("Music",33)
SetMemoryPoolSize("SoldierAnimation",656)
SetMemoryPoolSize("PathFollower",weaponCnt)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix",2000)
SetMemoryPoolSize("ParticleTransformer::ColorTrans",1648)
SetMemoryPoolSize("ParticleTransformer::PositionTr",2000)
SetMemoryPoolSize("ParticleTransformer::SizeTransf",1165)
SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:CHR\\CHR.lvl", "CHR_death")
ReadDataFile("dc:CHR\\CHR.lvl", "CHR_death")
SetDenseEnvironment("false")
-- Sound
SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_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("dc:sound\\CHR.lvl", "CHR_S")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1")
--OpenAudioStream("sound\\yav.lvl", "yav1_emt")
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)
SetOutOfBoundsVoiceOver(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")
SetAmbientMusic(REP, 1.0, "Christophsis_Soundtrack", 0,1)
--SetAmbientMusic(REP, 0.8, "rep_yav_amb_middle", 1,1)
--SetAmbientMusic(REP, 0.2, "rep_yav_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "Christophsis_Soundtrack", 0,1)
--SetAmbientMusic(CIS, 0.8, "cis_yav_amb_middle", 1,1)
--SetAmbientMusic(CIS, 0.2, "cis_yav_amb_end", 2,1)
SetVictoryMusic(REP, "rep_yav_amb_victory")
SetDefeatMusic (REP, "rep_yav_amb_defeat")
SetVictoryMusic(CIS, "cis_yav_amb_victory")
SetDefeatMusic (CIS, "cis_yav_amb_defeat")
SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("BirdScatter", "birdsFlySeq1")
--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.716522, -0.015740, 0.697219, 0.015316, 511.727753, 14.296076, 2.373827);
end[/code]