Frictional Games Forum (read-only)
Hps file doesn't work - 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: Hps file doesn't work (/thread-13241.html)



Hps file doesn't work - Shives - 02-11-2012

Hi
When i'm entering the map the game doesn't crash but he doesn't respond to the script.
What I've done wrong?



////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "Area_1", "Waterlurker", true, 9);
AddEntityCollideCallback("Player", "ScriptArea_1", "Waterlurker_2", true, 9);
AddEntityCollideCallback("Player", "ScriptArea_2", "Waterlurker_3", true, 9);
AddUseItemCallback("", "Hammer", "Gate", "Kaputt", true);
SetEntityConnectionStateChangeCallback("Lever", "hochfahr");
AddEntityCollideCallback("Player", "Levelchanger", "teleport", true, 1);
}
void Waterlurker(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("waterlurker_1", true);
}
void Waterlurker_2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("waterlurker_2", true);
SetEntityActive("waterlurker_1", false);
}
void Waterlurker_3(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("waterlurker_3", true);
SetEntityActive("waterlurker_2", false);
}
void Kaputt(string &in asItem, string &in asEntity)
{
SetEntityActive("Kaputt", true);
SetEntityActive("Gate", false);
SetEntityActive("Box", false);
PlaySoundAtEntity("", "break_wood_metal_3.snt", "Player", 0, false);
}
void hochfahr(string &in asEntity, int alState)
{
if (alState == 1)
{
SetEntityActive("Gate_2", false);
SetEntityActive("Opened", true);
SetEntityActive("Box_2", false);
return;
}
}
void teleport(string &in asParent, string &in asChild, int alState)
{
ChangeMap("Gang.map", "PlayerStartArea_1", "", "");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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



RE: Hps file doesn't work - flamez3 - 02-11-2012

Have you named the script file the same as the map file? And is it in the same folder?


RE: Hps file doesn't work - Shives - 02-11-2012

yes
it has the same name



RE: Hps file doesn't work - flamez3 - 02-11-2012

AddEntityCollideCallback("Player", "ScriptArea_2", "Waterlurker_3", true, 9);


Instead of 9, put 1


Do that on all of them