Frictional Games Forum (read-only)
Amnesia Freezing? - 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: Amnesia Freezing? (/thread-16346.html)



Amnesia Freezing? - GetHimNotMe - 06-20-2012

Hey,

My amnesia custom story keeps freezing when loading a map. It has something to do with the script because I've tried removing all script functions from the .hps file (leaving only OnStart, OnEnter, etc.) and it would load. There is no crash, only freeze on "Loading..."
Heres my script file:


////////////////////////////
// Run when entering map
void OnStart()
{
PlayMusic("23_amb02.ogg", true, 1.0, 4.0, 0, true);
SetPlayerSanity(50);
AddEntityCollideCallback("Player", "spawnsteve", "comesteve", true, 1);
AddEntityCollideCallback("Player", "dead", "deadend", true, 1);
AddEntityCollideCallBack("steve2", "black", "fadetoblack");
}

void comesteve(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("steve", true);
ShowEnemyPlayerPosition("steve");
}

void deadend(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("lookhere", 3, 3, "looksteve");
}

void looksteve(string &in asTimer)
{
StartPlayerLookAt("steve2", 10, 10, "");
}

void fadetoblack(string &in asTimer)
{
FadeOut(0);
FadeEnemyToSmoke("steve2", true);
StopMusic("23_amb02.ogg", 0);
StopLookAt();
AddTimer("", 3, "switch");
}

void switch(string &in asTimer)
{
ChangeMap("01-2.map", "PlayerStartArea_1", "", "");
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Thanks in advance!


RE: Amnesia Freezing? - MaZiCUT - 06-20-2012

Maybe it doesen't load anything?


[Image: 40.png]


RE: Amnesia Freezing? - Apjjm - 06-20-2012

Try the following:
  • switch is a reserved word. Try calling your function something different.
  • AddEntityCollideCallBack("steve2", "black", "fadetoblack"); is missing the last two parameters, and also has a caps B in the middle which will need to be corrected.
  • If this fails, try emptying the script and starting the game in developer mode (see the wiki), then paste the script contents back in, save the map file and click "recompile script and lang", some error messages should pop up indicating what else needs to be fixed.



RE: Amnesia Freezing? - GetHimNotMe - 06-21-2012

(06-20-2012, 09:44 PM)Apjjm Wrote: Try the following:
  • switch is a reserved word. Try calling your function something different.
  • AddEntityCollideCallBack("steve2", "black", "fadetoblack"); is missing the last two parameters, and also has a caps B in the middle which will need to be corrected.
  • If this fails, try emptying the script and starting the game in developer mode (see the wiki), then paste the script contents back in, save the map file and click "recompile script and lang", some error messages should pop up indicating what else needs to be fixed.
Wow, completely overlooked that. Thanks!