Load new level in Game Launcher

#1
I load my start level in Game Launcher like

Code: Select all

gEnv->pConsole->ExecuteString("map First_Level", false, true);
All is fine.
But then, on some point I want to load the next level, doing the same thing

Code: Select all

gEnv->pConsole->ExecuteString("map Second_Level", false, true);
and game craches. Log provides only this little information
<12:08:57> [CONSOLE] Executing console command 'map Second_Level'
<12:08:57> ============================ Loading level Second_Level ============================
<12:08:57> Ending game context...
<12:08:57> Destroying CActionGame instance 0000013EC9FFBA50 (level="First_Level")
<12:08:57> UnLoadLevel StartCritical error detected c0000374
How this can be solved?

Re: Load new level in Game Launcher

#2
You mentioned that you use the launcher (pure game mode). This requires that you have exported your level from the sandbox editor to the engine. Did you do this? As far as I remember correctly the shortcut for this in the editor is F7. Or you just click File->Export to Engine.

- Jannis

Re: Load new level in Game Launcher

#4
You could try first if it works with Flowgraph. Inside the „Mission“ nodes you‘ll find the Node „LodNextLevel“. Just try if this node works (does not work inside of editor). If it works, then you can use it‘s code here: https://github.com/CRYTEK/CRYENGINE/blo ... nNodes.cpp

It uses the ScheduleEndLevel function of CCryAction (by the way: if you type gEnv->pGameFramework... this is actually the CCryAction instance). You can see the definition of this function here:
https://github.com/CRYTEK/CRYENGINE/blo ... ryAction.h
Line 216. There is also on line 217 the function ScheduleEndLevelNow.

So basically what you can try ist this:
gEnv->pGameFramework->ScheduleEndLevel(„Second_Level“);

If this code does not work, but the FlowNode works (which uses the same piece of code), then you have pretty likely a bug somewhere else.

- Jannis

Who is online

Users browsing this forum: No registered users and 2 guests

cron