Page 1 of 2

Game crashes when map is launched [Solved]

Posted: Mon Dec 03, 2012 12:13 pm
by Noobasaurus
All of a sudden, my map crashes before it loads. As in, you press the start button and it freezes. I'm assuming this is a problem with the addme so here you go(I haven't done anything to it recently):
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 = 20,
blue = 40,
green = 240,
isModLevel = 1,
mapluafile = "GAA%s_%s",
era_g = 1,
era_c = 1,
mode_c2_g = 1,
mode_c2_c = 1,
mode_c1_c = 1,
mode_c1_g = 1,
mode_c4_g = 1,
mode_c4_c = 1,
mode_c3_g = 1,
mode_c3_c = 1,
change = {
mode_c1 = { name="Easy", icon="mode_icon_wav", about="Even though this may be the easiest mode, it's still not that easy." },

mode_c2 = { name="Medium", icon="mode_icon_rpg", about="Harder than easy but easier than hard." },

mode_c3 = { name="Hard", icon="mode_icon_survival", about="Watch for ambushes and other evilness!" },
mode_c4 = { name="5 Minutes", icon="mode_icon_siege", about="Need a quick break to PWN? Here you are!" },

era_g = { name="Alpha Squad", icon2="mode_icon_xtra" },

era_c = { name="The Really Cool People", icon2="mode_icon_uber" },

},
}
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("GAA","GAAg_c2",4)
AddDownloadableContent("GAA","GAAc_c2",4)
AddDownloadableContent("GAA","GAAg_c1",4)
AddDownloadableContent("GAA","GAAc_c1",4)
AddDownloadableContent("GAA","GAAg_c4",4)
AddDownloadableContent("GAA","GAAc_c4",4)
AddDownloadableContent("GAA","GAAg_c3",4)
AddDownloadableContent("GAA","GAAc_c3",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\GAA\\data\\_LVL_PC\\core.lvl")
And here is my error log:
Hidden/Spoiler:
Opened logfile BFront2.log 2012-12-03 0810
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
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
ifs_missionselect_pcMulti_fnSetMapPreview(): Stored movie name, file: preview-loop MOVIES\pre-movie
this.CurButton = nil
cur_button = nil
custom_CheckChangeMovies(): Update(): Time to change movies
ifs_missionselect_pcMulti_ChangeMovieFile(): MovieFile: nil
ifs_missionselect_pcMulti_ChangeMovieFile(): Closed any open movie
ifs_missionselect_pcMulti_ChangeMovieFile(): Opening movie: MOVIES\pre-movie.mvs
ifs_missionselect_pcMulti_ChangeMovieFile(): Finished opening movie
this.CurButton = check_mode17
cur_button = nil
Checkbox for check_era3 clicked
this.CurButton = check_era3
cur_button = nil
this.CurButton = nil
cur_button = nil
DoubleClicked
custom_AddMapNew()
custom_printTable(): table: 0538036C
The key, value is: mode_c1_c 1
The key, value is: era_g 1
The key, value is: isModLevel 1
The key, value is: mode_c1_g 1
The key, value is: bSelected 1
The key, value is: mode_c2_g 1
The key, value is: era_c 1
The key, value is: mode_c4_c 1
The key, value is: red 20
The key, value is: blue 40
The key, value is: mode_c3_g 1
The key, value is: mode_c2_c 1
The key, value is: green 240
The key, value is: change table: 0538044C
The key, value is: mode_c3_c 1
The key, value is: mode_c4_g 1
The key is mapluafile, the formated value is: GAA<A>_<B>
custom_printTable(): Returning
custom_printTable(): table: 05385F0C
The key, value is: key mode_c1
The key, value is: subst c1
The key, value is: showstr modename.name.c1
The key, value is: descstr modename.description.c1
The key, value is: icon mode_icon_c1
custom_printTable(): Returning
gMapEras.key = era_c Era = era_c subst = c
Adding map: GAAc_c1 idx: 1
this.CurButton = Launch
cur_button = nil

Anyone know what is causing this problem? It can't be a problem with the units; they aren't even loaded at this point in time.

Re: Map crashes before it loads

Posted: Mon Dec 03, 2012 1:09 pm
by Fiodis
What do the LUAs for the crashing modes look like?

Re: Map crashes before it loads

Posted: Mon Dec 03, 2012 7:17 pm
by Noobasaurus
All modes crash in all eras. Here's one .lua:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

--THIS IS THE EASY MODE--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_SetGameRules("campaign")
ScriptCB_DoFile("ObjectiveTDM")


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

function ScriptPostLoad()

SetProperty("cp2", "SpawnPath", "")
SetProperty("Local_Cp", "SpawnPath", "")
ShowMessageText("level.GAA.objectives.campaign.start", ATT)

--Timer STARTZ--
music01Timer = CreateTimer("music01")
SetTimerValue(music01Timer, 90.0)

StartTimer(music01Timer)


OnTimerElapse(
function(timer)
SetProperty("cp2", "SpawnPath", "cp2_spawn")
SetProperty("Local_Cp", "SpawnPath", "Local_Spawn")
ShowMessageText("level.GAA.objectives.campaign.timerend", ATT)
DestroyTimer(timer)
end,
music01Timer
)

--Timer for victory startz nao...also known as when the first timer elapses--
music02Timer = CreateTimer("music02Timer")
SetTimerValue(music02Timer, 630.0)
ShowTimer(music02Timer)
StartTimer(music02Timer)
OnTimerElapse(
function(timer)
MissionVictory(ATT)
ShowTimer(nil)


DestroyTimer(timer)
end,
music02Timer
)

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




--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:Start()

SetUberMode(1);

EnableSPHeroRules()

AddDeathRegion("death")
AddDeathRegion("death1")

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


SetMaxFlyHeight(300)
SetMaxPlayerFlyHeight (300)

SetMemoryPoolSize ("ClothData",50)
SetMemoryPoolSize ("Combo",500) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",6500) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",6500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",6500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",9500) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",22000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo

ReadDataFile("sound\\kam.lvl;kam1cw")
ReadDataFile("dc:SIDE\\gam.lvl",
"gam_inf_gamorreanguard",
"gam_inf_elite")
ReadDataFile("dc:SIDE\\imp.lvl",
"imp_inf_obi",
"imp_inf_ganimedes")




SetupTeams{
cis = {
team = CIS,
units = 350,
reinforcements = -1,
soldier = { "gam_inf_gamorreanguard",100, 250},
assault = { "gam_inf_elite",50,150},

},
rep = {
team = REP,
units = 50,
reinforcements = 300,
assault = { "imp_inf_ganimedes",0, 20},
}
}



SetTeamName (3, "jawas")
AddUnitClass (3, "gam_inf_gamorreanguard", 150,300)
SetUnitCount (3, 170)
AddAIGoal(3, "Deathmatch", 1000)
SetTeamAsEnemy(ATT,3)
SetTeamAsEnemy(3,ATT)
SetTeamAsFriend(DEF,3)
SetTeamAsFriend(3,DEF)
SetTeamAsFriend(4,3)
SetTeamAsFriend(3,4)


-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 4) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 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("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("SoldierAnimation", 1500)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntityPortableTurret", 1200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 99)
SetMemoryPoolSize("LightFlash", 400)
SetMemoryPoolSize("Navigator", 500)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("UnitController", 500)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 600)
SetMemoryPoolSize("UnitController", 750)
SetMemoryPoolSize("ParticleTransformer::SizeTransf", 1400)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(0.0, 0.0)
--ReadDataFile("dc:GAA\\GAA.lvl", "GAA_conquest")
ReadDataFile("dc:GAA\\GAA.lvl", "GAA_conquest")
SetDenseEnvironment("false")




-- 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\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1_emt")

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)

SetOutOfBoundsVoiceOver(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")

SetAmbientMusic(REP, 1.0, "rep_yav_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_yav_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_yav_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_yav_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_yav_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_yav_amb_end", 2,1)

SetVictoryMusic(REP, "rep_yav_amb_victory")
SetDefeatMusic (REP, "rep_yav_amb_defeat")
SetVictoryMusic(CIS, "cis_yav_amb_victory")
SetDefeatMusic (CIS, "cis_yav_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")


--OpeningSateliteShot AddCameraShot(0.763622, 0.012544, -0.645455, 0.010603, 125.539291, 63.603477, -17.511637);
AddCameraShot(-0.198788, -0.005538, -0.979647, 0.027292, 149.981628, 64.837639, -60.428387);
AddCameraShot(0.005205, -0.001663, -0.952560, -0.304300, 139.273087, 99.218147, -62.060764);

end
EDIT: It appears that no matter what map I play, it crashes before it loads. This includes all installed mods/maps and stock maps. Does anyone know how to fix this?

Re: Map crashes before it loads

Posted: Mon Dec 03, 2012 8:18 pm
by AQT
If you remove your custom map from the addon folder, will the other maps that are not this custom map no longer crash?

Re: Map crashes before it loads

Posted: Mon Dec 03, 2012 8:30 pm
by Noobasaurus
No. I removed it and the other maps still crash.

Re: Map crashes before it loads

Posted: Mon Dec 03, 2012 8:32 pm
by Dreadnot9
You've probably already done this, but have you tried simply re-installing the game?

Re: Map crashes before it loads

Posted: Mon Dec 03, 2012 8:35 pm
by Noobasaurus
Nope. I have no idea where my CD is. :P

This is a recent error, so I'm thinking that it is probably something that I did recently.

Re: Map crashes before it loads

Posted: Mon Dec 03, 2012 8:43 pm
by Dreadnot9
Have you been editing any of the game files recently (the stock files obviously, not addon stuff)?
You could always, as a last resort, get it on steam when their Christmas sales com around, should be pretty cheap then (I'm pretty sure mods work with steam...).

Re: Map crashes before it loads

Posted: Mon Dec 03, 2012 8:49 pm
by Noobasaurus
I recently put Kashyyyk back in its rightful place within the game files, but this was after the crashing began.

Re: Map crashes before it loads

Posted: Mon Dec 03, 2012 9:25 pm
by Dreadnot9
Why was Kashyyyk deleted in the first place? Is it possible other files were deleted at the same time?

Re: Map crashes before it loads

Posted: Mon Dec 03, 2012 9:37 pm
by Noobasaurus
Kashyyyk disappeared a while back, back before everything stopped working. Of course it is still possible that something was deleted that helps load maps.

EDIT: I tried to join a multiplayer server and it said that my CD key was not authorized to play this game. Perhaps I do need to find my CD and install it instead of just copying it over.

EDIT2: I found my CDs and am now installing the game.

Re: Map crashes before it loads

Posted: Mon Dec 03, 2012 10:15 pm
by Dreadnot9
Hopefully that works out for you!

Re: Map crashes before it loads

Posted: Mon Dec 03, 2012 10:27 pm
by Noobasaurus
I finished installing the game. I tried to play a map and it crashed before it began to load. :cry:

EDIT: I re-installed the game with no luck.

EDIT2: Could an admin please move this over to General SWBF2 please? It no longer fits here as this is a problem with the game, not a mod.

Re: Game crashes when map is launched

Posted: Tue Dec 04, 2012 12:53 am
by THEWULFMAN
I've got limited time, so I can't read over everything right now. You removed all of the mods, and stock maps crash?

Re: Game crashes when map is launched

Posted: Tue Dec 04, 2012 12:54 am
by Noobasaurus
Yes, I re-installed the vanilla game.

Re: Game crashes when map is launched

Posted: Tue Dec 04, 2012 1:03 am
by Marth8880
What's your operating system? Try going to Options, Audio, and set the mixer config to none.

Re: Game crashes when map is launched

Posted: Tue Dec 04, 2012 1:32 am
by Noobasaurus
Windows 8.

I clicked on the volume thing and went to mixer, but there was no "none" option. It just showed some volume levels for different applications and my speakers.

Re: Game crashes when map is launched

Posted: Tue Dec 04, 2012 1:51 am
by Marth8880
Err, whoops, that's the channel config. I meant the thing above (or below, forgot) it, usually lists "Hardware" or "Software", set that to None.

Re: Game crashes when map is launched

Posted: Tue Dec 04, 2012 3:24 am
by THEWULFMAN
Given that it's Windows 8, it could be behaving in a way we can't predict. Though I can't imagine it's all that different from 7, it's still possible.

We just don't have the experience with Win8 yet.

There might be some leftover files in your AppData folder that are causing the crash. They're a Vista and 7 thing, probably 8 as well.

Re: Game crashes when map is launched

Posted: Tue Dec 04, 2012 11:40 am
by Noobasaurus
Here's all the sound options I can find:
Hidden/Spoiler:
Image
BTW: When I installed it it thought I was using Vista.