Frictional Games Forum (read-only)
Fatal Error, Cannot Load World Map - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Fatal Error, Cannot Load World Map (/thread-10387.html)



Fatal Error, Cannot Load World Map - GreyFox - 09-18-2011

Hey Guys With my custom story whenever I got through a level door it brings up an error (the one in the title)
and then my game crashes. Don't Know what to do maybe my codes wrong.

Code:
////////////////////////////
// Run first time starting map
void OnEnter()
{
    SetEntityPlayerInteractCallback("ToTut2", "ChangeMap", false);
}

void ChangeMap(string &in asEntity)
{
    ChangeMap("Tut2.map", "PlayerStartArea_1", "", "");
}

And in my other maps HPS file

Code:
////////////////////////////
// Run first time starting map
void OnStart()
{
    SetEntityPlayerInteractCallback("ToTut1", "ChangeMap1", false);
}

void ChangeMap(string &in asEntity)
{
    ChangeMap1("Tutorial.map", "PlayerStartArea_2", "", "");
}

Thanks
-Grey Fox



RE: Fatal Error, Cannot Load World Map - Your Computer - 09-18-2011

I'm guessing you named the other map differently? (You also seem to have mixed up the function names.)


RE: Fatal Error, Cannot Load World Map - GreyFox - 09-18-2011

The Names are correct I know that.

What function names did I mess up?

-Grey Fox



RE: Fatal Error, Cannot Load World Map - Your Computer - 09-18-2011

(09-18-2011, 08:17 PM)GreyFox Wrote: What function names did I mess up?

In the "other map's" script, for the interact callback reference you have "ChangeMap1", but ChangeMap1 is inside another function (therefore cannot be accessed by the game, and if the game were to call it, it would generate an error).


RE: Fatal Error, Cannot Load World Map - GreyFox - 09-18-2011

Uhh So I switched

ChangeMap("Tutorial.map", "PlayerStartArea_2", "", "");

and

void ChangeMap1(string &in asEntity)

is that what you ment? Becuase I'm still getting an error. How do you do Level doors?

-Grey Fox



RE: Fatal Error, Cannot Load World Map - Your Computer - 09-18-2011

(09-18-2011, 08:36 PM)GreyFox Wrote: Uhh So I switched

ChangeMap("Tutorial.map", "PlayerStartArea_2", "", "");

and

void ChangeMap1(string &in asEntity)

is that what you ment? Becuase I'm still getting an error.

Code:
////////////////////////////
// Run first time starting map
void OnStart()
{
    SetEntityPlayerInteractCallback("ToTut1", "ChangeMap1", false);
}

void ChangeMap(string &in asEntity)
{
    ChangeMap1("Tutorial.map", "PlayerStartArea_2", "", "");
}

In SetEntityPlayerInteractCallback() you chose "ChangeMap1" for the callback. However, the ChangeMap1 function is located in your overloaded ChangeMap function. The game, therefore, will not be able to call the ChangeMap1 function because it hasn't be defined. However, this logical error won't (shouldn't) crash the game.

(09-18-2011, 08:36 PM)GreyFox Wrote: How do you do Level doors?

Level doors are as easy as placing them in your map, selecting it, and under the Entity tab (to the right) adjusting the properties. You don't need to use an interaction callback for the door to transfer the player to another map.


RE: Fatal Error, Cannot Load World Map - GreyFox - 09-18-2011

Oh really? I don't have to do anything in the HPS file for Level doors? Goddamnit I've spent all day trying to figure it out too Lol

Thank you I fixed it and it's now working.