Frictional Games Forum (read-only)
Script for after you read something? - 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 for after you read something? (/thread-25170.html)



Script for after you read something? - Gladoshatesyou - 04-26-2014

Hello. I want to make a script for after you read a note, you look at an object behind you, and then the game ends. I have no idea how to start or do this, Help maybe?


RE: Script for after you read something? - Neelke - 04-26-2014

Code:
void PickNote(string &in asEntity, string &in asType)
{
    //Stuff to happen
}

If you want the player to look at something use StartPlayerLookAt.


RE: Script for after you read something? - Slanderous - 04-26-2014

This function is also needed.

PHP Code:
void SetEntityCallbackFunc(stringasNamestringasCallback); 

Spoiler below!
Calls a function when the player interacts with a certain entity.
Callback syntax: void MyFunc(string &in asEntity, string &in type)
Type depends on entity type and includes: “OnPickup”, “Break”, “OnIgnite”, etc

Use in "void OnStart()" or "void OnEnter"

This page is very useful, ya know.


RE: Script for after you read something? - DnALANGE - 04-27-2014

Or add PickNote into youe leveleditor -> inside the note's entitie -> on PlayerInteractCallback add PickNote.
Then the void SetEntityCallbackFunc(string& asName, string& asCallback); is NOT nessesary