The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Amnesia stopped working when loading map
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#1
Amnesia stopped working when loading map

Hey guys, I'm working on a custom story, and added an effect where the player is simulated as being dragged. You are dragged through three maps, and i use "ChangeMap" to transfer the player to the next map. The first map is working fine, and so is the second. But when the third map starts loading, I get the message "Amnesia.exe stopped working" (actually it says that on swedish, I just translated, so those might not be the exact words).
Well, since the third map actually starts loading (you can see the "loading" text), i figured that the problem is most likely located in the third map's .hps file. Usually I get an error message, but this crash gives me no hint what the problem might be. So maybe someone can help me find it?

Here's the LAST script entry from the second map, since everything else works fine in that map:

AddTimer("W11", 23.0f, "Action");



else if(asTimer == "W11")
{
ChangeMap("04_Dream_3.map", "PlayerStartArea_8", "", "");
}

(these are located in the right place, i just cut them out. I have the "void OnStart()" and "void Action" in my file.)

Here's the third maps whole .hps file:


void OnStart()
{
SetLanternDisabled(true);
SetPlayerActive(false);
ShowPlayerCrossHairIcons(false);
SetPlayerCrouching(true);
FadePlayerRollTo(50, 150, 150);
FadeRadialBlurTo(0.1, 0.4);
FadeImageTrailTo(2.0, 0.4);
FadeSepiaColorTo(100.0, 4.0);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);
PlaySoundAtEntity("one", "15_drag_body.snt", "Player", 0, false);

AddTimer("", 0.1, "Drag");
AddTimer("", 2, "DragSounds");

StartPlayerLookAt("LookAt_8", 1.0f, 1.0f, "");

AddTimer("W1", 2.0f, "Action");
AddTimer("W2", 4.0f, "Action");
AddTimer("W3", 6.0f, "Action");
AddTimer("W4", 10.0f, "Action");
AddTimer("W5", 12.0f, "Action");
AddTimer("W6", 14.0f, "Action");
AddTimer("W7", 15.0f, "Action");
AddTimer("W8", 16.0f, "Action");
AddTimer("W9", 18.0f, "Action");
AddTimer("W10", 20.0f, "Action");
AddTimer("W11", 26.0f, "Action");
AddTimer("W12", 27.5f, "Action");
}

void Drag(string &in asTimer)
{
AddPlayerBodyForce(3000, 0, 0, false);
AddTimer("drag", 0.1, "Drag");
}

void Drag2(string &in asTimer)
{
AddPlayerBodyForce(0, 0, -3000, false);
AddTimer("drag", 0.1, "Drag");
}

void DragSounds(string &in asTimer)
{
StopSound("one", 0);
PlaySoundAtEntity("one", "15_drag_body.snt", "Player", 0, false);
AddTimer("", 2, "DragSounds");
}

void Action(string &in asTimer)
{
if(asTimer == "W1")
{
PlaySoundAtEntity("", "player_cough.snt", "Player", 0, false);
}
else if(asTimer == "W2")
{
FadeOut(2);
}
else if(asTimer == "W3")
{
RemoveTimer("drag");
TeleportPlayer("PlayerStartArea_9");
AddTimer("", 0.1, "Drag2");
}
else if(asTimer == "W4")
{
FadeIn(1);
StartPlayerLookAt("LookAt_9", 1.0f, 1.0f, "");
PlaySoundAtEntity("", "player_cough.snt", "Player", 0, false);
}
else if(asTimer == "W5")
{

}
else if(asTimer == "W6")
{
FadeOut(0.5f);
StartPlayerLookAt("LookAt_6", 1.0f, 1.0f, "");
}
else if(asTimer == "W7")
{
FadeIn(0.5);
}
else if(asTimer == "W8")
{
PlaySoundAtEntity("", "player_cough.snt", "Player", 0, false);
}
else if(asTimer == "W9")
{
PlaySoundAtEntity("", "insanity whisper.snt", "Player", 0, false);
FadeOut(3.0f);
}
else if(asTimer == "W10")
{
TeleportPlayer("PlayerStartArea_10");
SetPlayerCrouching(false);
FadePlayerRollTo(0, 33, 33);
FadeRadialBlurTo(0.0, 1.0);
FadeSepiaColorTo(0.0, 25.0);
FadeImageTrailTo(0.0, 0.1);
StartPlayerLookAt("LookAt_10", 6.0f, 6.0f, "");
}
else if(asTimer == "W11")
{
SetLightVisible("lighty", true);
PlaySoundAtEntity("", "24_iron_maiden.snt", "scare4", 0.0f, false)
PlaySoundAtEntity("", "amb_alert.snt", "Player", 0, false);
StartScreenShake(0.1f, 0.1f, 0.0f, 0.1f);
GiveSanityDamage(10.0f, true);
}
else if(asTimer == "W12")
{
FadeOut(0);
}
}

void OnEnter()
{

}

void OnLeave()
{

}

These commands have been called in all three maps, located under "void OnStart()". Is that wrong?:



SetLanternDisabled(true);
SetPlayerActive(false);
ShowPlayerCrossHairIcons(false);
SetPlayerCrouching(true);
FadePlayerRollTo(50, 150, 150);
FadeRadialBlurTo(0.1, 0.4);
FadeImageTrailTo(2.0, 0.4);
FadeSepiaColorTo(100.0, 4.0);

Thank you for your help.

Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
07-07-2012, 12:28 PM
Find


Messages In This Thread
Amnesia stopped working when loading map - by Wapez - 07-07-2012, 12:28 PM



Users browsing this thread: 1 Guest(s)