Page 1 of 1

Hunt crashes.

Posted: Tue Sep 20, 2011 10:11 pm
by Cerfon Rournes
I added hunt to my map, and Bf2 crashes just before the map starts loading. :o
I followed This tut. http://www.gametoast.com/forums/viewtop ... 27&t=12104
Here is all the info.
MFUg_hunt.lua
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")
ScriptCB_SetPlayerAwardsEnabled(0)

-- Empire Attacking (attacker is always #1)
REP = 1;
IMP = 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.
---------------------------------------------------------------------------
function ScriptPostLoad()
--force all the human players onto the attacking side


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

UnblockPlanningGraphArcs("Connection74")
DisableBarriers("1")

SetUberMode(1);

PlayAnimRise()
DisableBarriers("BALCONEY")
DisableBarriers("bALCONEY2")
DisableBarriers("hallway_f")
DisableBarriers("hackdoor")
DisableBarriers("outside")

OnObjectRespawnName(PlayAnimRise, "DingDong");
OnObjectKillName(PlayAnimDrop, "DingDong");

--START BRIDGEWORK!

-- OPEN
function PlayAnimDrop()
PauseAnimation("lava_bridge_raise");
RewindAnimation("lava_bridge_drop");
PlayAnimation("lava_bridge_drop");

-- prevent the AI from running across it
BlockPlanningGraphArcs("Connection82");
BlockPlanningGraphArcs("Connection83");
EnableBarriers("Bridge");

end
-- CLOSE
function PlayAnimRise()
PauseAnimation("lava_bridge_drop");
RewindAnimation("lava_bridge_raise");
PlayAnimation("lava_bridge_raise");


-- allow the AI to run across it
UnblockPlanningGraphArcs("Connection82");
UnblockPlanningGraphArcs("Connection83");
DisableBarriers("Bridge");

end
function ScriptInit()
StealArtistHeap(64*1024)
-- Designers, these two lines *MUST* be first!
SetPS2ModelMemory(3600000)

ReadDataFile("dc:ingame.lvl")
ReadDataFile("ingame.lvl")

ReadDataFile("sound\\mus.lvl;mus1gcw")

--SetMaxFlyHeight(43)
--SetMaxPlayerFlyHeight (43)

EnableAIAutoBalance()

SetTeamAggressiveness(IMP, 0.75)
SetTeamAggressiveness(REP, 0.75)

SetAIDifficulty(9, 9)

ReadDataFile("SIDE\\all.lvl")

ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_ep3_officer")

ReadDataFile("dc:SIDE\\imp.lvl",
"imp_inf_dark_trooper")

-- Level Stats
ClearWalkers()
-- AddWalkerType(0, 0) -- 8 droidekas (special case: 0 leg pairs)
-- AddWalkerType(1, 3) -- 8 droidekas (special case: 0 leg pairs)
-- AddWalkerType(2, 0) -- 2 spider walkers with 2 leg pairs each
-- AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
SetMemoryPoolSize("EntityCloth", 34)
SetMemoryPoolSize("EntitySoundStatic", 133)
SetMemoryPoolSize("Obstacle", 500)
SetMemoryPoolSize("Weapon", 260)
SetMemoryPoolSize("EntityFlyer", 4)
SetMemoryPoolSize ("SoldierAnimation", 800)
SetMemoryPoolSize("ParticleTransformer::ColorTrans", 2000)
SetMemoryPoolSize ("ParticleTransformer::SizeTransf", 2000)

SetupTeams{

rep = {
team = REP,
units = 32,
reinforcements = -1,

sniper = { "rep_inf_ep3_officer",8},


},
imp = {
team = IMP,
units = 32,
reinforcements = -1,
soldier = { "imp_inf_dark_trooper", 8},

}
}


SetSpawnDelay(10.0, 0.25)
-- AddDeathRegion("deathregion")
ReadDataFile("dc:MFU\\mus1.lvl", "mus1_tdm")
SetDenseEnvironment("false")
SetMaxFlyHeight(84.16)
SetMaxPlayerFlyHeight(84.16)
--SetStayInTurrets(1)
AISnipeSuitabilityDist(30)


-- Movies
-- SetVictoryMovie(ALL, "all_end_victory")
-- SetDefeatMovie(ALL, "imp_end_victory")
-- SetVictoryMovie(IMP, "imp_end_victory")
-- SetDefeatMovie(IMP, "all_end_victory")

-- Sound

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_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("dc:sound\\tfu.lvl", "tfugcw_music")
OpenAudioStream("sound\\global.lvl", "gcw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\mus.lvl", "mus1")
OpenAudioStream("sound\\mus.lvl", "mus1")
-- OpenAudioStream("sound\\mus.lvl", "mus1_emt")

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

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

SetOutOfBoundsVoiceOver(1, "allleaving")
SetOutOfBoundsVoiceOver(2, "impleaving")

SetAmbientMusic(REP, 1.0, "cis_kam_amb_start", 0,1)
SetAmbientMusic(IMP, 1.0, "cis_kam_amb_start", 0,1)


SetVictoryMusic(REP, "rep_kam_amb_victory")
SetDefeatMusic (REP, "rep_kam_amb_victory")
SetVictoryMusic(IMP, "cis_kam_amb_victory")
SetDefeatMusic (IMP, "cis_kam_amb_victory")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
-- SetSoundEffect("BirdScatter", "birdsFlySeq1")
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")


SetAttackingTeam(ATT)


AddCameraShot(0.446393, -0.064402, -0.883371, -0.127445, -93.406929, 72.953865, -35.479401);

AddCameraShot(-0.297655, 0.057972, -0.935337, -0.182169, -2.384067, 71.165306, 18.453350);

AddCameraShot(0.972488, -0.098362, 0.210097, 0.021250, -42.577881, 69.453072, 4.454691);

AddCameraShot(0.951592, -0.190766, -0.236300, -0.047371, -44.607018, 77.906273, 113.228661);

AddCameraShot(0.841151, -0.105984, 0.526154, 0.066295, 109.567764, 77.906273, 7.873035);

AddCameraShot(0.818472, -0.025863, 0.573678, 0.018127, 125.781593, 61.423031, 9.809184);

AddCameraShot(-0.104764, 0.000163, -0.994496, -0.001550, -13.319855, 70.673264, 63.436607);

AddCameraShot(0.971739, 0.102058, 0.211692, -0.022233, -5.680069, 68.543945, 57.904160);

AddCameraShot(0.178437, 0.004624, -0.983610, 0.025488, -66.947433, 68.543945, 6.745875);

AddCameraShot(-0.400665, 0.076364, -0896894, -0.170941, 96.201210, 79.913033, -58.604382)
end
addme
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] = { isModLevel = 1, mapluafile = "MFU%s_%s", era_g = 1, era_c = 1, mode_hunt_g = 1, mode_con_g = 1, mode_con_c = 1, mode_ctf_g = 1, mode_ctf_c = 1, mode_1flag_g = 1, mode_1flag_c = 1, mode_eli_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("MFU","MFUg_con",4)
AddDownloadableContent("MFU","MFUc_con",4)
AddDownloadableContent("MFU","MFUg_ctf",4)
AddDownloadableContent("MFU","MFUc_ctf",4)
AddDownloadableContent("MFU","MFUg_1flag",4)
AddDownloadableContent("MFU","MFUc_1flag",4)
AddDownloadableContent("MFU","MFUg_eli",4)
AddDownloadableContent("MFU","MFUg_hunt",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\MFU\\data\\_LVL_PC\\core.lvl")
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"
"MFUg_con"
"MFUc_con"
"MFUg_hunt"
"MFUg_ctf"
"MFUc_ctf"
"MFUg_1flag"
"MFUc_1flag"
"MFUg_eli"
}
}
MFUg_hunt.req(Common/mission)
Hidden/Spoiler:
ucft
{
REQN
{
"script"
"MFUg_hunt"
}
}
Anyone know what the problem is?

Re: Hunt crashes.

Posted: Wed Sep 21, 2011 6:33 pm
by AQT
Did you receive any munge errors? What does the debug log have to say?

Re: Hunt crashes.

Posted: Wed Sep 21, 2011 6:35 pm
by Cerfon Rournes
AQT wrote:Did you receive any munge errors? What does the debug log have to say?
1: As I said before, bf2 crashes before the map starts loading...here Is all the bf2_log could get.
Hidden/Spoiler:
Opened logfile BFront2.log 2011-09-20 0952
shell_interface: Entered
shell_interface: gPlatformStr, gOnlineServiceStr, gLangStr, gLangEnum: PC GameSpy english 0
ifs_era_handler - Entered
ifs_era_handler - Exited
shell_interface: No custom_gc_0.lvl
shell_interface: No custom_gc_1.lvl
shell_interface: No custom_gc_2.lvl
shell_interface: No custom_gc_3.lvl
shell_interface: No custom_gc_4.lvl
shell_interface: No custom_gc_5.lvl
shell_interface: No custom_gc_6.lvl
shell_interface: No custom_gc_7.lvl
shell_interface: No custom_gc_8.lvl
shell_interface: No custom_gc_9.lvl
shell_interface: Found custom_gc_10.lvl
custom_gc_10: Entered
custom_gc_10: Found custom_gc_11.lvl
custom_gc_11: Entered
ifs_freeform_init_dt.lua
ifs_freeform_start_dt.lua
custom_gc_11: Taking control of custom_GetGCButtonList()...
custom_gc_11: Taking control of custom_PressedGCButton()...
custom_gc_11: Exited
custom_gc_10: No custom_gc_12.lvl. Will stop searching for any more cGC scripts.
custom_gc_10: Exited
custom_EraButtonList(): Finished building era button table Known eras buttons: 28
custom_GetGMapEras(): Finished building era table Known eras: 28
custom_GetGMapModes(): Finished building game mode table Known Modes: 39
custom_GetMPGameModeList(): Finished building game mode list table List Length: 40
custom_SetMovieLocation()
custom_gc_11: custom_GetGCButtonList(): Entered
custom_GetGCButtonList()
custom_gc_11: custom_GetGCButtonList(): Exited
custom_SetMovieLocation()
custom_GetFreeformBattleModeList(): Finished building freeform battle mode list Known Modes: 39
ingame stream movies\crawl.mvs
shell_interface: Opening movie: movies\shell.mvs
shell_interface: Leaving
Mission Checker: Entered addme
Mission Checker: addme: Now listening in on AddDownloadableContent() calls
Mission Checker: Exited addme

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(866)
Lua ReadDataFile: Could not open ..\..\addon\HB2\data\_LVL_PC\shell.lvl
prev = none iLastPage = nil
prev = texture iLastPage = 1
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameMovie.cpp(399)
Unable to find open movie segment shell_main

ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadProfile
ifs_saveop_DoOps LoadProfile
ifs_sp_campaign: Input_Accept(): Entered: _tab_instant
missionlist_ExpandMapList()
ifs_missionselect_pcMulti_fnSetMapPreview(): Defaulting index to 1
this.CurButton = nil
cur_button = nil
this.CurButton = check_mode2
cur_button = nil
this.CurButton = check_mode1
cur_button = nil
this.CurButton = nil
cur_button = nil
this.CurButton = check_mode2
cur_button = nil
this.CurButton = nil
cur_button = nil
this.CurButton = nil
cur_button = nil
this.CurButton = check_mode5
cur_button = nil
this.CurButton = check_mode1
cur_button = nil
Checkbox for check_era7 clicked
this.CurButton = check_era7
cur_button = nil
this.CurButton = nil
cur_button = nil
DoubleClicked
custom_AddMapNew()
custom_printTable(): table: 05D00948
The key, value is: mode_hunt_g 1
The key, value is: era_g 1
The key, value is: mode_con_c 1
The key, value is: isModLevel 1
The key, value is: mode_1flag_g 1
The key, value is: mode_1flag_c 1
The key, value is: bSelected 1
The key, value is: era_c 1
The key, value is: mode_eli_g 1
The key is mapluafile, the formated value is: MFU<A>_<B>
The key, value is: mode_con_g 1
The key, value is: mode_ctf_g 1
The key, value is: mode_ctf_c 1
custom_printTable(): Returning
custom_printTable(): table: 058E6B4C
The key, value is: key mode_con
The key, value is: subst con
The key, value is: showstr modename.name.con
The key, value is: descstr modename.description.con
The key, value is: icon mode_icon_con
custom_printTable(): Returning
gMapEras.key = era_g Era = era_g subst = g
Adding map: MFUg_hunt idx: 1
this.CurButton = Launch
cur_button = nil

2: No munge errors.
Thanks for the help so far :)
EDIT
New Rank! :mrgreen:

Re: Hunt crashes.

Posted: Wed Sep 21, 2011 6:53 pm
by AQT
Hmm, I want to say there is something wrong with the lua itself. The game would crash in the beginning during loading if there is something wrong with the addme.lua. The REQ files seem fine. Otherwise, you would get one of those fatal messages. So those three are out. But I can't pinpoint what is wrong exactly with the lua. If the lua had problems, though, there should have been some munge errors...

So using the tutorial you linked to as a reference, you used the Hoth hunt lua as a base for your hunt mode. Try a clean first. If a crash still occurs, then try using this modified hunt lua but at the stage before you copied and pasted all of the Mustafar functions and whatnot into it.

Re: Hunt crashes.

Posted: Wed Sep 21, 2011 6:56 pm
by Cerfon Rournes
That could be the problem. I did not paste the hot hunt .lua, I just took all of the lines I thought I needed from it and placed them in my current .lua. I'll try that and see what happens.
EDIT
Aaaaaannd that was the problem. Thanks AQT. :)
EDIT..
It loads and plays, but the bots do not spawn..
Ideas?
This is the only important looking Sev 3 in the bf2 log..
Hidden/Spoiler:
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `PlayAnimRise' (a nil value)
stack traceback:
(none): in function `ScriptPostLoad'
However, it does not look like that is the issue. :?

Re: Hunt crashes.

Posted: Wed Sep 21, 2011 7:35 pm
by Tears2Roses
try adding the CP's ( like in conquest ) to the LUA.

Re: Hunt crashes.

Posted: Wed Sep 21, 2011 7:53 pm
by Cerfon Rournes
Good Idea^
I did that, and the Sev 3 that I had changed to this..
Hidden/Spoiler:
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to index global `CommandPost' (a nil value)
stack traceback:
(none): in function `ScriptPostLoad'
I'm looking into it now.

Re: Hunt crashes.

Posted: Wed Sep 21, 2011 8:00 pm
by Tears2Roses
Can you post an updated LUA? Also, if you are using hoth, I will show you a bunch of junk you can delete from the LUA that doesnt affect anything.

Re: Hunt crashes.

Posted: Wed Sep 21, 2011 8:09 pm
by Cerfon Rournes
Sure.
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

-- Empire Attacking (attacker is always #1)
REP = 1;
IMP = 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.
---------------------------------------------------------------------------
function ScriptPostLoad()

UnblockPlanningGraphArcs("Connection74")
DisableBarriers("1")

--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"}

PlayAnimRise()
DisableBarriers("BALCONEY")
DisableBarriers("bALCONEY2")
DisableBarriers("hallway_f")
DisableBarriers("hackdoor")
DisableBarriers("outside")

OnObjectRespawnName(PlayAnimRise, "DingDong");
OnObjectKillName(PlayAnimDrop, "DingDong");

--START BRIDGEWORK!

-- OPEN
function PlayAnimDrop()
PauseAnimation("lava_bridge_raise");
RewindAnimation("lava_bridge_drop");
PlayAnimation("lava_bridge_drop");

-- prevent the AI from running across it
BlockPlanningGraphArcs("Connection82");
BlockPlanningGraphArcs("Connection83");
EnableBarriers("Bridge");

end
-- CLOSE
function PlayAnimRise()
PauseAnimation("lava_bridge_drop");
RewindAnimation("lava_bridge_raise");
PlayAnimation("lava_bridge_raise");

end
-- allow the AI to run across it
UnblockPlanningGraphArcs("Connection82");
UnblockPlanningGraphArcs("Connection83");
DisableBarriers("Bridge");


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("dc:ingame.lvl")
ReadDataFile("ingame.lvl")

ReadDataFile("sound\\mus.lvl;mus1gcw")

--SetMaxFlyHeight(43)
--SetMaxPlayerFlyHeight (43)

EnableAIAutoBalance()

SetTeamAggressiveness(IMP, 0.75)
SetTeamAggressiveness(REP, 0.75)

SetAIDifficulty(9, 9)

ReadDataFile("SIDE\\all.lvl")

ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_ep3_officer_hunt")

ReadDataFile("dc:SIDE\\imp.lvl",
"imp_inf_dark_trooper_hunt")

SetupTeams{

rep = {
team = REP,
units = 32,
reinforcements = -1,

sniper = { "rep_inf_ep3_officer_hunt",8},


},
imp = {
team = IMP,
units = 32,
reinforcements = -1,
soldier = { "imp_inf_dark_trooper_hunt", 8},

}
}


--Setting up Heros--



-- Level Stats
ClearWalkers()
-- AddWalkerType(0, 0) -- 8 droidekas (special case: 0 leg pairs)
-- AddWalkerType(1, 3) -- 8 droidekas (special case: 0 leg pairs)
-- AddWalkerType(2, 0) -- 2 spider walkers with 2 leg pairs each
-- AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
SetMemoryPoolSize("EntityCloth", 34)
SetMemoryPoolSize("EntitySoundStatic", 133)
SetMemoryPoolSize("Obstacle", 500)
SetMemoryPoolSize("Weapon", 260)
SetMemoryPoolSize("EntityFlyer", 4)
SetMemoryPoolSize ("SoldierAnimation", 800)
SetMemoryPoolSize("ParticleTransformer::ColorTrans", 3000)
SetMemoryPoolSize ("ParticleTransformer::SizeTransf", 3000)
SetMemoryPoolSize ("ParticleTransformer::PositionTr", 3000)

SetSpawnDelay(10.0, 0.25)
-- AddDeathRegion("deathregion")
ReadDataFile("dc:MFU\\mus1.lvl", "mus1_tdm")
SetDenseEnvironment("false")
SetMaxFlyHeight(84.16)
SetMaxPlayerFlyHeight(84.16)
--SetStayInTurrets(1)
AISnipeSuitabilityDist(30)


-- Movies
-- SetVictoryMovie(ALL, "all_end_victory")
-- SetDefeatMovie(ALL, "imp_end_victory")
-- SetVictoryMovie(IMP, "imp_end_victory")
-- SetDefeatMovie(IMP, "all_end_victory")

-- Sound

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_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("dc:sound\\tfu.lvl", "tfugcw_music")
OpenAudioStream("sound\\global.lvl", "gcw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\mus.lvl", "mus1")
OpenAudioStream("sound\\mus.lvl", "mus1")
-- OpenAudioStream("sound\\mus.lvl", "mus1_emt")

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

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

SetOutOfBoundsVoiceOver(1, "allleaving")
SetOutOfBoundsVoiceOver(2, "impleaving")

SetAmbientMusic(REP, 1.0, "cis_kam_amb_start", 0,1)
SetAmbientMusic(IMP, 1.0, "cis_kam_amb_start", 0,1)


SetVictoryMusic(REP, "rep_kam_amb_victory")
SetDefeatMusic (REP, "rep_kam_amb_victory")
SetVictoryMusic(IMP, "cis_kam_amb_victory")
SetDefeatMusic (IMP, "cis_kam_amb_victory")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
-- SetSoundEffect("BirdScatter", "birdsFlySeq1")
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")


SetAttackingTeam(ATT)


AddCameraShot(0.446393, -0.064402, -0.883371, -0.127445, -93.406929, 72.953865, -35.479401);

AddCameraShot(-0.297655, 0.057972, -0.935337, -0.182169, -2.384067, 71.165306, 18.453350);

AddCameraShot(0.972488, -0.098362, 0.210097, 0.021250, -42.577881, 69.453072, 4.454691);

AddCameraShot(0.951592, -0.190766, -0.236300, -0.047371, -44.607018, 77.906273, 113.228661);

AddCameraShot(0.841151, -0.105984, 0.526154, 0.066295, 109.567764, 77.906273, 7.873035);

AddCameraShot(0.818472, -0.025863, 0.573678, 0.018127, 125.781593, 61.423031, 9.809184);

AddCameraShot(-0.104764, 0.000163, -0.994496, -0.001550, -13.319855, 70.673264, 63.436607);

AddCameraShot(0.971739, 0.102058, 0.211692, -0.022233, -5.680069, 68.543945, 57.904160);

AddCameraShot(0.178437, 0.004624, -0.983610, 0.025488, -66.947433, 68.543945, 6.745875);

AddCameraShot(-0.400665, 0.076364, -0896894, -0.170941, 96.201210, 79.913033, -58.604382)
end

Re: Hunt crashes.

Posted: Wed Sep 21, 2011 8:40 pm
by AQT
Tears2Roses wrote:try adding the CP's ( like in conquest ) to the LUA.
Um, why? Hunt is a seperate game type with a different objective from Conquest. This is absolutely unnecessary.
I will show you a bunch of junk you can delete from the LUA that doesnt affect anything.
Would you agree that leaving the "bunch of junk" won't affect anything as well?

@Cerfon:

Code: Select all

...
sniper = { "rep_inf_ep3_officer_hunt",8},
...
soldier = { "imp_inf_dark_trooper_hunt", 8},
...
About those 8's: Try adding the second value to set the minimum/maximum spawn bound limits.

Re: Hunt crashes.

Posted: Wed Sep 21, 2011 8:44 pm
by Tears2Roses
@ AQT: The junk doesnt affect anything, its just well...useless. If you say adding the CP's is not needed, then I will agree with what you said. However if you want to know what can be deleted, see below.
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

-- Empire Attacking (attacker is always #1)
REP = 1;
IMP = 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.
---------------------------------------------------------------------------
function ScriptPostLoad()

UnblockPlanningGraphArcs("Connection74")
DisableBarriers("1")

--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"}

PlayAnimRise()
DisableBarriers("BALCONEY")
DisableBarriers("bALCONEY2")
DisableBarriers("hallway_f")
DisableBarriers("hackdoor")
DisableBarriers("outside")

OnObjectRespawnName(PlayAnimRise, "DingDong");
OnObjectKillName(PlayAnimDrop, "DingDong");

--START BRIDGEWORK!

-- OPEN
function PlayAnimDrop()
PauseAnimation("lava_bridge_raise");
RewindAnimation("lava_bridge_drop");
PlayAnimation("lava_bridge_drop");

-- prevent the AI from running across it
BlockPlanningGraphArcs("Connection82");
BlockPlanningGraphArcs("Connection83");
EnableBarriers("Bridge");

end
-- CLOSE
function PlayAnimRise()
PauseAnimation("lava_bridge_drop");
RewindAnimation("lava_bridge_raise");
PlayAnimation("lava_bridge_raise");

end
-- allow the AI to run across it
UnblockPlanningGraphArcs("Connection82");
UnblockPlanningGraphArcs("Connection83");
DisableBarriers("Bridge");

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("dc:ingame.lvl")
ReadDataFile("ingame.lvl")

ReadDataFile("sound\\mus.lvl;mus1gcw")

--SetMaxFlyHeight(43)
--SetMaxPlayerFlyHeight (43)

EnableAIAutoBalance()

SetTeamAggressiveness(IMP, 0.75)
SetTeamAggressiveness(REP, 0.75)

SetAIDifficulty(9, 9)

ReadDataFile("SIDE\\all.lvl")
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_ep3_officer_hunt")

ReadDataFile("dc:SIDE\\imp.lvl",
"imp_inf_dark_trooper_hunt")

SetupTeams{

rep = {
team = REP,
units = 32,
reinforcements = -1,

sniper = { "rep_inf_ep3_officer_hunt",8},


},
imp = {
team = IMP,
units = 32,
reinforcements = -1,
soldier = { "imp_inf_dark_trooper_hunt", 8},

}
}


--Setting up Heros--



-- Level Stats
ClearWalkers()
-- AddWalkerType(0, 0) -- 8 droidekas (special case: 0 leg pairs)
-- AddWalkerType(1, 3) -- 8 droidekas (special case: 0 leg pairs)
-- AddWalkerType(2, 0) -- 2 spider walkers with 2 leg pairs each
-- AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
SetMemoryPoolSize("EntityCloth", 34)
SetMemoryPoolSize("EntitySoundStatic", 133)
SetMemoryPoolSize("Obstacle", 500)
SetMemoryPoolSize("Weapon", 260)
SetMemoryPoolSize("EntityFlyer", 4)
SetMemoryPoolSize ("SoldierAnimation", 800)
SetMemoryPoolSize("ParticleTransformer::ColorTrans", 3000)
SetMemoryPoolSize ("ParticleTransformer::SizeTransf", 3000)
SetMemoryPoolSize ("ParticleTransformer::PositionTr", 3000)

SetSpawnDelay(10.0, 0.25)
-- AddDeathRegion("deathregion")
ReadDataFile("dc:MFU\\mus1.lvl", "mus1_tdm")
SetDenseEnvironment("false")
SetMaxFlyHeight(84.16)
SetMaxPlayerFlyHeight(84.16)
--SetStayInTurrets(1)
AISnipeSuitabilityDist(30)


-- Movies
-- SetVictoryMovie(ALL, "all_end_victory")
-- SetDefeatMovie(ALL, "imp_end_victory")
-- SetVictoryMovie(IMP, "imp_end_victory")
-- SetDefeatMovie(IMP, "all_end_victory")

-- Sound

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_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("dc:sound\\tfu.lvl", "tfugcw_music")
OpenAudioStream("sound\\global.lvl", "gcw_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\mus.lvl", "mus1")
OpenAudioStream("sound\\mus.lvl", "mus1")
-- OpenAudioStream("sound\\mus.lvl", "mus1_emt")

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

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

SetOutOfBoundsVoiceOver(1, "allleaving")
SetOutOfBoundsVoiceOver(2, "impleaving")

SetAmbientMusic(REP, 1.0, "cis_kam_amb_start", 0,1)
SetAmbientMusic(IMP, 1.0, "cis_kam_amb_start", 0,1)


SetVictoryMusic(REP, "rep_kam_amb_victory")
SetDefeatMusic (REP, "rep_kam_amb_victory")
SetVictoryMusic(IMP, "cis_kam_amb_victory")
SetDefeatMusic (IMP, "cis_kam_amb_victory")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
-- SetSoundEffect("BirdScatter", "birdsFlySeq1")
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")


SetAttackingTeam(ATT)


AddCameraShot(0.446393, -0.064402, -0.883371, -0.127445, -93.406929, 72.953865, -35.479401);

AddCameraShot(-0.297655, 0.057972, -0.935337, -0.182169, -2.384067, 71.165306, 18.453350);

AddCameraShot(0.972488, -0.098362, 0.210097, 0.021250, -42.577881, 69.453072, 4.454691);

AddCameraShot(0.951592, -0.190766, -0.236300, -0.047371, -44.607018, 77.906273, 113.228661);

AddCameraShot(0.841151, -0.105984, 0.526154, 0.066295, 109.567764, 77.906273, 7.873035);

AddCameraShot(0.818472, -0.025863, 0.573678, 0.018127, 125.781593, 61.423031, 9.809184);

AddCameraShot(-0.104764, 0.000163, -0.994496, -0.001550, -13.319855, 70.673264, 63.436607);

AddCameraShot(0.971739, 0.102058, 0.211692, -0.022233, -5.680069, 68.543945, 57.904160);

AddCameraShot(0.178437, 0.004624, -0.983610, 0.025488, -66.947433, 68.543945, 6.745875);

AddCameraShot(-0.400665, 0.076364, -0896894, -0.170941, 96.201210, 79.913033, -58.604382)
end
The parts in red you can most likely delete. Chances are, if your making hunt on your own map, that has tatooine assets your not gonna need the bridges stuff/window stuff. The other red lines are: An extra read data file, that doesn't call for a side, and a PS2 block which is completely useless. And acording to AQT, you can delete the CP's.
Also, did you make a new layer in ZE called hunt, and then added the CP's for hunt in that layer? This may not affect anything, but it might be a reason why. Also, can you spawn? or just the bots wont spawn?

Re: Hunt crashes.

Posted: Thu Sep 22, 2011 2:19 am
by AQT
Tears2Roses wrote:Also, did you make a new layer in ZE called hunt, and then added the CP's for hunt in that layer? This may not affect anything, but it might be a reason why.
He's using the unused stock Mustafar TDM layer, and that should be fine.

Code: Select all

ReadDataFile("dc:MFU\\mus1.lvl", "mus1_tdm")
There are no major differences between how Hunt and TDM/ELI layers are set up.