Frictional Games Forum (read-only)
[SCRIPT] Function doesn't get called after interaction - 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: [SCRIPT] Function doesn't get called after interaction (/thread-17493.html)



Function doesn't get called after interaction - KingCrimson - 08-05-2012

I want my player to get teleported when he uses an altar knife on the floor. But when i interact with it, nothing happens. I leave you my .hps file so you can find the error:

Quote:////////////////////////////
// Run when the map starts
void OnStart()
{
void sleep(string& dreams, string& PlayerStartArea_1, string& asStartSound, string& asEndSound;
}

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

}

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

}
Thanks in advance


RE: Function doesn't get called after interaction - Ongka - 08-05-2012

Your script is basically empty.
Have a look at the Frictional Games Wiki to get help about scripting.


RE: Function doesn't get called after interaction - EXAWOLT - 08-05-2012

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "knife", "floor", "sleep", true);
}

void sleep(string &in asItem, string &in asEntity)
{
(write the scripts that you want to call here)
}

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

}

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

}