this first post is a like a small tutorial that explains how to make hunt working. The quote at the end of the post is what I posted when I created this topic (if someone ever wants to follow the topic).
Here I explained what I did to make it work. I wanted to add the hunt of hoth in my map. If you want a hunt mode from another map, you should replace hoth by the name of the map.
Very soon I'll add another explanation about how you make a hunt layer (so the map in hunt isn't exactly what it is in conquest mode).
So, with the help of MasterSaitek009 and Penguin, I figured out how to make hunt mode working.
what I did exactly :
create a new map called aaa
copy "hoth_hunt.mrq" in "\BF2_ModTools\data_AAA\Worlds\AAA\world1"
rename "copy of hoth_hunt.mrq" to "AAA_hunt.mrq"
open "AAA_hunt.mrq" and replace with AAA :
ucft
{
REQN
{
"congraph"
"AAA_hunt"
}
REQN
{
"world"
"AAA_hunt"
}
}
copy "hot1g_hunt.lua" in "\BF2_ModTools\data_AAA\Common\scripts\AAA"
rename "copy of hot1g_hunt.lua" to "AAAg_hunt.lua"
open AAAg_hunt.lua
change what's in orange
copy "AAAc_con.req" in "\BF2_ModTools\data_AAA\Common\mission"--
-- 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)
ALL = 2
IMP = 1
-- 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.
---------------------------------------------------------------------------
function ScriptPostLoad()
hunt = ObjectiveTDM:New{teamATT = 1, teamDEF = 2, pointsPerKillATT = 1, 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()
if(ScriptCB_GetPlatform() == "PS2") then
StealArtistHeap(1024*1024) -- steal 1MB from art heap
end
-- Designers, these two lines *MUST* be first.
--SetPS2ModelMemory(4500000)
SetPS2ModelMemory(3300000)
ReadDataFile("ingame.lvl")
-- Empire Attacking (attacker is always #1)
--local ALL = 2
--local IMP = 1
-- These variables do not change
--local ATT = 1
--local DEF = 2
--SetAttackingTeam(ATT)
SetMaxFlyHeight(70)
SetMaxPlayerFlyHeight(70)
SetGroundFlyerMap(1);
ReadDataFile("sound\\hot.lvl;hot1gcw")
ReadDataFile("SIDE\\all.lvl",
"all_fly_snowspeeder",
"all_inf_rifleman_snow",
"all_inf_rocketeer_snow",
"all_inf_engineer_snow",
"all_inf_sniper_snow",
"all_inf_officer_snow",
"all_inf_wookiee_snow",
"all_walk_tauntaun")
ReadDataFile("SIDE\\snw.lvl",
"snw_inf_wampa")
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_hoth_dishturret",
"tur_bldg_hoth_lasermortar",
"tur_bldg_chaingun_tripod",
-- "tur_bldg_chaingun",
"tur_bldg_chaingun_roof")
SetupTeams{
all={
team = ALL,
units = 32,
reinforcements = -1,
soldier = {"all_inf_rifleman_snow"},
assault = {"all_inf_rocketeer_snow"},
engineer = {"all_inf_engineer_snow"},
sniper = {"all_inf_sniper_snow"},
officer = {"all_inf_officer_snow"},
special = {"all_inf_wookiee_snow"},
},
wampa={
team = IMP,
units = 32,
reinforcements = -1,
soldier = {"snw_inf_wampa", 8},
}
}
--Setting up Heros--
-- Level Stats
ClearWalkers()
SetMemoryPoolSize("EntityWalker", -2)
AddWalkerType(0, 0) -- 0 droidekas
AddWalkerType(1, 5) -- 6 atsts with 1 leg pairs each
AddWalkerType(2, 2) -- 2 atats with 2 leg pairs each
SetMemoryPoolSize("Aimer", 90)
SetMemoryPoolSize("AmmoCounter", 269)
SetMemoryPoolSize("BaseHint", 250)
SetMemoryPoolSize("CommandWalker", 2)
SetMemoryPoolSize("ConnectivityGraphFollower", 56)
SetMemoryPoolSize("EnergyBar", 269)
SetMemoryPoolSize("EntityCloth", 28)
SetMemoryPoolSize("EntityFlyer", 6)
SetMemoryPoolSize("EntityLight", 225)
SetMemoryPoolSize("EntitySoundStatic", 16)
SetMemoryPoolSize("EntitySoundStream", 5)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 54)
SetMemoryPoolSize("MountedTurret", 46)
SetMemoryPoolSize("Navigator", 63)
SetMemoryPoolSize("Obstacle", 400)
SetMemoryPoolSize("OrdnanceTowCable", 40) -- !!!! need +4 extra for wrapped/fallen cables !!!!
SetMemoryPoolSize("PathFollower", 63)
SetMemoryPoolSize("PathNode", 268)
SetMemoryPoolSize("RedOmniLight", 240)
SetMemoryPoolSize("TreeGridStack", 329)
SetMemoryPoolSize("UnitController", 63)
SetMemoryPoolSize("UnitAgent", 63)
SetMemoryPoolSize("Weapon", 269)
ReadDataFile("dc:AAA\\aaa.lvl", "AAA_conquest")
rename "copy of AAAc_con.req" to "AAAg_hunt.req"
open "AAAg_hunt.req" with notepad
replaced AAAc_con with AAAg_hunt :
ucft
{
REQN
{
"script"
"AAAg_hunt"
}
}
open "mission.req" in "\BF2_ModTools\data_AAA\Common"
add line :
open "addme.lua" in "\BF2_ModTools\data_AAA\addme"REQN
{
"lvl"
"AAAg_hunt"
"AAAg_con"
"AAAc_con"
}
}
added what's in orange :
munge the filesp_missionselect_listbox_contents[sp_n+1] = { isModLevel = 1, mapluafile = "AAA%s_%s", era_g = 1, era_c = 1, mode_con_g = 1, mode_con_c = 1, mode_hunt_g = 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("AAA","AAAg_con",4)
AddDownloadableContent("AAA","AAAc_con",4)
AddDownloadableContent("AAA","AAAg_hunt",4)
John
______________________________________________________________
[/quote]Hi,
I'm trying to add hunt to a map but I can't figure out how to make it work
I followed what's on the Wiki, but I didn't manage to do it
what I did exactly :
create a new map called aaa
copy "hoth_hunt.mrq" in "\BF2_ModTools\data_AAA\Worlds\AAA\world1"
rename "copy of hoth_hunt.mrq" to "AAA_hunt.mrq"
open "AAA_hunt.mrq" and replace with AAA :ucft
{
REQN
{
"congraph"
"AAA_hunt"
}
REQN
{
"world"
"AAA_hunt"
}
}
copy "hot1g_hunt.lua" in "\BF2_ModTools\data_AAA\Common\scripts\AAA"
rename "copy of hot1g_hunt.lua" to "AAAg_hunt.lua"
copy "AAAc_con.req" in "\BF2_ModTools\data_AAA\Common\mission"
rename "copy of AAAc_con.req" to "AAAg_hunt.req"
open "AAAg_hunt.req" with notepad
replaced AAAc_con with AAAg_hunt :ucft
{
REQN
{
"script"
"AAAg_hunt"
}
}
open "mission.req" in "\BF2_ModTools\data_AAA\Common"
add line :Then I munge the file, and hunt doesn't appear in the menu. Could someone tell me what I missed ?REQN
{
"lvl"
"AAAg_hunt"
"AAAg_con"
"AAAc_con"
}
}
Thanks
John


