Annoying lua problem
Posted: Wed Feb 18, 2015 1:03 pm
by Anakin
Hi,
i have an realy annoying problem, but i cannot find the problem.
When playing Coruscant conquest you all know the personal stats and careere stats are not displayed. Additionaly i have no idea why on the game stats all textes are shown but not the button text personal stat.
Now i added a new gamemod TDM and CTF. I have the same problem for both gametypes:
Some of you may know this bug. I had it a time ago for the conquest mod, too. But i don't know how it was fixed. This problem apears when you disable textes from the HUD with my Tutorial. But for the TDM and CTF mod the personal stats are shown correctly.
So in the best way i can combinate the both gametypes to fix the ligh thing and display the whol personal and careere stats.
It's obvious that the different can only be in these lua files. I think there need to be something different in calling/reading (dc:)common.lvl or (dc:)core.lvl files.
I cannot find any differences, but maybe some of you can find it.
cor1r_con.lua:
cor1r_tdm.lua:
Objective.lua
ObjectiveTDM.lua
ObjectiveConquest.lua
http://pastebin.com/vRn1DfJj
common.req
http://pastebin.com/0f7xzkuj
mission.req
http://pastebin.com/T1Tnn61p
i have an realy annoying problem, but i cannot find the problem.
When playing Coruscant conquest you all know the personal stats and careere stats are not displayed. Additionaly i have no idea why on the game stats all textes are shown but not the button text personal stat.
Hidden/Spoiler:
Hidden/Spoiler:
So in the best way i can combinate the both gametypes to fix the ligh thing and display the whol personal and careere stats.
It's obvious that the different can only be in these lua files. I think there need to be something different in calling/reading (dc:)common.lvl or (dc:)core.lvl files.
I cannot find any differences, but maybe some of you can find it.
cor1r_con.lua:
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- load the gametype script
Conquest = ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
ReadDataFile("dc:common.lvl")
ReadDataFile("common.lvl")
-- These variables do not change
ATT = 1
DEF = 2
CLONES = 3
JEDI = 4
-- Empire Attacking (attacker is always #1)
CIS = ATT
REP = DEF
---------------------------------------------------------------------------
-- 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 ScriptPostLoad()
AddDeathRegion("death")
AddDeathRegion("death1")
AddDeathRegion("death2")
AddDeathRegion("death3")
AddDeathRegion("death4")
SetProperty ("LibCase1","MaxHealth",1000)
SetProperty ("LibCase2","MaxHealth",1000)
SetProperty ("LibCase3","MaxHealth",1000)
SetProperty ("LibCase4","MaxHealth",1000)
SetProperty ("LibCase5","MaxHealth",1000)
SetProperty ("LibCase6","MaxHealth",1000)
SetProperty ("LibCase7","MaxHealth",1000)
SetProperty ("LibCase8","MaxHealth",1000)
SetProperty ("LibCase9","MaxHealth",1000)
SetProperty ("LibCase10","MaxHealth",1000)
SetProperty ("LibCase11","MaxHealth",1000)
SetProperty ("LibCase12","MaxHealth",1000)
SetProperty ("LibCase13","MaxHealth",1000)
SetProperty ("LibCase14","MaxHealth",1000)
SetProperty ("LibCase1","CurHealth",1000)
SetProperty ("LibCase2","CurHealth",1000)
SetProperty ("LibCase3","CurHealth",1000)
SetProperty ("LibCase4","CurHealth",1000)
SetProperty ("LibCase5","CurHealth",1000)
SetProperty ("LibCase6","CurHealth",1000)
SetProperty ("LibCase7","CurHealth",1000)
SetProperty ("LibCase8","CurHealth",1000)
SetProperty ("LibCase9","CurHealth",1000)
SetProperty ("LibCase10","CurHealth",1000)
SetProperty ("LibCase11","CurHealth",1000)
SetProperty ("LibCase12","CurHealth",1000)
SetProperty ("LibCase13","CurHealth",1000)
SetProperty ("LibCase14","CurHealth",1000)
EnableSPHeroRules()
DisableBarriers("SideDoor1")
DisableBarriers("MainLibraryDoors")
DisableBarriers("SideDoor2")
DisableBarriers("SIdeDoor3")
DisableBarriers("ComputerRoomDoor1")
DisableBarriers("StarChamberDoor1")
DisableBarriers("StarChamberDoor2")
DisableBarriers("WarRoomDoor1")
DisableBarriers("WarRoomDoor2")
DisableBarriers("WarRoomDoor3")
PlayAnimation("DoorOpen01")
PlayAnimation("DoorOpen02")
--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()
SetUberMode(1)
SetProperty("cp1", "AllyPath", "CP1SpawnPath")
SetProperty("cp2", "AllyPath", "CP2SpawnPath")
SetProperty("cp3", "AllyPath", "CP3SpawnPath")
SetProperty("cp4", "AllyPath", "CP4SpawnPath")
SetProperty("cp5", "AllyPath", "CP5SpawnPath")
SetProperty("cp6", "AllyPath", "CP6SpawnPath")
end
function ScriptInit()
ReadDataFile("dc:Load\\RCM_Load.lvl")
-- Designers, these two lines *MUST* be first.
SetPS2ModelMemory(4056000)
SetMapNorthAngle(180, 1)
SetMaxFlyHeight(25)
SetMaxPlayerFlyHeight (25)
AISnipeSuitabilityDist(30)
SetMemoryPoolSize("ParticleTransformer::ColorTrans", 3000)
SetMemoryPoolSize("ParticleTransformer::PositionTr", 2500)
SetMemoryPoolSize("ParticleTransformer::SizeTransf", 2500)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 150)
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
SetMemoryPoolSize("Music", 33)
SetTeamAggressiveness(REP, 0.1)
SetTeamAggressiveness(CIS, 1.0)
local screenWidth, screenHeight = ScriptCB_GetScreenInfo()
local aspectRatio = screenWidth / screenHeight
ReadDataFile("dc:SIDE\\fpanimset.lvl")
if aspectRatio <= 1.4 then
print("RCM_loading: Aspect Ratio 4:3 detected")
ReadDataFile("dc:HUD\\hud43.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
elseif aspectRatio <= 1.63 and aspectRatio >= 1.5 then
print("RCM_loading: Aspect Ratio 16:10 detected")
ReadDataFile("dc:HUD\\hud1610.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
elseif aspectRatio <= 1.9 and aspectRatio >= 1.63 then
print("RCM_loading: Aspect Ratio 16:9 detected")
ReadDataFile("dc:HUD\\hud169.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
else
print("RCM_loading: Aspect Ratio unkown. Loading stock HUD.")
ReadDataFile("dc:HUD\\hudUnknown.lvl")
ReadDataFile("ingame.lvl")
end
ReadDataFile("dc:sound\\rcm.lvl;comSnd")
ReadDataFile("dc:sound\\rcm.lvl")
ReadDataFile("sound\\cor.lvl;cor1cw")
ReadDataFile("SIDE\\jed.lvl",
"jed_knight_01",
"jed_knight_02",
"jed_knight_03",
"jed_master_01",
"jed_master_02")
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_commando_01_rifleman",
"rep_inf_commando_02_roketeer",
"rep_inf_commando_03_sniper",
"rep_inf_commando_04_engineer",
"rep_inf_commando_05_electronic",
"rep_inf_commando_06_sergeant",
"rep_inf_commando_07_havoc",
"rep_inf_commando_08_elite")
ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_b1_rifleman",
"cis_inf_b1_rocketeer",
"cis_inf_b1_sniper",
"cis_inf_sbd",
"cis_inf_magnaguard",
"cis_inf_droideka")
ReadDataFile("dc:SIDE\\mdo.lvl",
"mdo_inf_assassin",
"mdo_inf_officer")
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_laser")
ReadDataFile("dc:SIDE\\tnd.lvl",
"tnd_inf_slaver",
"tnd_inf_mercenary")
ReadDataFile("dc:SIDE\\rrl.lvl",
"rrl_inf_ep2_rifleman",
"rrl_inf_ep2_commander",
"rrl_inf_ep2_jettrooper")
TrandoOrMando = math.random(1,10)
if TrandoOrMando < 6 then
SetupTeams{
rep = {
team = REP,
units = 16,
reinforcements = 150,
soldier = { "rep_inf_commando_01_rifleman",9, 25},
assault = { "rep_inf_commando_02_roketeer",1,4},
sniper = { "rep_inf_commando_03_sniper",1,4},
engineer= { "rep_inf_commando_04_engineer",1,4},
officer = { "rep_inf_commando_05_electronic",1,4},
special = { "rep_inf_commando_06_sergeant",1,4},
commander={ "rep_inf_commando_07_havoc", 1, 4},
general = { "rep_inf_commando_08_elite", 1, 2}
},
cis = {
team = CIS,
units = 32,
reinforcements = 300,
soldier = {"cis_inf_b1_rifleman",10, 30},
assault = {"cis_inf_b1_rocketeer",1, 4},
sniper = {"cis_inf_b1_sniper",1, 4},
engineer= {"mdo_inf_assassin",1, 3},
officer = {"cis_inf_sbd",1, 2},
special = {"mdo_inf_officer",1, 2},
commander={"cis_inf_droideka", 1, 2},
general = {"cis_inf_magnaguard", 1, 2}
}
}
end
if TrandoOrMando > 5 then
SetupTeams{
rep = {
team = REP,
units = 16,
reinforcements = 150,
soldier = { "rep_inf_commando_01_rifleman",9, 25},
assault = { "rep_inf_commando_02_roketeer",1,4},
sniper = { "rep_inf_commando_03_sniper",1,4},
engineer= { "rep_inf_commando_04_engineer",1,4},
officer = { "rep_inf_commando_05_electronic",1,4},
special = { "rep_inf_commando_06_sergeant",1,4},
commander={ "rep_inf_commando_07_havoc", 1, 4},
general = { "rep_inf_commando_08_elite", 1, 2}
},
cis = {
team = CIS,
units = 32,
reinforcements = 300,
soldier = {"cis_inf_b1_rifleman",10, 30},
assault = {"cis_inf_b1_rocketeer",1, 4},
sniper = {"cis_inf_b1_sniper",1, 4},
engineer= {"tnd_inf_mercenary",1, 3},
officer = {"cis_inf_sbd",1, 2},
special = {"tnd_inf_slaver",1, 2},
commander={"cis_inf_droideka", 1, 2},
general = {"cis_inf_magnaguard", 1, 2}
}
}
end
-- Jedi ---------------------------
SetTeamName (4, "jedi")
AddUnitClass(4, "jed_knight_01",2)
AddUnitClass(4, "jed_knight_02",2)
AddUnitClass(4, "jed_knight_03",2)
AddUnitClass(4, "jed_master_01",1)
AddUnitClass(4, "jed_master_02",1)
SetUnitCount (4,
AddAIGoal(JEDI, "Deathmatch", 100)
SetTeamAsFriend(4,REP)
SetTeamAsEnemy(4,CIS)
SetTeamAsFriend(4,3)
SetTeamAsFriend(REP,4)
SetTeamAsEnemy(CIS,4)
SetTeamAsFriend(3,4)
-----------------------------------
-- Clones -------------------------
SetTeamName (3, "clone")
AddUnitClass (3, "rrl_inf_ep2_rifleman", 6)
AddUnitClass(3, "rrl_inf_ep2_commander",1)
SetUnitCount (3, 7)
AddAIGoal(CLONES, "Deathmatch", 100)
SetTeamAsFriend(3,REP)
SetTeamAsEnemy(3,CIS)
SetTeamAsFriend(REP,3)
SetTeamAsEnemy(CIS,3)
-----------------------------------
-- Level Stats
ClearWalkers()
AddWalkerType(0, 3) -- 8 droidekas (special case: 0 leg pairs)
AddWalkerType(1, 0) --
AddWalkerType(2, 0) -- 2 spider walkers with 2 leg pairs each
AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
local weaponCnt = 450
SetMemoryPoolSize("Aimer", 22)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 250)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 50)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntitySoundStream", 10)
SetMemoryPoolSize("EntitySoundStatic", 0)
SetMemoryPoolSize("MountedTurret",100)
SetMemoryPoolSize("PathFollower", 100)
SetMemoryPoolSize("Navigator", 100)
SetMemoryPoolSize("Obstacle", 375)
SetMemoryPoolSize("SoundSpaceRegion", 38)
SetMemoryPoolSize("TentacleSimulator", 0)
SetMemoryPoolSize("TreeGridStack", 140)
SetMemoryPoolSize("UnitAgent", 150)
SetMemoryPoolSize("UnitController", 100)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("EntityFlyer", 4)
SetMemoryPoolSize("SoldierAnimation", 700)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("cor\\cor1.lvl","cor1_Conquest")
SetDenseEnvironment("True")
-- SetMaxFlyHeight(25)
-- SetMaxPlayerFlyHeight (25)
AddDeathRegion("DeathRegion1")
-- Sound Stats
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("dc:sound\\rcm.lvl", "rcm_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\cor.lvl", "cor1")
OpenAudioStream("sound\\cor.lvl", "cor1")
-- OpenAudioStream("sound\\cor.lvl", "cor1_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)
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(2, "Repleaving")
SetOutOfBoundsVoiceOver(1, "Cisleaving")
SetAmbientMusic(REP, 1.0, "rep_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_amb_end", 2,1)
SetVictoryMusic(REP, "rep_cor_amb_victory")
SetDefeatMusic (REP, "rep_cor_amb_defeat")
SetVictoryMusic(CIS, "cis_cor_amb_victory")
SetDefeatMusic (CIS, "cis_cor_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
--Tat 1 - Dune Sea
AddCameraShot(0.419938, 0.002235, -0.907537, 0.004830, -15.639358, 5.499980, -176.911179);
AddCameraShot(0.994506, 0.104463, -0.006739, 0.000708, 1.745251, 5.499980, -118.700668);
AddCameraShot(0.008929, -0.001103, -0.992423, -0.122538, 1.366768, 16.818106, -114.422173);
AddCameraShot(0.761751, -0.117873, -0.629565, -0.097419, 59.861904, 16.818106, -81.607773);
AddCameraShot(0.717110, -0.013583, 0.696703, 0.013197, 98.053314, 11.354497, -85.857857);
AddCameraShot(0.360958, -0.001053, -0.932577, -0.002721, 69.017578, 18.145807, -56.992413);
AddCameraShot(-0.385976, 0.014031, -0.921793, -0.033508, 93.111061, 18.145807, -20.164375);
AddCameraShot(0.695468, -0.129569, -0.694823, -0.129448, 27.284357, 18.145807, -12.377695);
AddCameraShot(0.009002, -0.000795, -0.996084, -0.087945, 1.931320, 13.356332, -16.410583);
AddCameraShot(0.947720, -0.145318, 0.280814, 0.043058, 11.650738, 16.955814, 28.359180);
AddCameraShot(0.686380, -0.127550, 0.703919, 0.130810, -30.096384, 11.152356, -63.235146);
AddCameraShot(0.937945, -0.108408, 0.327224, 0.037821, -43.701199, 8.756138, -49.974789);
AddCameraShot(0.531236, -0.079466, -0.834207, -0.124787, -62.491230, 10.305247, -120.102989);
AddCameraShot(0.452286, -0.179031, -0.812390, -0.321572, -50.015198, 15.394646, -114.879379);
AddCameraShot(0.927563, -0.243751, 0.273918, 0.071982, 26.149965, 26.947924, -46.834148);
if aspectRatio <= 1.4 then
ReadDataFile("dc:SIDE\\43.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
elseif aspectRatio <= 1.63 and aspectRatio >= 1.5 then
ReadDataFile("dc:SIDE\\1610.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
elseif aspectRatio <= 1.9 and aspectRatio >= 1.63 then
ReadDataFile("dc:SIDE\\169.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
else
ReadDataFile("dc:SIDE\\unkown.lvl")
end
end
[/code]
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- load the gametype script
Conquest = ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
ReadDataFile("dc:common.lvl")
ReadDataFile("common.lvl")
-- These variables do not change
ATT = 1
DEF = 2
CLONES = 3
JEDI = 4
-- Empire Attacking (attacker is always #1)
CIS = ATT
REP = DEF
---------------------------------------------------------------------------
-- 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 ScriptPostLoad()
AddDeathRegion("death")
AddDeathRegion("death1")
AddDeathRegion("death2")
AddDeathRegion("death3")
AddDeathRegion("death4")
SetProperty ("LibCase1","MaxHealth",1000)
SetProperty ("LibCase2","MaxHealth",1000)
SetProperty ("LibCase3","MaxHealth",1000)
SetProperty ("LibCase4","MaxHealth",1000)
SetProperty ("LibCase5","MaxHealth",1000)
SetProperty ("LibCase6","MaxHealth",1000)
SetProperty ("LibCase7","MaxHealth",1000)
SetProperty ("LibCase8","MaxHealth",1000)
SetProperty ("LibCase9","MaxHealth",1000)
SetProperty ("LibCase10","MaxHealth",1000)
SetProperty ("LibCase11","MaxHealth",1000)
SetProperty ("LibCase12","MaxHealth",1000)
SetProperty ("LibCase13","MaxHealth",1000)
SetProperty ("LibCase14","MaxHealth",1000)
SetProperty ("LibCase1","CurHealth",1000)
SetProperty ("LibCase2","CurHealth",1000)
SetProperty ("LibCase3","CurHealth",1000)
SetProperty ("LibCase4","CurHealth",1000)
SetProperty ("LibCase5","CurHealth",1000)
SetProperty ("LibCase6","CurHealth",1000)
SetProperty ("LibCase7","CurHealth",1000)
SetProperty ("LibCase8","CurHealth",1000)
SetProperty ("LibCase9","CurHealth",1000)
SetProperty ("LibCase10","CurHealth",1000)
SetProperty ("LibCase11","CurHealth",1000)
SetProperty ("LibCase12","CurHealth",1000)
SetProperty ("LibCase13","CurHealth",1000)
SetProperty ("LibCase14","CurHealth",1000)
EnableSPHeroRules()
DisableBarriers("SideDoor1")
DisableBarriers("MainLibraryDoors")
DisableBarriers("SideDoor2")
DisableBarriers("SIdeDoor3")
DisableBarriers("ComputerRoomDoor1")
DisableBarriers("StarChamberDoor1")
DisableBarriers("StarChamberDoor2")
DisableBarriers("WarRoomDoor1")
DisableBarriers("WarRoomDoor2")
DisableBarriers("WarRoomDoor3")
PlayAnimation("DoorOpen01")
PlayAnimation("DoorOpen02")
--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()
SetUberMode(1)
SetProperty("cp1", "AllyPath", "CP1SpawnPath")
SetProperty("cp2", "AllyPath", "CP2SpawnPath")
SetProperty("cp3", "AllyPath", "CP3SpawnPath")
SetProperty("cp4", "AllyPath", "CP4SpawnPath")
SetProperty("cp5", "AllyPath", "CP5SpawnPath")
SetProperty("cp6", "AllyPath", "CP6SpawnPath")
end
function ScriptInit()
ReadDataFile("dc:Load\\RCM_Load.lvl")
-- Designers, these two lines *MUST* be first.
SetPS2ModelMemory(4056000)
SetMapNorthAngle(180, 1)
SetMaxFlyHeight(25)
SetMaxPlayerFlyHeight (25)
AISnipeSuitabilityDist(30)
SetMemoryPoolSize("ParticleTransformer::ColorTrans", 3000)
SetMemoryPoolSize("ParticleTransformer::PositionTr", 2500)
SetMemoryPoolSize("ParticleTransformer::SizeTransf", 2500)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 150)
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
SetMemoryPoolSize("Music", 33)
SetTeamAggressiveness(REP, 0.1)
SetTeamAggressiveness(CIS, 1.0)
local screenWidth, screenHeight = ScriptCB_GetScreenInfo()
local aspectRatio = screenWidth / screenHeight
ReadDataFile("dc:SIDE\\fpanimset.lvl")
if aspectRatio <= 1.4 then
print("RCM_loading: Aspect Ratio 4:3 detected")
ReadDataFile("dc:HUD\\hud43.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
elseif aspectRatio <= 1.63 and aspectRatio >= 1.5 then
print("RCM_loading: Aspect Ratio 16:10 detected")
ReadDataFile("dc:HUD\\hud1610.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
elseif aspectRatio <= 1.9 and aspectRatio >= 1.63 then
print("RCM_loading: Aspect Ratio 16:9 detected")
ReadDataFile("dc:HUD\\hud169.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
else
print("RCM_loading: Aspect Ratio unkown. Loading stock HUD.")
ReadDataFile("dc:HUD\\hudUnknown.lvl")
ReadDataFile("ingame.lvl")
end
ReadDataFile("dc:sound\\rcm.lvl;comSnd")
ReadDataFile("dc:sound\\rcm.lvl")
ReadDataFile("sound\\cor.lvl;cor1cw")
ReadDataFile("SIDE\\jed.lvl",
"jed_knight_01",
"jed_knight_02",
"jed_knight_03",
"jed_master_01",
"jed_master_02")
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_commando_01_rifleman",
"rep_inf_commando_02_roketeer",
"rep_inf_commando_03_sniper",
"rep_inf_commando_04_engineer",
"rep_inf_commando_05_electronic",
"rep_inf_commando_06_sergeant",
"rep_inf_commando_07_havoc",
"rep_inf_commando_08_elite")
ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_b1_rifleman",
"cis_inf_b1_rocketeer",
"cis_inf_b1_sniper",
"cis_inf_sbd",
"cis_inf_magnaguard",
"cis_inf_droideka")
ReadDataFile("dc:SIDE\\mdo.lvl",
"mdo_inf_assassin",
"mdo_inf_officer")
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_laser")
ReadDataFile("dc:SIDE\\tnd.lvl",
"tnd_inf_slaver",
"tnd_inf_mercenary")
ReadDataFile("dc:SIDE\\rrl.lvl",
"rrl_inf_ep2_rifleman",
"rrl_inf_ep2_commander",
"rrl_inf_ep2_jettrooper")
TrandoOrMando = math.random(1,10)
if TrandoOrMando < 6 then
SetupTeams{
rep = {
team = REP,
units = 16,
reinforcements = 150,
soldier = { "rep_inf_commando_01_rifleman",9, 25},
assault = { "rep_inf_commando_02_roketeer",1,4},
sniper = { "rep_inf_commando_03_sniper",1,4},
engineer= { "rep_inf_commando_04_engineer",1,4},
officer = { "rep_inf_commando_05_electronic",1,4},
special = { "rep_inf_commando_06_sergeant",1,4},
commander={ "rep_inf_commando_07_havoc", 1, 4},
general = { "rep_inf_commando_08_elite", 1, 2}
},
cis = {
team = CIS,
units = 32,
reinforcements = 300,
soldier = {"cis_inf_b1_rifleman",10, 30},
assault = {"cis_inf_b1_rocketeer",1, 4},
sniper = {"cis_inf_b1_sniper",1, 4},
engineer= {"mdo_inf_assassin",1, 3},
officer = {"cis_inf_sbd",1, 2},
special = {"mdo_inf_officer",1, 2},
commander={"cis_inf_droideka", 1, 2},
general = {"cis_inf_magnaguard", 1, 2}
}
}
end
if TrandoOrMando > 5 then
SetupTeams{
rep = {
team = REP,
units = 16,
reinforcements = 150,
soldier = { "rep_inf_commando_01_rifleman",9, 25},
assault = { "rep_inf_commando_02_roketeer",1,4},
sniper = { "rep_inf_commando_03_sniper",1,4},
engineer= { "rep_inf_commando_04_engineer",1,4},
officer = { "rep_inf_commando_05_electronic",1,4},
special = { "rep_inf_commando_06_sergeant",1,4},
commander={ "rep_inf_commando_07_havoc", 1, 4},
general = { "rep_inf_commando_08_elite", 1, 2}
},
cis = {
team = CIS,
units = 32,
reinforcements = 300,
soldier = {"cis_inf_b1_rifleman",10, 30},
assault = {"cis_inf_b1_rocketeer",1, 4},
sniper = {"cis_inf_b1_sniper",1, 4},
engineer= {"tnd_inf_mercenary",1, 3},
officer = {"cis_inf_sbd",1, 2},
special = {"tnd_inf_slaver",1, 2},
commander={"cis_inf_droideka", 1, 2},
general = {"cis_inf_magnaguard", 1, 2}
}
}
end
-- Jedi ---------------------------
SetTeamName (4, "jedi")
AddUnitClass(4, "jed_knight_01",2)
AddUnitClass(4, "jed_knight_02",2)
AddUnitClass(4, "jed_knight_03",2)
AddUnitClass(4, "jed_master_01",1)
AddUnitClass(4, "jed_master_02",1)
SetUnitCount (4,
AddAIGoal(JEDI, "Deathmatch", 100)
SetTeamAsFriend(4,REP)
SetTeamAsEnemy(4,CIS)
SetTeamAsFriend(4,3)
SetTeamAsFriend(REP,4)
SetTeamAsEnemy(CIS,4)
SetTeamAsFriend(3,4)
-----------------------------------
-- Clones -------------------------
SetTeamName (3, "clone")
AddUnitClass (3, "rrl_inf_ep2_rifleman", 6)
AddUnitClass(3, "rrl_inf_ep2_commander",1)
SetUnitCount (3, 7)
AddAIGoal(CLONES, "Deathmatch", 100)
SetTeamAsFriend(3,REP)
SetTeamAsEnemy(3,CIS)
SetTeamAsFriend(REP,3)
SetTeamAsEnemy(CIS,3)
-----------------------------------
-- Level Stats
ClearWalkers()
AddWalkerType(0, 3) -- 8 droidekas (special case: 0 leg pairs)
AddWalkerType(1, 0) --
AddWalkerType(2, 0) -- 2 spider walkers with 2 leg pairs each
AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
local weaponCnt = 450
SetMemoryPoolSize("Aimer", 22)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 250)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 50)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntitySoundStream", 10)
SetMemoryPoolSize("EntitySoundStatic", 0)
SetMemoryPoolSize("MountedTurret",100)
SetMemoryPoolSize("PathFollower", 100)
SetMemoryPoolSize("Navigator", 100)
SetMemoryPoolSize("Obstacle", 375)
SetMemoryPoolSize("SoundSpaceRegion", 38)
SetMemoryPoolSize("TentacleSimulator", 0)
SetMemoryPoolSize("TreeGridStack", 140)
SetMemoryPoolSize("UnitAgent", 150)
SetMemoryPoolSize("UnitController", 100)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("EntityFlyer", 4)
SetMemoryPoolSize("SoldierAnimation", 700)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("cor\\cor1.lvl","cor1_Conquest")
SetDenseEnvironment("True")
-- SetMaxFlyHeight(25)
-- SetMaxPlayerFlyHeight (25)
AddDeathRegion("DeathRegion1")
-- Sound Stats
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("dc:sound\\rcm.lvl", "rcm_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\cor.lvl", "cor1")
OpenAudioStream("sound\\cor.lvl", "cor1")
-- OpenAudioStream("sound\\cor.lvl", "cor1_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)
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(2, "Repleaving")
SetOutOfBoundsVoiceOver(1, "Cisleaving")
SetAmbientMusic(REP, 1.0, "rep_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_amb_end", 2,1)
SetVictoryMusic(REP, "rep_cor_amb_victory")
SetDefeatMusic (REP, "rep_cor_amb_defeat")
SetVictoryMusic(CIS, "cis_cor_amb_victory")
SetDefeatMusic (CIS, "cis_cor_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
--Tat 1 - Dune Sea
AddCameraShot(0.419938, 0.002235, -0.907537, 0.004830, -15.639358, 5.499980, -176.911179);
AddCameraShot(0.994506, 0.104463, -0.006739, 0.000708, 1.745251, 5.499980, -118.700668);
AddCameraShot(0.008929, -0.001103, -0.992423, -0.122538, 1.366768, 16.818106, -114.422173);
AddCameraShot(0.761751, -0.117873, -0.629565, -0.097419, 59.861904, 16.818106, -81.607773);
AddCameraShot(0.717110, -0.013583, 0.696703, 0.013197, 98.053314, 11.354497, -85.857857);
AddCameraShot(0.360958, -0.001053, -0.932577, -0.002721, 69.017578, 18.145807, -56.992413);
AddCameraShot(-0.385976, 0.014031, -0.921793, -0.033508, 93.111061, 18.145807, -20.164375);
AddCameraShot(0.695468, -0.129569, -0.694823, -0.129448, 27.284357, 18.145807, -12.377695);
AddCameraShot(0.009002, -0.000795, -0.996084, -0.087945, 1.931320, 13.356332, -16.410583);
AddCameraShot(0.947720, -0.145318, 0.280814, 0.043058, 11.650738, 16.955814, 28.359180);
AddCameraShot(0.686380, -0.127550, 0.703919, 0.130810, -30.096384, 11.152356, -63.235146);
AddCameraShot(0.937945, -0.108408, 0.327224, 0.037821, -43.701199, 8.756138, -49.974789);
AddCameraShot(0.531236, -0.079466, -0.834207, -0.124787, -62.491230, 10.305247, -120.102989);
AddCameraShot(0.452286, -0.179031, -0.812390, -0.321572, -50.015198, 15.394646, -114.879379);
AddCameraShot(0.927563, -0.243751, 0.273918, 0.071982, 26.149965, 26.947924, -46.834148);
if aspectRatio <= 1.4 then
ReadDataFile("dc:SIDE\\43.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
elseif aspectRatio <= 1.63 and aspectRatio >= 1.5 then
ReadDataFile("dc:SIDE\\1610.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
elseif aspectRatio <= 1.9 and aspectRatio >= 1.63 then
ReadDataFile("dc:SIDE\\169.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
else
ReadDataFile("dc:SIDE\\unkown.lvl")
end
end
[/code]
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- load the gametype script
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")
ReadDataFile("dc:common.lvl")
ReadDataFile("common.lvl")
REP = 1
CIS = 2
-- These variables do not change
ATT = CIS
DEF = REP
---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{ teamATT = ATT,
teamDEF = DEF,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2",
multiplayerRules = true,
isCelebrityDeathmatch = true
}
TDM:Start()
AddAIGoal(REP, "Deathmatch", 100)
AddAIGoal(CIS, "Deathmatch", 100)
AddDeathRegion("death")
AddDeathRegion("death1")
AddDeathRegion("death2")
AddDeathRegion("death3")
AddDeathRegion("death4")
SetProperty("cp1", "Team", CIS) -- Bib
SetProperty("cp2", "Team", CIS) -- Terrasse
SetProperty("cp3", "Team", REP) -- Ratsraum
SetProperty("cp4", "Team", CIS) -- Technikraum
SetProperty("cp5", "Team", REP) -- Sternenkammer
SetProperty("cp6", "Team", REP) -- Überwachungsraum
SetProperty("cp1", "CaptureRegion", "") -- Bib
SetProperty("cp2", "CaptureRegion", "") -- Terrasse
SetProperty("cp3", "CaptureRegion", "") -- Ratsraum
SetProperty("cp4", "CaptureRegion", "") -- Technikraum
SetProperty("cp5", "CaptureRegion", "") -- Sternenkammer
SetProperty("cp6", "CaptureRegion", "") -- Überwachungsraum
SetProperty("cp1", "ControlRegion", "") -- Bib
SetProperty("cp2", "ControlRegion", "") -- Terrasse
SetProperty("cp3", "ControlRegion", "") -- Ratsraum
SetProperty("cp4", "ControlRegion", "") -- Technikraum
SetProperty("cp5", "ControlRegion", "") -- Sternenkammer
SetProperty("cp6", "ControlRegion", "") -- Überwachungsraum
SetProperty ("LibCase1","MaxHealth",1000)
SetProperty ("LibCase2","MaxHealth",1000)
SetProperty ("LibCase3","MaxHealth",1000)
SetProperty ("LibCase4","MaxHealth",1000)
SetProperty ("LibCase5","MaxHealth",1000)
SetProperty ("LibCase6","MaxHealth",1000)
SetProperty ("LibCase7","MaxHealth",1000)
SetProperty ("LibCase8","MaxHealth",1000)
SetProperty ("LibCase9","MaxHealth",1000)
SetProperty ("LibCase10","MaxHealth",1000)
SetProperty ("LibCase11","MaxHealth",1000)
SetProperty ("LibCase12","MaxHealth",1000)
SetProperty ("LibCase13","MaxHealth",1000)
SetProperty ("LibCase14","MaxHealth",1000)
SetProperty ("LibCase1","CurHealth",1000)
SetProperty ("LibCase2","CurHealth",1000)
SetProperty ("LibCase3","CurHealth",1000)
SetProperty ("LibCase4","CurHealth",1000)
SetProperty ("LibCase5","CurHealth",1000)
SetProperty ("LibCase6","CurHealth",1000)
SetProperty ("LibCase7","CurHealth",1000)
SetProperty ("LibCase8","CurHealth",1000)
SetProperty ("LibCase9","CurHealth",1000)
SetProperty ("LibCase10","CurHealth",1000)
SetProperty ("LibCase11","CurHealth",1000)
SetProperty ("LibCase12","CurHealth",1000)
SetProperty ("LibCase13","CurHealth",1000)
SetProperty ("LibCase14","CurHealth",1000)
SetProperty ("tur_bldg_laser8","CurHealth",800)
SetProperty ("tur_bldg_laser13","CurHealth",800)
SetProperty ("tur_bldg_laser14","CurHealth",800)
SetProperty ("tur_bldg_laser15","CurHealth",800)
SetProperty ("tur_bldg_laser16","CurHealth",800)
SetProperty ("tur_bldg_laser17","CurHealth",800)
SetProperty ("tur_bldg_laser18","CurHealth",800)
SetProperty ("tur_bldg_laser19","CurHealth",800)
SetProperty ("tur_bldg_laser20","CurHealth",800)
SetProperty ("tur_bldg_laser34","CurHealth",800)
SetProperty ("tur_bldg_laser89","CurHealth",800)
DisableBarriers("SideDoor1")
DisableBarriers("MainLibraryDoors")
DisableBarriers("SideDoor2")
DisableBarriers("SIdeDoor3")
DisableBarriers("ComputerRoomDoor1")
DisableBarriers("StarChamberDoor1")
DisableBarriers("StarChamberDoor2")
DisableBarriers("WarRoomDoor1")
DisableBarriers("WarRoomDoor2")
DisableBarriers("WarRoomDoor3")
PlayAnimation("DoorOpen01")
PlayAnimation("DoorOpen02")
end
---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()
ReadDataFile("dc:Load\\RCM_Load.lvl")
StealArtistHeap(1536*1024)
-- Designers, these two lines *MUST* be first!
SetPS2ModelMemory(2097152 + 65536 *
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
local screenWidth, screenHeight = ScriptCB_GetScreenInfo()
local aspectRatio = screenWidth / screenHeight
ReadDataFile("dc:SIDE\\fpanimset.lvl")
if aspectRatio <= 1.4 then
print("RCM_loading: Aspect Ratio 4:3 detected")
ReadDataFile("dc:HUD\\hud43.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
elseif aspectRatio <= 1.63 and aspectRatio >= 1.5 then
print("RCM_loading: Aspect Ratio 16:10 detected")
ReadDataFile("dc:HUD\\hud1610.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
elseif aspectRatio <= 1.9 and aspectRatio >= 1.63 then
print("RCM_loading: Aspect Ratio 16:9 detected")
ReadDataFile("dc:HUD\\hud169.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
else
print("RCM_loading: Aspect Ratio unkown. Loading stock HUD.")
ReadDataFile("dc:HUD\\hudUnknown.lvl")
ReadDataFile("ingame.lvl")
end
SetMapNorthAngle(180, 1)
SetMaxFlyHeight(25)
SetMaxPlayerFlyHeight (25)
AISnipeSuitabilityDist(30)
SetMemoryPoolSize("Music", 33)
ReadDataFile("dc:sound\\rcm.lvl;comSnd")
ReadDataFile("dc:sound\\rcm.lvl")
ReadDataFile("sound\\cor.lvl;cor1cw")
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_laser")
ReadDataFile("SIDE\\rep.lvl",
"rep_fly_assault_DOME",
"rep_fly_gunship_DOME")
ReadDataFile("SIDE\\cis.lvl",
"cis_fly_droidfighter_DOME")
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_commando_01_rifleman",
"rep_inf_commando_03_sniper",
"rep_inf_commando_04_engineer",
"rep_inf_commando_06_sergeant")
ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_b1_rifleman",
"cis_inf_b1_sniper")
ReadDataFile("dc:SIDE\\mdo.lvl",
"mdo_inf_assassin",
"mdo_inf_officer")
ReadDataFile("dc:SIDE\\tnd.lvl",
"tnd_inf_slaver",
"tnd_inf_mercenary")
TrandoOrMando = math.random(1,10)
if TrandoOrMando < 6 then
SetupTeams{
rep = {
team = REP,
units = 16,
reinforcements = -1,
soldier = { "rep_inf_commando_01_rifleman",9, 25},
sniper = { "rep_inf_commando_03_sniper",1,4},
engineer= { "rep_inf_commando_04_engineer",1,4},
special = { "rep_inf_commando_06_sergeant",1,4}
},
cis = {
team = CIS,
units = 16,
reinforcements = -1,
soldier = {"cis_inf_b1_rifleman",10, 30},
sniper = {"cis_inf_b1_sniper",1, 4},
engineer= {"mdo_inf_assassin",1, 3},
special = {"mdo_inf_officer",1, 2}
}
}
end
if TrandoOrMando > 5 then
SetupTeams{
rep = {
team = REP,
units = 16,
reinforcements = -1,
soldier = { "rep_inf_commando_01_rifleman",9, 25},
sniper = { "rep_inf_commando_03_sniper",1,4},
engineer= { "rep_inf_commando_04_engineer",1,4},
special = { "rep_inf_commando_06_sergeant",1,4}
},
cis = {
team = CIS,
units = 16,
reinforcements = -1,
soldier = {"cis_inf_b1_rifleman",10, 30},
sniper = {"cis_inf_b1_sniper",1, 4},
engineer= {"tnd_inf_mercenary",1, 3},
special = {"tnd_inf_slaver",1, 2}
}
}
end
-- Level Stats
ClearWalkers()
AddWalkerType(0, 3) -- 8 droidekas (special case: 0 leg pairs)
AddWalkerType(1, 0) --
AddWalkerType(2, 0) -- 2 spider walkers with 2 leg pairs each
AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
local weaponCnt = 450
SetMemoryPoolSize("Aimer", 22)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 250)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 18)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntitySoundStream", 10)
SetMemoryPoolSize("EntitySoundStatic", 0)
SetMemoryPoolSize("MountedTurret",100)
SetMemoryPoolSize("PathFollower", 100)
SetMemoryPoolSize("Navigator", 100)
SetMemoryPoolSize("Obstacle", 375)
SetMemoryPoolSize("SoundSpaceRegion", 38)
SetMemoryPoolSize("TentacleSimulator", 0)
SetMemoryPoolSize("TreeGridStack", 140)
SetMemoryPoolSize("UnitAgent", 150)
SetMemoryPoolSize("UnitController", 100)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("EntityFlyer", 4)
SetMemoryPoolSize("ColorTrans", 2500)
SetMemoryPoolSize("SizeTransf", 1800)
SetMemoryPoolSize("PositionTr", 1500)
SetMemoryPoolSize("SoldierAnimation", 580)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("cor\\cor1.lvl","cor1_Conquest")
SetDenseEnvironment("True")
-- SetMaxFlyHeight(25)
--SetMaxPlayerFlyHeight (25)
AddDeathRegion("DeathRegion1")
-- Sound Stats
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("dc:sound\\rcm.lvl", "rcm_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\cor.lvl", "cor1")
OpenAudioStream("sound\\cor.lvl", "cor1")
-- OpenAudioStream("sound\\cor.lvl", "cor1_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)
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(2, "Repleaving")
SetOutOfBoundsVoiceOver(1, "Cisleaving")
SetAmbientMusic(REP, 1.0, "rep_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_amb_end", 2,1)
SetVictoryMusic(REP, "rep_cor_amb_victory")
SetDefeatMusic (REP, "rep_cor_amb_defeat")
SetVictoryMusic(CIS, "cis_cor_amb_victory")
SetDefeatMusic (CIS, "cis_cor_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
--Tat 1 - Dune Sea
AddCameraShot(0.419938, 0.002235, -0.907537, 0.004830, -15.639358, 5.499980, -176.911179);
AddCameraShot(0.994506, 0.104463, -0.006739, 0.000708, 1.745251, 5.499980, -118.700668);
AddCameraShot(0.008929, -0.001103, -0.992423, -0.122538, 1.366768, 16.818106, -114.422173);
AddCameraShot(0.761751, -0.117873, -0.629565, -0.097419, 59.861904, 16.818106, -81.607773);
AddCameraShot(0.717110, -0.013583, 0.696703, 0.013197, 98.053314, 11.354497, -85.857857);
AddCameraShot(0.360958, -0.001053, -0.932577, -0.002721, 69.017578, 18.145807, -56.992413);
AddCameraShot(-0.385976, 0.014031, -0.921793, -0.033508, 93.111061, 18.145807, -20.164375);
AddCameraShot(0.695468, -0.129569, -0.694823, -0.129448, 27.284357, 18.145807, -12.377695);
AddCameraShot(0.009002, -0.000795, -0.996084, -0.087945, 1.931320, 13.356332, -16.410583);
AddCameraShot(0.947720, -0.145318, 0.280814, 0.043058, 11.650738, 16.955814, 28.359180);
AddCameraShot(0.686380, -0.127550, 0.703919, 0.130810, -30.096384, 11.152356, -63.235146);
AddCameraShot(0.937945, -0.108408, 0.327224, 0.037821, -43.701199, 8.756138, -49.974789);
AddCameraShot(0.531236, -0.079466, -0.834207, -0.124787, -62.491230, 10.305247, -120.102989);
AddCameraShot(0.452286, -0.179031, -0.812390, -0.321572, -50.015198, 15.394646, -114.879379);
AddCameraShot(0.927563, -0.243751, 0.273918, 0.071982, 26.149965, 26.947924, -46.834148);
if aspectRatio <= 1.4 then
ReadDataFile("dc:SIDE\\43.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
elseif aspectRatio <= 1.63 and aspectRatio >= 1.5 then
ReadDataFile("dc:SIDE\\1610.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
elseif aspectRatio <= 1.9 and aspectRatio >= 1.63 then
ReadDataFile("dc:SIDE\\169.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
else
ReadDataFile("dc:SIDE\\unkown.lvl")
end
end
[/code]
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- load the gametype script
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")
ReadDataFile("dc:common.lvl")
ReadDataFile("common.lvl")
REP = 1
CIS = 2
-- These variables do not change
ATT = CIS
DEF = REP
---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{ teamATT = ATT,
teamDEF = DEF,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2",
multiplayerRules = true,
isCelebrityDeathmatch = true
}
TDM:Start()
AddAIGoal(REP, "Deathmatch", 100)
AddAIGoal(CIS, "Deathmatch", 100)
AddDeathRegion("death")
AddDeathRegion("death1")
AddDeathRegion("death2")
AddDeathRegion("death3")
AddDeathRegion("death4")
SetProperty("cp1", "Team", CIS) -- Bib
SetProperty("cp2", "Team", CIS) -- Terrasse
SetProperty("cp3", "Team", REP) -- Ratsraum
SetProperty("cp4", "Team", CIS) -- Technikraum
SetProperty("cp5", "Team", REP) -- Sternenkammer
SetProperty("cp6", "Team", REP) -- Überwachungsraum
SetProperty("cp1", "CaptureRegion", "") -- Bib
SetProperty("cp2", "CaptureRegion", "") -- Terrasse
SetProperty("cp3", "CaptureRegion", "") -- Ratsraum
SetProperty("cp4", "CaptureRegion", "") -- Technikraum
SetProperty("cp5", "CaptureRegion", "") -- Sternenkammer
SetProperty("cp6", "CaptureRegion", "") -- Überwachungsraum
SetProperty("cp1", "ControlRegion", "") -- Bib
SetProperty("cp2", "ControlRegion", "") -- Terrasse
SetProperty("cp3", "ControlRegion", "") -- Ratsraum
SetProperty("cp4", "ControlRegion", "") -- Technikraum
SetProperty("cp5", "ControlRegion", "") -- Sternenkammer
SetProperty("cp6", "ControlRegion", "") -- Überwachungsraum
SetProperty ("LibCase1","MaxHealth",1000)
SetProperty ("LibCase2","MaxHealth",1000)
SetProperty ("LibCase3","MaxHealth",1000)
SetProperty ("LibCase4","MaxHealth",1000)
SetProperty ("LibCase5","MaxHealth",1000)
SetProperty ("LibCase6","MaxHealth",1000)
SetProperty ("LibCase7","MaxHealth",1000)
SetProperty ("LibCase8","MaxHealth",1000)
SetProperty ("LibCase9","MaxHealth",1000)
SetProperty ("LibCase10","MaxHealth",1000)
SetProperty ("LibCase11","MaxHealth",1000)
SetProperty ("LibCase12","MaxHealth",1000)
SetProperty ("LibCase13","MaxHealth",1000)
SetProperty ("LibCase14","MaxHealth",1000)
SetProperty ("LibCase1","CurHealth",1000)
SetProperty ("LibCase2","CurHealth",1000)
SetProperty ("LibCase3","CurHealth",1000)
SetProperty ("LibCase4","CurHealth",1000)
SetProperty ("LibCase5","CurHealth",1000)
SetProperty ("LibCase6","CurHealth",1000)
SetProperty ("LibCase7","CurHealth",1000)
SetProperty ("LibCase8","CurHealth",1000)
SetProperty ("LibCase9","CurHealth",1000)
SetProperty ("LibCase10","CurHealth",1000)
SetProperty ("LibCase11","CurHealth",1000)
SetProperty ("LibCase12","CurHealth",1000)
SetProperty ("LibCase13","CurHealth",1000)
SetProperty ("LibCase14","CurHealth",1000)
SetProperty ("tur_bldg_laser8","CurHealth",800)
SetProperty ("tur_bldg_laser13","CurHealth",800)
SetProperty ("tur_bldg_laser14","CurHealth",800)
SetProperty ("tur_bldg_laser15","CurHealth",800)
SetProperty ("tur_bldg_laser16","CurHealth",800)
SetProperty ("tur_bldg_laser17","CurHealth",800)
SetProperty ("tur_bldg_laser18","CurHealth",800)
SetProperty ("tur_bldg_laser19","CurHealth",800)
SetProperty ("tur_bldg_laser20","CurHealth",800)
SetProperty ("tur_bldg_laser34","CurHealth",800)
SetProperty ("tur_bldg_laser89","CurHealth",800)
DisableBarriers("SideDoor1")
DisableBarriers("MainLibraryDoors")
DisableBarriers("SideDoor2")
DisableBarriers("SIdeDoor3")
DisableBarriers("ComputerRoomDoor1")
DisableBarriers("StarChamberDoor1")
DisableBarriers("StarChamberDoor2")
DisableBarriers("WarRoomDoor1")
DisableBarriers("WarRoomDoor2")
DisableBarriers("WarRoomDoor3")
PlayAnimation("DoorOpen01")
PlayAnimation("DoorOpen02")
end
---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()
ReadDataFile("dc:Load\\RCM_Load.lvl")
StealArtistHeap(1536*1024)
-- Designers, these two lines *MUST* be first!
SetPS2ModelMemory(2097152 + 65536 *
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
local screenWidth, screenHeight = ScriptCB_GetScreenInfo()
local aspectRatio = screenWidth / screenHeight
ReadDataFile("dc:SIDE\\fpanimset.lvl")
if aspectRatio <= 1.4 then
print("RCM_loading: Aspect Ratio 4:3 detected")
ReadDataFile("dc:HUD\\hud43.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
elseif aspectRatio <= 1.63 and aspectRatio >= 1.5 then
print("RCM_loading: Aspect Ratio 16:10 detected")
ReadDataFile("dc:HUD\\hud1610.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
elseif aspectRatio <= 1.9 and aspectRatio >= 1.63 then
print("RCM_loading: Aspect Ratio 16:9 detected")
ReadDataFile("dc:HUD\\hud169.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
else
print("RCM_loading: Aspect Ratio unkown. Loading stock HUD.")
ReadDataFile("dc:HUD\\hudUnknown.lvl")
ReadDataFile("ingame.lvl")
end
SetMapNorthAngle(180, 1)
SetMaxFlyHeight(25)
SetMaxPlayerFlyHeight (25)
AISnipeSuitabilityDist(30)
SetMemoryPoolSize("Music", 33)
ReadDataFile("dc:sound\\rcm.lvl;comSnd")
ReadDataFile("dc:sound\\rcm.lvl")
ReadDataFile("sound\\cor.lvl;cor1cw")
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_laser")
ReadDataFile("SIDE\\rep.lvl",
"rep_fly_assault_DOME",
"rep_fly_gunship_DOME")
ReadDataFile("SIDE\\cis.lvl",
"cis_fly_droidfighter_DOME")
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_commando_01_rifleman",
"rep_inf_commando_03_sniper",
"rep_inf_commando_04_engineer",
"rep_inf_commando_06_sergeant")
ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_b1_rifleman",
"cis_inf_b1_sniper")
ReadDataFile("dc:SIDE\\mdo.lvl",
"mdo_inf_assassin",
"mdo_inf_officer")
ReadDataFile("dc:SIDE\\tnd.lvl",
"tnd_inf_slaver",
"tnd_inf_mercenary")
TrandoOrMando = math.random(1,10)
if TrandoOrMando < 6 then
SetupTeams{
rep = {
team = REP,
units = 16,
reinforcements = -1,
soldier = { "rep_inf_commando_01_rifleman",9, 25},
sniper = { "rep_inf_commando_03_sniper",1,4},
engineer= { "rep_inf_commando_04_engineer",1,4},
special = { "rep_inf_commando_06_sergeant",1,4}
},
cis = {
team = CIS,
units = 16,
reinforcements = -1,
soldier = {"cis_inf_b1_rifleman",10, 30},
sniper = {"cis_inf_b1_sniper",1, 4},
engineer= {"mdo_inf_assassin",1, 3},
special = {"mdo_inf_officer",1, 2}
}
}
end
if TrandoOrMando > 5 then
SetupTeams{
rep = {
team = REP,
units = 16,
reinforcements = -1,
soldier = { "rep_inf_commando_01_rifleman",9, 25},
sniper = { "rep_inf_commando_03_sniper",1,4},
engineer= { "rep_inf_commando_04_engineer",1,4},
special = { "rep_inf_commando_06_sergeant",1,4}
},
cis = {
team = CIS,
units = 16,
reinforcements = -1,
soldier = {"cis_inf_b1_rifleman",10, 30},
sniper = {"cis_inf_b1_sniper",1, 4},
engineer= {"tnd_inf_mercenary",1, 3},
special = {"tnd_inf_slaver",1, 2}
}
}
end
-- Level Stats
ClearWalkers()
AddWalkerType(0, 3) -- 8 droidekas (special case: 0 leg pairs)
AddWalkerType(1, 0) --
AddWalkerType(2, 0) -- 2 spider walkers with 2 leg pairs each
AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
local weaponCnt = 450
SetMemoryPoolSize("Aimer", 22)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 250)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 18)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntitySoundStream", 10)
SetMemoryPoolSize("EntitySoundStatic", 0)
SetMemoryPoolSize("MountedTurret",100)
SetMemoryPoolSize("PathFollower", 100)
SetMemoryPoolSize("Navigator", 100)
SetMemoryPoolSize("Obstacle", 375)
SetMemoryPoolSize("SoundSpaceRegion", 38)
SetMemoryPoolSize("TentacleSimulator", 0)
SetMemoryPoolSize("TreeGridStack", 140)
SetMemoryPoolSize("UnitAgent", 150)
SetMemoryPoolSize("UnitController", 100)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("EntityFlyer", 4)
SetMemoryPoolSize("ColorTrans", 2500)
SetMemoryPoolSize("SizeTransf", 1800)
SetMemoryPoolSize("PositionTr", 1500)
SetMemoryPoolSize("SoldierAnimation", 580)
SetSpawnDelay(10.0, 0.25)
ReadDataFile("cor\\cor1.lvl","cor1_Conquest")
SetDenseEnvironment("True")
-- SetMaxFlyHeight(25)
--SetMaxPlayerFlyHeight (25)
AddDeathRegion("DeathRegion1")
-- Sound Stats
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("dc:sound\\rcm.lvl", "rcm_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\cor.lvl", "cor1")
OpenAudioStream("sound\\cor.lvl", "cor1")
-- OpenAudioStream("sound\\cor.lvl", "cor1_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)
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(2, "Repleaving")
SetOutOfBoundsVoiceOver(1, "Cisleaving")
SetAmbientMusic(REP, 1.0, "rep_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_amb_end", 2,1)
SetVictoryMusic(REP, "rep_cor_amb_victory")
SetDefeatMusic (REP, "rep_cor_amb_defeat")
SetVictoryMusic(CIS, "cis_cor_amb_victory")
SetDefeatMusic (CIS, "cis_cor_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
--Tat 1 - Dune Sea
AddCameraShot(0.419938, 0.002235, -0.907537, 0.004830, -15.639358, 5.499980, -176.911179);
AddCameraShot(0.994506, 0.104463, -0.006739, 0.000708, 1.745251, 5.499980, -118.700668);
AddCameraShot(0.008929, -0.001103, -0.992423, -0.122538, 1.366768, 16.818106, -114.422173);
AddCameraShot(0.761751, -0.117873, -0.629565, -0.097419, 59.861904, 16.818106, -81.607773);
AddCameraShot(0.717110, -0.013583, 0.696703, 0.013197, 98.053314, 11.354497, -85.857857);
AddCameraShot(0.360958, -0.001053, -0.932577, -0.002721, 69.017578, 18.145807, -56.992413);
AddCameraShot(-0.385976, 0.014031, -0.921793, -0.033508, 93.111061, 18.145807, -20.164375);
AddCameraShot(0.695468, -0.129569, -0.694823, -0.129448, 27.284357, 18.145807, -12.377695);
AddCameraShot(0.009002, -0.000795, -0.996084, -0.087945, 1.931320, 13.356332, -16.410583);
AddCameraShot(0.947720, -0.145318, 0.280814, 0.043058, 11.650738, 16.955814, 28.359180);
AddCameraShot(0.686380, -0.127550, 0.703919, 0.130810, -30.096384, 11.152356, -63.235146);
AddCameraShot(0.937945, -0.108408, 0.327224, 0.037821, -43.701199, 8.756138, -49.974789);
AddCameraShot(0.531236, -0.079466, -0.834207, -0.124787, -62.491230, 10.305247, -120.102989);
AddCameraShot(0.452286, -0.179031, -0.812390, -0.321572, -50.015198, 15.394646, -114.879379);
AddCameraShot(0.927563, -0.243751, 0.273918, 0.071982, 26.149965, 26.947924, -46.834148);
if aspectRatio <= 1.4 then
ReadDataFile("dc:SIDE\\43.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
elseif aspectRatio <= 1.63 and aspectRatio >= 1.5 then
ReadDataFile("dc:SIDE\\1610.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
elseif aspectRatio <= 1.9 and aspectRatio >= 1.63 then
ReadDataFile("dc:SIDE\\169.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
else
ReadDataFile("dc:SIDE\\unkown.lvl")
end
end
[/code]
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
if not __OBJECTIVE_LUA__ then
__OBJECTIVE_LUA__ = 1
--
-- Base class for all mission objective types
--
Objective =
{
--fields that need to be specified on creation
teamATT = 1,
teamDEF = 2,
text = nil, --the text that shows up for both teams. This overrides textATT and textDEF!
textATT = nil, --the text that shows up for the attackers
textDEF = nil, --the text that shows up for the defenders
popupText = nil, --the text that goes in the popup when the objective starts. if not defined, will not show a popup. only works if multiplayerRules == false
multiplayerRules = false, --if set to true, then the objective will be set up to use special multiplayer rules, otherwise
-- will run with single player/coop rules.
--optional fields
timeLimit = 0, --How long (in seconds) before the objective ends. If set to <= 0, then the timer is disabled
timeLimitWinningTeam = 1, --Indicates which team completes the objective when the time runs out
--fields that are handled internally
isComplete = false, winningTeam = 0,
hideCPs = false,
showTeamPoints = nil,
AIGoalWeight = 1.0,
}
function Objective:New(o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end
--
-- DESIGNERS: Override this function when you want to customize extra behavior when an objective is activated
-- (ask a lua coder if you need help with this...it's really pretty easy)
--
function Objective:OnStart()
end
--
-- DESIGNERS: Override this function when you want to customize extra behavior when an objective is finished
-- (ask a lua coder if you need help with this...it's really pretty easy)
--
function Objective:OnComplete(winningTeam)
--ReadDataFile("core.lvl")
end
--
-- Call this to notify the C++ code that the objective exists, and wants to be added to the list of selectable objectives
--
function Objective:AddToDisplayableList()
if self.text then
--Kind of kludgy, but for campaign the designers will use self.text
--to uniquely ID the objective. So all this does is set up an objective for
--the attacking team (the human players are always on teamATT in the campaign)
AddMissionObjective(self.teamATT, self.text, self.popupText)
else
if self.textATT then
AddMissionObjective(self.teamATT, self.textATT, self.popupText)
end
if self.textDEF then
AddMissionObjective(self.teamDEF, self.textDEF, self.popupText)
end
end
end
function Objective:AddHint(hintText)
self.hints = self.hints or {}
table.insert(self.hints, hintText)
end
function Objective:GetGameTimeLimit()
return 0
end
function Objective:GameOptionsTimeLimitUp()
end
--
-- Call this to activate the objective after you have created an instance of the objective (using Objective:New)
--
function Objective:Start()
--initialize values for data fields (even if they don't exist)
self.teamATT = self.teamATT or 1
self.teamDEF = self.teamDEF or 2
self.isComplete = false
self.winningTeam = self.teamDEF
self.timeLimit = self.timeLimit or 0
self.timeLimitWinningTeam = self.timeLimitWinningTeam or self.teamATT
self.AIGoalWeight = self.AIGoalWeight or 1.0
SetFlagGameplayType("none")
if self.multiplayerRules then
self.usingGameOptionsTimeLimit = self:GetGameTimeLimit()
if ( self.usingGameOptionsTimeLimit ~= 0 ) then
self.timeLimit = self.usingGameOptionsTimeLimit
end
else
self.usingGameOptionsTimeLimit = 0
end
if self.hideCPs then
-- turn off the command posts display on the minimap
MapHideCommandPosts()
end
--activate all the mission hints for this objective
if self.hints then
for i, hintText in self.hints do
AddMissionHint(hintText)
end
end
if not self.container then
--If there's a container, then the container will handle this logic.
--Otherwise, we need to handle it ourselves.
self:AddToDisplayableList()
ClearAIGoals(self.teamATT)
ClearAIGoals(self.teamDEF)
end
if self.showTeamPoints then
ShowTeamPoints(self.teamATT, true)
ShowTeamPoints(self.teamDEF, true)
end
--notify the c++ code that the objective exists
if self.text then
ActivateObjective(self.text)
else
if self.textATT then
ActivateObjective(self.textATT)
end
if self.textDEF then
ActivateObjective(self.textDEF)
end
end
--show the popup for singleplayer/co-op
if not self.multiplayerRules and self.popupText then
ShowObjectiveTextPopup(self.popupText)
end
if self.timeLimit > 0 then
--get or create a new loseTimer (this ensures there's only one "loseTimer" in the game at one time)
self.loseTimer = FindTimer("loseTimer")
if not self.loseTimer then
self.loseTimer = CreateTimer("loseTimer")
end
--start ticking down the time
SetTimerValue(self.loseTimer, self.timeLimit)
StartTimer(self.loseTimer)
ShowTimer(self.loseTimer)
end
--=================================
--Event Responses
--=================================
if not self.container then
--reduce reinforcement count on character death
OnCharacterDeath(
function (character, killer)
local charTeam = GetCharacterTeam(character)
if GetReinforcementCount(charTeam) > 0 then
AddReinforcements(charTeam, -1)
end
end
)
--If a team runs out of reinforcements, they lose right away.
--If you want to disable the reinforcement countdown,
--call SetReinforcementCount(teamID, -1)
OnTicketCountChange(
function (team, count)
if count <= 0 then
MissionDefeat(team)
end
end
)
end
--if we have a loseTimer, make one of the teams complete the objective when it runs out
if self.loseTimer then
OnTimerElapse(
function(timer)
if self.isComplete then
return
end
if self.usingGameOptionsTimeLimit ~= 0 then
self:GameOptionsTimeLimitUp()
else
self:Complete(self.timeLimitWinningTeam)
end
end,
self.loseTimer
)
end
--callback for overriding startup behavior
self:OnStart()
end
--
-- If a container is set, then it takes over some of the logic that occurs when an objective is completed,
-- which allows for more complicated completion logic (like concurrent objectives and chains of objectives).
-- See: MultiObjectiveContainer.lua for details
--
function Objective:SetContainer(container)
self.container = container
end
--
-- Call this to finish the objective. First, it looks to see if it has a container, then lets the container
-- handle the logic, otherwise will set the MissionVictory on its own
--
function Objective:Complete(winningTeam)
if self.isComplete then return end
--unhide the CPs
MapHideCommandPosts(false)
self.isComplete = true
self.winningTeam = winningTeam
if self.loseTimer then
ShowTimer(nil)
DestroyTimer(self.loseTimer)
self.loseTimer = nil
end
--clean up all the AIGoals for this objective
if self.AIGoals then
for i, goalPtr in ipairs(self.AIGoals) do
DeleteAIGoal(goalPtr)
end
end
--play a little ditty
if not self.multiplayerRules then
BroadcastVoiceOver("common_objComplete", self.winningTeam)
end
--delay the actual objective end by a smidge to allow time for the ditty to finish playing
--(since the designers tend to call other voiceovers from OnComplete)
self.dittyTimer = FindTimer("dittyTimer")
if not self.dittyTimer then
self.dittyTimer = CreateTimer("dittyTimer")
end
SetTimerValue(self.dittyTimer, 1.0)
StartTimer(self.dittyTimer)
self.dittyTimerResponse = OnTimerElapse(
function(timer)
--update the objective's state in the c++ code
if self.text then
CompleteObjective(self.text)
else
if self.textATT then
CompleteObjective(self.textATT)
end
if self.textDEF then
CompleteObjective(self.textDEF)
end
end
if self.container then
self.container:NotifyObjectiveComplete(self)
else
MissionVictory(winningTeam)
end
self:OnComplete(winningTeam)
StopTimer(self.dittyTimer)
print("release self.dittyTimerResponse")
ReleaseTimerElapse(self.dittyTimerResponse)
self.dittyTimerResponse = nil
end,
self.dittyTimer
)
end
end --if not __OBJECTIVE_LUA__
[/code]
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
if not __OBJECTIVE_LUA__ then
__OBJECTIVE_LUA__ = 1
--
-- Base class for all mission objective types
--
Objective =
{
--fields that need to be specified on creation
teamATT = 1,
teamDEF = 2,
text = nil, --the text that shows up for both teams. This overrides textATT and textDEF!
textATT = nil, --the text that shows up for the attackers
textDEF = nil, --the text that shows up for the defenders
popupText = nil, --the text that goes in the popup when the objective starts. if not defined, will not show a popup. only works if multiplayerRules == false
multiplayerRules = false, --if set to true, then the objective will be set up to use special multiplayer rules, otherwise
-- will run with single player/coop rules.
--optional fields
timeLimit = 0, --How long (in seconds) before the objective ends. If set to <= 0, then the timer is disabled
timeLimitWinningTeam = 1, --Indicates which team completes the objective when the time runs out
--fields that are handled internally
isComplete = false, winningTeam = 0,
hideCPs = false,
showTeamPoints = nil,
AIGoalWeight = 1.0,
}
function Objective:New(o)
o = o or {}
setmetatable(o, self)
self.__index = self
return o
end
--
-- DESIGNERS: Override this function when you want to customize extra behavior when an objective is activated
-- (ask a lua coder if you need help with this...it's really pretty easy)
--
function Objective:OnStart()
end
--
-- DESIGNERS: Override this function when you want to customize extra behavior when an objective is finished
-- (ask a lua coder if you need help with this...it's really pretty easy)
--
function Objective:OnComplete(winningTeam)
--ReadDataFile("core.lvl")
end
--
-- Call this to notify the C++ code that the objective exists, and wants to be added to the list of selectable objectives
--
function Objective:AddToDisplayableList()
if self.text then
--Kind of kludgy, but for campaign the designers will use self.text
--to uniquely ID the objective. So all this does is set up an objective for
--the attacking team (the human players are always on teamATT in the campaign)
AddMissionObjective(self.teamATT, self.text, self.popupText)
else
if self.textATT then
AddMissionObjective(self.teamATT, self.textATT, self.popupText)
end
if self.textDEF then
AddMissionObjective(self.teamDEF, self.textDEF, self.popupText)
end
end
end
function Objective:AddHint(hintText)
self.hints = self.hints or {}
table.insert(self.hints, hintText)
end
function Objective:GetGameTimeLimit()
return 0
end
function Objective:GameOptionsTimeLimitUp()
end
--
-- Call this to activate the objective after you have created an instance of the objective (using Objective:New)
--
function Objective:Start()
--initialize values for data fields (even if they don't exist)
self.teamATT = self.teamATT or 1
self.teamDEF = self.teamDEF or 2
self.isComplete = false
self.winningTeam = self.teamDEF
self.timeLimit = self.timeLimit or 0
self.timeLimitWinningTeam = self.timeLimitWinningTeam or self.teamATT
self.AIGoalWeight = self.AIGoalWeight or 1.0
SetFlagGameplayType("none")
if self.multiplayerRules then
self.usingGameOptionsTimeLimit = self:GetGameTimeLimit()
if ( self.usingGameOptionsTimeLimit ~= 0 ) then
self.timeLimit = self.usingGameOptionsTimeLimit
end
else
self.usingGameOptionsTimeLimit = 0
end
if self.hideCPs then
-- turn off the command posts display on the minimap
MapHideCommandPosts()
end
--activate all the mission hints for this objective
if self.hints then
for i, hintText in self.hints do
AddMissionHint(hintText)
end
end
if not self.container then
--If there's a container, then the container will handle this logic.
--Otherwise, we need to handle it ourselves.
self:AddToDisplayableList()
ClearAIGoals(self.teamATT)
ClearAIGoals(self.teamDEF)
end
if self.showTeamPoints then
ShowTeamPoints(self.teamATT, true)
ShowTeamPoints(self.teamDEF, true)
end
--notify the c++ code that the objective exists
if self.text then
ActivateObjective(self.text)
else
if self.textATT then
ActivateObjective(self.textATT)
end
if self.textDEF then
ActivateObjective(self.textDEF)
end
end
--show the popup for singleplayer/co-op
if not self.multiplayerRules and self.popupText then
ShowObjectiveTextPopup(self.popupText)
end
if self.timeLimit > 0 then
--get or create a new loseTimer (this ensures there's only one "loseTimer" in the game at one time)
self.loseTimer = FindTimer("loseTimer")
if not self.loseTimer then
self.loseTimer = CreateTimer("loseTimer")
end
--start ticking down the time
SetTimerValue(self.loseTimer, self.timeLimit)
StartTimer(self.loseTimer)
ShowTimer(self.loseTimer)
end
--=================================
--Event Responses
--=================================
if not self.container then
--reduce reinforcement count on character death
OnCharacterDeath(
function (character, killer)
local charTeam = GetCharacterTeam(character)
if GetReinforcementCount(charTeam) > 0 then
AddReinforcements(charTeam, -1)
end
end
)
--If a team runs out of reinforcements, they lose right away.
--If you want to disable the reinforcement countdown,
--call SetReinforcementCount(teamID, -1)
OnTicketCountChange(
function (team, count)
if count <= 0 then
MissionDefeat(team)
end
end
)
end
--if we have a loseTimer, make one of the teams complete the objective when it runs out
if self.loseTimer then
OnTimerElapse(
function(timer)
if self.isComplete then
return
end
if self.usingGameOptionsTimeLimit ~= 0 then
self:GameOptionsTimeLimitUp()
else
self:Complete(self.timeLimitWinningTeam)
end
end,
self.loseTimer
)
end
--callback for overriding startup behavior
self:OnStart()
end
--
-- If a container is set, then it takes over some of the logic that occurs when an objective is completed,
-- which allows for more complicated completion logic (like concurrent objectives and chains of objectives).
-- See: MultiObjectiveContainer.lua for details
--
function Objective:SetContainer(container)
self.container = container
end
--
-- Call this to finish the objective. First, it looks to see if it has a container, then lets the container
-- handle the logic, otherwise will set the MissionVictory on its own
--
function Objective:Complete(winningTeam)
if self.isComplete then return end
--unhide the CPs
MapHideCommandPosts(false)
self.isComplete = true
self.winningTeam = winningTeam
if self.loseTimer then
ShowTimer(nil)
DestroyTimer(self.loseTimer)
self.loseTimer = nil
end
--clean up all the AIGoals for this objective
if self.AIGoals then
for i, goalPtr in ipairs(self.AIGoals) do
DeleteAIGoal(goalPtr)
end
end
--play a little ditty
if not self.multiplayerRules then
BroadcastVoiceOver("common_objComplete", self.winningTeam)
end
--delay the actual objective end by a smidge to allow time for the ditty to finish playing
--(since the designers tend to call other voiceovers from OnComplete)
self.dittyTimer = FindTimer("dittyTimer")
if not self.dittyTimer then
self.dittyTimer = CreateTimer("dittyTimer")
end
SetTimerValue(self.dittyTimer, 1.0)
StartTimer(self.dittyTimer)
self.dittyTimerResponse = OnTimerElapse(
function(timer)
--update the objective's state in the c++ code
if self.text then
CompleteObjective(self.text)
else
if self.textATT then
CompleteObjective(self.textATT)
end
if self.textDEF then
CompleteObjective(self.textDEF)
end
end
if self.container then
self.container:NotifyObjectiveComplete(self)
else
MissionVictory(winningTeam)
end
self:OnComplete(winningTeam)
StopTimer(self.dittyTimer)
print("release self.dittyTimerResponse")
ReleaseTimerElapse(self.dittyTimerResponse)
self.dittyTimerResponse = nil
end,
self.dittyTimer
)
end
end --if not __OBJECTIVE_LUA__
[/code]
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
ScriptCB_DoFile("Objective")
--=============================
-- ObjectiveTDM
-- Handles the logic for a team deathmatch game
-- Aaaactually, this has morphed into the Hunt gametype (at the last minute, hence the lack of name-change), but only in multiplayer/instant-action mode
--=============================
ObjectiveTDM = Objective:New
{
-- external values
pointsPerKillATT = 1,
pointsPerKillDEF = 1,
pointsPerTeamKill = -1,
isCelebrityDeathmatch = false, -- exactly what it sounds like.
isUberMode = false, -- ditto
uberScoreLimit = 400, -- score limit for, get this, uber mode
}
function ObjectiveTDM:GetGameTimeLimit()
if ( self.isCelebrityDeathmatch or self.isUberMode) then
return 0
else
return ScriptCB_GetHuntMaxTimeLimit()
end
end
function ObjectiveTDM:GameOptionsTimeLimitUp()
local team1pts = GetTeamPoints(1)
local team2pts = GetTeamPoints(2)
if ( team1pts > team2pts ) then
MissionVictory(1)
elseif ( team1pts < team2pts ) then
MissionVictory(2)
else
--tied, so victory for both
MissionVictory({1,2})
end
end
function ObjectiveTDM:Start()
if ( self.isCelebrityDeathmatch == true ) then
ScriptCB_SetNumBots(ScriptCB_GetASSNumBots())
end
--===============================
-- Initialization logic
--===============================
--initialize the base objective data first
Objective.Start(self)
if self.multiplayerRules then
ShowTeamPoints(self.teamATT, true)
ShowTeamPoints(self.teamDEF, true)
SetReinforcementCount(self.teamATT, -1)
SetReinforcementCount(self.teamDEF, -1)
SetTeamPoints(self.teamATT, 0)
SetTeamPoints(self.teamDEF, 0)
if ( self.isCelebrityDeathmatch ) then
ScriptCB_ShowHuntScoreLimit(2)
elseif ( self.isUberMode ) then
ScriptCB_ShowHuntScoreLimit(3)
ScriptCB_SetUberScoreLimit(self.uberScoreLimit)
else
ScriptCB_ShowHuntScoreLimit(1)
end
end
--set AI goals
self.AIGoals = {}
if self.AIGoalWeight > 0.0 then
table.insert(self.AIGoals, AddAIGoal(self.teamATT, "Deathmatch", 100*self.AIGoalWeight))
table.insert(self.AIGoals, AddAIGoal(self.teamDEF, "Deathmatch", 100*self.AIGoalWeight))
end
--=======================================
-- Event responses
--=======================================
--when used in multiplayer, TDM will count points upwards until a score limit is reached
if self.multiplayerRules then
local eventResponseCharacterDeath = OnCharacterDeath(
function(character, killer)
if not killer then return end --no points for suicides
local victimTeam = GetCharacterTeam(character)
local killerTeam = GetCharacterTeam(killer)
if victimTeam == killerTeam then
AddTeamPoints(killerTeam, self.pointsPerTeamKill)
return -- negative points for killing guys on your team
end
if killerTeam == self.teamATT then
AddTeamPoints(killerTeam, self.pointsPerKillATT)
elseif killerTeam == self.teamDEF then
AddTeamPoints(killerTeam, self.pointsPerKillDEF)
end
local scorelimit = ScriptCB_GetHuntScoreLimit()
if ( self.isCelebrityDeathmatch ) then
scorelimit = ScriptCB_GetAssaultScoreLimit()
elseif ( self.isUberMode ) then
scorelimit = ScriptCB_GetUberScoreLimit()
end
if GetTeamPoints(killerTeam) >= scorelimit then
self:Complete(killerTeam)
ReleaseCharacterDeath(eventResponseCharacterDeath)
end
end
)
end
end
[/code]
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
ScriptCB_DoFile("Objective")
--=============================
-- ObjectiveTDM
-- Handles the logic for a team deathmatch game
-- Aaaactually, this has morphed into the Hunt gametype (at the last minute, hence the lack of name-change), but only in multiplayer/instant-action mode
--=============================
ObjectiveTDM = Objective:New
{
-- external values
pointsPerKillATT = 1,
pointsPerKillDEF = 1,
pointsPerTeamKill = -1,
isCelebrityDeathmatch = false, -- exactly what it sounds like.
isUberMode = false, -- ditto
uberScoreLimit = 400, -- score limit for, get this, uber mode
}
function ObjectiveTDM:GetGameTimeLimit()
if ( self.isCelebrityDeathmatch or self.isUberMode) then
return 0
else
return ScriptCB_GetHuntMaxTimeLimit()
end
end
function ObjectiveTDM:GameOptionsTimeLimitUp()
local team1pts = GetTeamPoints(1)
local team2pts = GetTeamPoints(2)
if ( team1pts > team2pts ) then
MissionVictory(1)
elseif ( team1pts < team2pts ) then
MissionVictory(2)
else
--tied, so victory for both
MissionVictory({1,2})
end
end
function ObjectiveTDM:Start()
if ( self.isCelebrityDeathmatch == true ) then
ScriptCB_SetNumBots(ScriptCB_GetASSNumBots())
end
--===============================
-- Initialization logic
--===============================
--initialize the base objective data first
Objective.Start(self)
if self.multiplayerRules then
ShowTeamPoints(self.teamATT, true)
ShowTeamPoints(self.teamDEF, true)
SetReinforcementCount(self.teamATT, -1)
SetReinforcementCount(self.teamDEF, -1)
SetTeamPoints(self.teamATT, 0)
SetTeamPoints(self.teamDEF, 0)
if ( self.isCelebrityDeathmatch ) then
ScriptCB_ShowHuntScoreLimit(2)
elseif ( self.isUberMode ) then
ScriptCB_ShowHuntScoreLimit(3)
ScriptCB_SetUberScoreLimit(self.uberScoreLimit)
else
ScriptCB_ShowHuntScoreLimit(1)
end
end
--set AI goals
self.AIGoals = {}
if self.AIGoalWeight > 0.0 then
table.insert(self.AIGoals, AddAIGoal(self.teamATT, "Deathmatch", 100*self.AIGoalWeight))
table.insert(self.AIGoals, AddAIGoal(self.teamDEF, "Deathmatch", 100*self.AIGoalWeight))
end
--=======================================
-- Event responses
--=======================================
--when used in multiplayer, TDM will count points upwards until a score limit is reached
if self.multiplayerRules then
local eventResponseCharacterDeath = OnCharacterDeath(
function(character, killer)
if not killer then return end --no points for suicides
local victimTeam = GetCharacterTeam(character)
local killerTeam = GetCharacterTeam(killer)
if victimTeam == killerTeam then
AddTeamPoints(killerTeam, self.pointsPerTeamKill)
return -- negative points for killing guys on your team
end
if killerTeam == self.teamATT then
AddTeamPoints(killerTeam, self.pointsPerKillATT)
elseif killerTeam == self.teamDEF then
AddTeamPoints(killerTeam, self.pointsPerKillDEF)
end
local scorelimit = ScriptCB_GetHuntScoreLimit()
if ( self.isCelebrityDeathmatch ) then
scorelimit = ScriptCB_GetAssaultScoreLimit()
elseif ( self.isUberMode ) then
scorelimit = ScriptCB_GetUberScoreLimit()
end
if GetTeamPoints(killerTeam) >= scorelimit then
self:Complete(killerTeam)
ReleaseCharacterDeath(eventResponseCharacterDeath)
end
end
)
end
end
[/code]
http://pastebin.com/vRn1DfJj
common.req
http://pastebin.com/0f7xzkuj
mission.req
http://pastebin.com/T1Tnn61p