Need help on making a custom game mode

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
modmaster13
General
General
Posts: 777
Joined: Wed Aug 18, 2010 4:23 pm
Games I'm Playing :: COD SWBF
xbox live or psn: KrypticcElementt
Location: Twitter @_KrypticElement
Contact:

Need help on making a custom game mode

Post by modmaster13 »

Hey GT. I'm making a new game mode called "Liberation". It requires the same rules such as capturing command posts, like in conquest. But I am having trouble getting it ingame.

RVHc_lib.lua
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;


function ScriptPostLoad()


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "lib_cp1"}
cp2 = CommandPost:New{name = "lib_cp2"}
cp3 = CommandPost:New{name = "lib_cp3"}
cp4 = CommandPost:New{name = "lib_cp4"}
cp5 = CommandPost:New{name = "lib_cp5"}
cp6 = CommandPost:New{name = "lib_cp6"}
cp7 = CommandPost:New{name = "lib_cp7"}
cp8 = CommandPost:New{name = "lib_cp8"}
cp9 = CommandPost:New{name = "lib_cp9"}



--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:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)
conquest:AddCommandPost(cp9)

conquest:Start()

EnableSPHeroRules()

end


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

ReadDataFile("dc:load\\common.lvl")

ReadDataFile("ingame.lvl")


SetMaxFlyHeight(30)
SetMaxPlayerFlyHeight (30)

SetMemoryPoolSize ("SoldierAnimation", 800)
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\\RVH.lvl;RVHcw")
ReadDataFile("sound\\fel.lvl;fel1cw")
ReadDataFile("sound\\hot.lvl;hot1gcw")
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_walk_atte",
"rep_walk_oneman_atst")

ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"cis_inf_officer",
"cis_inf_sniper",
"cis_inf_droideka",
"cis_hero_darthmaul",
"cis_tread_snailtank")

ReadDataFile("dc:SIDE\\kit.lvl",
"rep_hero_fisto")


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

SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_ep3_rifleman",9, 25},
assault = { "rep_inf_ep3_rocketeer",1, 4},
engineer = { "rep_inf_ep3_engineer",1, 4},
sniper = { "rep_inf_ep3_sniper",1, 4},
officer = {"rep_inf_ep3_officer",1, 4},
special = { "rep_inf_ep3_jettrooper",1, 4},

},
cis = {
team = CIS,
units = 20,
reinforcements = 150,
soldier = { "cis_inf_rifleman",9, 25},
assault = { "cis_inf_rocketeer",1, 4},
engineer = { "cis_inf_engineer",1, 4},
sniper = { "cis_inf_sniper",1, 4},
officer = {"cis_inf_officer",1, 4},
special = { "cis_inf_droideka",1, 4},
}
}

SetHeroClass(CIS, "cis_hero_darthmaul")
SetHeroClass(REP, "rep_hero_fisto")


-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- special -> droidekas
AddWalkerType(1, 2) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 1) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("CommandWalker", 2)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:RVH\\Rhn1.lvl", "Rhenvar1_liberation")
SetDenseEnvironment("false")
SetAIVehicleNotifyRadius(80)


-- 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("sound\\hot.lvl", "hot1gcw")
OpenAudioStream("sound\\hot.lvl", "hot1gcw")

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, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")

SetAmbientMusic(REP, 1.0, "rep_fel_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_fel_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2,"rep_fel_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_fel_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_fel_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2,"cis_fel_amb_end", 2,1)

SetVictoryMusic(REP, "rep_fel_amb_victory")
SetDefeatMusic (REP, "rep_fel_amb_defeat")
SetVictoryMusic(CIS, "cis_fel_amb_victory")
SetDefeatMusic (CIS, "cis_fel_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")


-- Camera Stats

-- Top Down
AddCameraShot(0.876900, -0.442794, 0.166961, 0.084308, -92.842827, 91.021690, 161.355850);
-- CP3
AddCameraShot(0.931816, -0.181206, -0.308678, -0.060027, -147.396545, 25.021837, 128.233185);
AddCameraShot(0.909842, -0.262073, 0.309156, 0.089050, -91.736038, 34.621788, 163.739639);
-- CP5
AddCameraShot(0.813412, -0.193748, -0.533549, -0.127087, -70.256043, 25.621792, 115.028290);
AddCameraShot(0.968388, -0.181738, -0.167961, -0.031521, -27.984699, 17.221787, 142.233933);
-- CP6
AddCameraShot(0.985705, -0.078090, -0.148826, -0.011790, -35.218330, 15.421706, 16.465012);
AddCameraShot(0.559177, -0.053046, -0.823652, -0.078135, -71.415993, 16.921690, -12.113598);
-- CP7
AddCameraShot(0.146996, -0.058009, -0.918500, -0.362469, -220.067062, 26.905960, 28.651220);
AddCameraShot(0.982701, -0.135933, -0.124598, -0.017235, -222.859299, 18.505959, 68.993172);
-- CP2
AddCameraShot(0.800503, -0.205155, -0.545494, -0.139800, -352.629608, 23.605942, 117.735550);
AddCameraShot(0.882701, -0.040039, -0.467747, -0.021217, -318.316254, 3.505955, 125.752930);
-- Pretty
AddCameraShot(0.563676, -0.109911, 0.803518, 0.156678, -231.592621, 22.405914, 223.867676);
AddCameraShot(0.938392, 0.112758, 0.324325, -0.038971, -251.608917, 1.105925, 266.066315);
AddCameraShot(0.723019, 0.100555, 0.676954, -0.094148, -39.843826, 0.805894, 111.416893);
AddCameraShot(0.968209, 0.021490, -0.249156, 0.005530, -75.747406, 12.505874, 75.078301);
AddCameraShot(0.264429, -0.053655, -0.943684, -0.191482, -125.556999, 26.605818, 48.874596);


end
RVHg_lib.lua
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

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

function ScriptPostLoad()


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "lib_cp1"}
cp2 = CommandPost:New{name = "lib_cp2"}
cp3 = CommandPost:New{name = "lib_cp3"}
cp4 = CommandPost:New{name = "lib_cp4"}
cp5 = CommandPost:New{name = "lib_cp5"}
cp6 = CommandPost:New{name = "lib_cp6"}
cp7 = CommandPost:New{name = "lib_cp7"}
cp8 = CommandPost:New{name = "lib_cp8"}
cp9 = CommandPost:New{name = "lib_cp9"}



--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:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)
conquest:AddCommandPost(cp9)

conquest:Start()

EnableSPHeroRules()

end


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

function ScriptInit()

ReadDataFile("dc:load\\common.lvl")

ReadDataFile("ingame.lvl")



SetMaxFlyHeight(30)
SetMaxPlayerFlyHeight (30)


SetMemoryPoolSize ("SoldierAnimation", 800)
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\\RVH.lvl;RVHgcw")
ReadDataFile("sound\\hot.lvl;hot1gcw")
ReadDataFile("SIDE\\all.lvl",
"all_inf_rifleman_snow",
"all_inf_rocketeer_snow",
"all_inf_engineer_snow",
"all_inf_sniper_snow",
"all_inf_officer_snow",
"all_hero_chewbacca",
"all_inf_wookiee_snow",
"all_hover_combatspeeder")

ReadDataFile("SIDE\\imp.lvl",
"imp_inf_rifleman_snow",
"imp_inf_rocketeer_snow",
"imp_inf_sniper_snow",
"imp_inf_dark_trooper",
"imp_inf_engineer_snow",
"imp_inf_officer",
"imp_hero_emperor",
"imp_walk_atat",
"imp_hover_fightertank")

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

SetupTeams{
all={
team = ALL,
units = 19,
reinforcements = 150,
soldier = {"all_inf_rifleman_snow",9, 25},
assault = {"all_inf_rocketeer_snow",1, 4},
engineer = {"all_inf_engineer_snow",1, 4},
sniper = {"all_inf_sniper_snow",1, 4},
officer = {"all_inf_officer_snow",1, 4},
special = {"all_inf_wookiee_snow",1, 4},

},

imp={
team = IMP,
units = 19,
reinforcements = 150,
soldier = {"imp_inf_rifleman_snow",9, 25},
assault = {"imp_inf_rocketeer_snow",1, 4},
engineer = {"imp_inf_engineer_snow",1, 4},
sniper = {"imp_inf_sniper_snow",1, 4},
officer = {"imp_inf_officer",1, 4},
special = {"imp_inf_dark_trooper",1, 4},
}
}

SetHeroClass(IMP, "imp_hero_emperor")
SetHeroClass(ALL, "all_hero_chewbacca")

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

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

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:RVH\\Rhn1.lvl", "Rhenvar1_liberation")
SetDenseEnvironment("true")
SetAIVehicleNotifyRadius(80)


-- Sound Stats

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

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

OpenAudioStream("sound\\global.lvl", "gcw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\hot.lvl", "hot1gcw")
OpenAudioStream("sound\\hot.lvl", "hot1gcw")

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

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

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

SetAmbientMusic(ALL, 1.0, "all_hot_amb_start", 0,1)
SetAmbientMusic(ALL, 0.8, "all_hot_amb_middle", 1,1)
SetAmbientMusic(ALL, 0.2, "all_hot_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "imp_hot_amb_start", 0,1)
SetAmbientMusic(IMP, 0.8, "imp_hot_amb_middle", 1,1)
SetAmbientMusic(IMP, 0.2, "imp_hot_amb_end", 2,1)

SetVictoryMusic(ALL, "all_hot_amb_victory")
SetDefeatMusic (ALL, "all_hot_amb_defeat")
SetVictoryMusic(IMP, "imp_hot_amb_victory")
SetDefeatMusic (IMP, "imp_hot_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

-- Top Down
AddCameraShot(0.876900, -0.442794, 0.166961, 0.084308, -92.842827, 91.021690, 161.355850);
-- CP3
AddCameraShot(0.931816, -0.181206, -0.308678, -0.060027, -147.396545, 25.021837, 128.233185);
AddCameraShot(0.909842, -0.262073, 0.309156, 0.089050, -91.736038, 34.621788, 163.739639);
-- CP5
AddCameraShot(0.813412, -0.193748, -0.533549, -0.127087, -70.256043, 25.621792, 115.028290);
AddCameraShot(0.968388, -0.181738, -0.167961, -0.031521, -27.984699, 17.221787, 142.233933);
-- CP6
AddCameraShot(0.985705, -0.078090, -0.148826, -0.011790, -35.218330, 15.421706, 16.465012);
AddCameraShot(0.559177, -0.053046, -0.823652, -0.078135, -71.415993, 16.921690, -12.113598);
-- CP7
AddCameraShot(0.146996, -0.058009, -0.918500, -0.362469, -220.067062, 26.905960, 28.651220);
AddCameraShot(0.982701, -0.135933, -0.124598, -0.017235, -222.859299, 18.505959, 68.993172);
-- CP2
AddCameraShot(0.800503, -0.205155, -0.545494, -0.139800, -352.629608, 23.605942, 117.735550);
AddCameraShot(0.882701, -0.040039, -0.467747, -0.021217, -318.316254, 3.505955, 125.752930);
-- Pretty
AddCameraShot(0.563676, -0.109911, 0.803518, 0.156678, -231.592621, 22.405914, 223.867676);
AddCameraShot(0.938392, 0.112758, 0.324325, -0.038971, -251.608917, 1.105925, 266.066315);
AddCameraShot(0.723019, 0.100555, 0.676954, -0.094148, -39.843826, 0.805894, 111.416893);
AddCameraShot(0.968209, 0.021490, -0.249156, 0.005530, -75.747406, 12.505874, 75.078301);
AddCameraShot(0.264429, -0.053655, -0.943684, -0.191482, -125.556999, 26.605818, 48.874596);


end
mission.req
Hidden/Spoiler:
ucft
{
REQN
{
"config"
"ingame_movies"
}

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

REQN
{
"lvl"
"RVHg_con"
"RVHc_con"
"RVHg_1flag"
"RVHc_1flag"
"RVHg_eli"
"RVHg_hunt"
"RVHc_lib"
"RVHg_lib"
}
}
addme.lua
Hidden/Spoiler:
--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] = { red = 255, blue = 255, green = 255, isModLevel = 1, mapluafile = "RVH%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1, mode_1flag_g = 1, mode_1flag_c = 1, mode_eli_g = 1, mode_hunt_g = 1, mode_lib_g = 1, mode_lib_c = 1,}
mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]

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

AddDownloadableContent("RVH","RVHg_con",4)
AddDownloadableContent("RVH","RVHc_con",4)
AddDownloadableContent("RVH","RVHg_1flag",4)
AddDownloadableContent("RVH","RVHc_1flag",4)
AddDownloadableContent("RVH","RVHg_eli",4)
AddDownloadableContent("RVH","RVHg_hunt",4)
AddDownloadableContent("RVH","RVHg_lib",4)
AddDownloadableContent("RVH","RVHc_lib",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\RVH\\data\\_LVL_PC\\core.lvl")
Can someone please help me get this working?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Need help on making a custom game mode

Post by AQT »

Similar topic with explanation: http://www.gametoast.com/forums/viewtop ... 12#p465212

You can add lib to that list, too.
Post Reply