Page 1 of 1

hunt game mode issue

Posted: Thu Nov 09, 2006 5:05 pm
by jano31coa
Hi,

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
--
-- 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")
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 :
REQN
{
"lvl"
"AAAg_hunt"
"AAAg_con"
"AAAc_con"
}
}
open "addme.lua" in "\BF2_ModTools\data_AAA\addme"
added what's in orange :
sp_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)
munge the file



John

______________________________________________________________
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 :
REQN
{
"lvl"
"AAAg_hunt"
"AAAg_con"
"AAAc_con"
}
}
Then I munge the file, and hunt doesn't appear in the menu. Could someone tell me what I missed ?

Thanks

John
[/quote]

Posted: Thu Nov 09, 2006 5:14 pm
by MasterSaitek009
The only thing that you didn't do is edit the addme.lua. Did you edit it? If you didn't look at it and you should be able to guess what you should add.
MasterSaitek009

Posted: Fri Nov 10, 2006 8:13 am
by jano31coa
Hi,
thanks for your gast aswer :)
I've done what you told me, and now Hunt appears in the game menu !
Here's my new line in the "addme.lua" in "\BF2_ModTools\data_AAA\addme"
sp_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,}
Thank you very much !!!


but, when I launch the map, I get a "Could not open MISSION\AAAg_hunt.lvl" error message

Could someone explain to me what is still missing ?

Thanks =)

John
(I'll make a tutorial on this when, with your help, I get it to work)

Posted: Fri Nov 10, 2006 6:03 pm
by Penguin
AddDownloadableContent("AAA","AAAg_hunt",4)
((goes in the addme))

Posted: Sun Nov 12, 2006 12:12 pm
by jano31coa
Thanks for your fast answer, it's really nice :D

I added the line you told me and now the map launches !!

Thank you very much

Thanks again !!


I'll edit the first post, so it'll be a tutorial.

Posted: Sun Nov 12, 2006 1:10 pm
by jano31coa
Hi again,

so I've done everything told in the first post
and now hunt appears in the menu and launches.

But, when I launch the the map in hunt, it's on Hoth !

What else should I do ?
I think there should be something to do in the ZeroEditor, but I don't know what ?

Thanks !

John
ps: if this has already been explained in a topic you know, it would be really nice to give a link to it (I already searched for that, but didn't found anything)

Posted: Sun Nov 12, 2006 7:30 pm
by fat_walrus
Are you loading the wrong level in your scripts? Look around in those and see if they are using the right level.

Posted: Sun Nov 12, 2006 9:03 pm
by Gogie
don't forget to add a layer into ZE to add CP's otherwise you can't spawn.

Posted: Mon Nov 13, 2006 7:20 am
by jano31coa
er, could you tell me how do you do that properly ?

Posted: Thu Nov 16, 2006 8:47 am
by jano31coa
yessss I think I got it

I'll upgrade the first post (which is basically a tutorial) very soon


i'm HAPPY =))

Posted: Sun Nov 19, 2006 7:30 am
by jano31coa
soo, I need more help

the tutorial I wrote works flawlessly with a AAA map I create with only conquest. But I get an error message "Could not open MISSION\###g_hunt.lvl" when I try to do it on the map I'm currently working. My map already has conquest, ctf, 1flag and assault. So maybe it is not possible to add hunt to a map that already has 4 game modes. Or did I miss something else ?

thanks

John

Posted: Sun Nov 19, 2006 2:21 pm
by [RDH]Zerted
I haven't read through all your posts, but I would guess you have forgotten a .req or have misspelled something along the way.

As far as I know, a map can have an unlimited number of game modes.

You can try creating and adding the layers for hunt through ZeroEdit instead of messing with the .mrq file.

Posted: Mon Nov 20, 2006 2:00 am
by jano31coa
thanks for your answer !

are you sure about that : I mean, I did EXACTLY the same thing on a new map that had only conquest and a new map that had the 4 game modes, and it worked only with the first one. And I checked everything three times. Do you know someone who managed to add more than 4 game modes to a map ?

Posted: Mon Nov 20, 2006 1:11 pm
by [RDH]Zerted
The map pack has maps with over 4 game modes. I've had ones with about 14, but that was just to check how they look on the map selection screen.

Create a new map and just add a new game mode to it. This is double checking to make sure the process you are using works.

Posted: Mon Nov 20, 2006 1:29 pm
by jano31coa
er, when I say 4 game modes, that's 7 actually (g con, c con, c 1flag, g 1glaf, c ctf, g ctf, eli)
I'll try to remove clone wars eras and to add hunt. (of course I made a save of my source files)

Posted: Mon Nov 20, 2006 2:07 pm
by Teancum
You can have an infinite number of game modes, they just show up funky on the Instant Action screen if you go over six. So that's not the problem.