Frictional Games Forum (read-only)

Full Version: Amnesia Freezing?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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!
Maybe it doesen't load anything?


[Image: 40.png]
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.
(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!