Page 1 of 1

*Tutorial* How to add hunt mode

Posted: Wed Jan 09, 2008 9:08 pm
by 1z2x3c
how to add hunt mode tutorial

1. The first thing is to make your lua.

here is and example:

the ??? would be your 3letter map name (*note* cw hunt mode example)
will use in my naboo map, so the sounds are set up for naboo.

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

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

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

---------------------------------------------------------------------------
-- 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.
---------------------------------------------------------------------------




--force all the human players onto the attacking side

function ScriptPostLoad()
hunt = ObjectiveTDM:New{teamATT = 1, teamDEF = 2, pointsPerKillATT = 3, pointsPerKillDEF = 3,
textATT = "game.modes.hunt", textDEF = "game.modes.hunt2", multiplayerRules = true}

hunt.OnStart = function(self)

AddAIGoal(ATT, "Deathmatch", 1000)
AddAIGoal(DEF, "Deathmatch", 1000)
end


hunt:Start()

end

function ScriptInit()
-- Designers, these two lines *MUST* be first!
SetPS2ModelMemory(3000000)
ReadDataFile("ingame.lvl")



ReadDataFile("sound\\nab.lvl;nab2cw")

ReadDataFile("SIDE\\rep.lvl",
"rep_inf_ep3_sniper")

ReadDataFile("SIDE\\cis.lvl",
"cis_inf_sniper")

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



SetupTeams{

gungan = {
team = REP,
units = 32,
reinforcements = -1,
soldier = { "rep_inf_ep3_sniper",15},

},
cis = {
team = CIS,
units = 32,
reinforcements = -1,
soldier = { "cis_inf_sniper",15},

}
}


-- Level Stats
ClearWalkers()
AddWalkerType(0, 0)
AddWalkerType(1, 0)
SetMemoryPoolSize("Aimer", 22)
SetMemoryPoolSize("BaseHint", 128)
SetMemoryPoolSize("EntitySoundStream", 1)
SetMemoryPoolSize("EntitySoundStatic", 44)
SetMemoryPoolSize("MountedTurret", 10)
SetMemoryPoolSize("Navigator", 32)
SetMemoryPoolSize("Obstacle", 450)
SetMemoryPoolSize("PathNode", 200)
SetMemoryPoolSize("TreeGridStack", 470)
SetMemoryPoolSize("SoldierAnimation", 200)
SetMemoryPoolSize("UnitAgent", 32)
SetMemoryPoolSize("UnitController", 32)
SetMemoryPoolSize("Weapon", 144)
SetMemoryPoolSize("EntityFlyer", 6)

-- Fishies
SetNumFishTypes(8)
SetFishType(0,1.1,"fish")
SetFishType(1,0.5,"fish")
SetFishType(2,0.9,"fish")
SetFishType(3,0.7,"fish")
SetFishType(4,1.7,"fish")
SetFishType(5,0.1,"fish")
SetFishType(6,1.5,"fish")
SetFishType(7,1.9,"fish")
-- Birdies
SetNumBirdTypes(1)
SetBirdType(0,1.5,"bird")

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:???\\???.lvl","???_hunt")
SetDenseEnvironment("true")
SetMaxFlyHeight(80)
SetMaxPlayerFlyHeight (80)



-- Sound

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "gun_unit_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "all_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\\nab.lvl", "nab2")
OpenAudioStream("sound\\nab.lvl", "nab2")
OpenAudioStream("sound\\nab.lvl", "nab2_emt")

-- SetBleedingVoiceOver(REP, REP, "all_off_com_report_us_overwhelmed", 1)
-- SetBleedingVoiceOver(REP, CIS, "all_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, "all_off_defeat_im", .1, 1)
-- SetLowReinforcementsVoiceOver(REP, CIS, "all_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, "allleaving")
SetOutOfBoundsVoiceOver(1, "cisleaving")

SetAmbientMusic(REP, 1.0, "rep_nab_amb_hunt", 0,1)
-- SetAmbientMusic(REP, 0.9, "rep_nab_amb_middle", 1,1)
-- SetAmbientMusic(REP, 0.1, "rep_nab_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_nab_amb_hunt", 0,1)
-- SetAmbientMusic(CIS, 0.9, "cis_nab_amb_middle", 1,1)
-- SetAmbientMusic(CIS, 0.1, "cis_nab_amb_end", 2,1)

SetVictoryMusic(REP, "rep_nab_amb_victory")
SetDefeatMusic (REP, "rep_nab_amb_defeat")
SetVictoryMusic(CIS, "cis_nab_amb_victory")
SetDefeatMusic (CIS, "cis_nab_amb_defeat")

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



-- Camera Stats

AddCameraShot(0.504729, 0.008133, 0.863128, -0.013908, -33.028889, 11.698190, -305.239777);
AddCameraShot(0.998757, 0.024656, 0.043299, -0.001069, -173.141403, 11.698190, 135.750336);
AddCameraShot(0.983559, -0.020210, -0.179414, -0.003687, -164.680222, 11.698190, -118.999832);
AddCameraShot(-0.276453, 0.005417, -0.960828, -0.018828, 55.126141, 11.698190, -463.062347);
end
so, this is the lua.

2. next you have to add a line to you ???.req.
Hidden/Spoiler:
some stuff before this
REQN
{
"lvl"
"???_conquest"
"???_1flag"
"???_hunt" -- <========== add this line
}
some stuff after this
3. now go to your common folder, open the mission.req
add this line:
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"
"???c_con"
"???c_hunt" -- <============

}
}
now open the mission folder. In there you need to
create a file called ???c_hunt.req.

it should look like this:
Hidden/Spoiler:
ucft
{
REQN
{
"script"
"???c_hunt"
}
}
4. Now go to your data_??? folder, then the addme folder, and open addme.lua.
here is an example:
Hidden/Spoiler:
function AddNewGameModes(missionList, mapName, newFlags)
for i, mission in missionList do
if mission.mapluafile == mapName then
for flag, value in pairs(newFlags) do
mission[flag] = value
end
end
end
end




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

sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "???%s_%s", era_c = 1, mode_con_c = 1, mode_hunt_c = 1, mode_1flag_c = 1,} <===== and the mode_hunt_c thingy
mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]

AddDownloadableContent("???","???c_con",4)
AddDownloadableContent("???","???c_hunt",4) -- <========
AddDownloadableContent("???","???c_1flag",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\???\\data\\_LVL_PC\\core.lvl")
add thoes lines remembering ??? is your 3letter map name

5. now go into zeroeditor, click the change button on the top middle of the screen.
now click new, right click layor000 and rename to hunt. add cps and spawn paths to that layor.
now click the configure button slightly to the right of the change button.
in the first collom, highlight hunt and click remove at the top of the collom.
in the second collom click add, rename to hunt, and in the third collom click add, and
add the layor hunt. save and exit ze.

go to your world1 folder and copy the ???_conquest.mrq and paste. rename to ???_hunt.mrq.
open it and change all the conguest to hunt as so:
Hidden/Spoiler:
ucft
{
REQN
{
"congraph"
"111_hunt"
}
REQN
{
"world"
"111_hunt"
}
}
6. now go to your data_??? folder and open editlocalize.MS-DOS Batch file, open level, right click and click
add scope, name it ???(your 3 letter map name). Right click that and click add key, name it local, right click
again and this time name it locals. for these 2 name them what you want in the middle collom and save and exit.


7. now munge!

8. test and have fun!!! :lol:

Re: *tutorial* how to add hunt mode

Posted: Wed Jan 09, 2008 10:29 pm
by Caleb1117
This already exists.
although, I haven't read yours, it could be good.

Re: *tutorial* how to add hunt mode

Posted: Thu Jan 10, 2008 1:33 am
by 1z2x3c
???, it has, oh well, i couldn't find one so i figured it out and made my own.

Re: *tutorial* how to add hunt mode

Posted: Tue Apr 29, 2008 11:25 am
by Moonwolf=SotG=
i'm not sure wether bumping is illegal at tuts but i'd like to add a comment, when one does try to add a mode, it won't work as you mentioned it, because you forgot to mention one line

sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "???%s_%s", era_c = 1, mode_con_c = 1, mode_hunt_c = 1, mode_1flag_c = 1,}

this is in the tut but not declared as an *addmode* line

I hope this will help to improve your tut

Yours Sincerely, Moony

Re: *tutorial* how to add hunt mode

Posted: Sat Oct 18, 2008 9:15 pm
by computergeek
Sorry for the bump, but what Moony is saying is to add that addition line into your addme.lua
Will look like this
sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "!!!%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1, mode_eli_g = 1, mode_hunt_g = 1,}

Re: *tutorial* how to add hunt mode

Posted: Sun Oct 19, 2008 8:27 am
by Culvar
computergeek wrote:Sorry for the bump, but what Moony is saying is to add that addition line into your addme.lua
Will look like this
sp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "!!!%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1, mode_eli_g = 1, mode_hunt_g = 1,}
You need to do the same for MP too, or it won't show up in MP.

Re: *tutorial* how to add hunt mode

Posted: Sun Oct 19, 2008 12:34 pm
by [RDH]Zerted
This line makes sure MP has the same values as SP:

Code: Select all

mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]