Frictional Games Forum (read-only)
[SCRIPT] [SOLVED] An event after reading a note - 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] [SOLVED] An event after reading a note (/thread-18198.html)



[SOLVED] An event after reading a note - Kiwi2703 - 09-07-2012

I have a simple question (I somehow couldn't find the answer anywhere..) - How to make certain events happen after reading a note? Player interaction callback doesn't work :/ Thanks in advance Smile


RE: An event after reading a note - FlawlessHappiness - 09-07-2012

It should work.. It works for me. Or... I haven't tested it yet. I worked once.
I guess what happpens is that the event has 0.3 sec to start, and then the note pauses the game while you read it...


RE: An event after reading a note - Robby - 09-07-2012

(09-07-2012, 04:46 PM)Kiwi2703 Wrote: I have a simple question (I somehow couldn't find the answer anywhere..) - How to make certain events happen after reading a note? Player interaction callback doesn't work :/ Thanks in advance Smile
In the Level Editor, select the note that you chose, click the "Entity" tab, then there is "PlayerInteractCallback". Enter "Note_Event" (for example, and without quotes).

In the script file, use the syntax
Code:
void Note_Event(string &in asEntity)
{
    (YOUR EVENT)
}

If this won't work, I don't know what will. Are you sure that the names are correct? Is the syntax (mentioned in code) correct?

If you had the map open in Amnesia while 'creating' the script file (not editing it, like creating the hps file after you loaded the map up), exit Amnesia, then start it back up.

EDIT: beecake got here sooner.


RE: An event after reading a note - Steve - 09-07-2012

http://imageshack.us/photo/my-images/37/thisl.png/
this and this:
void thishappens(string &in asEntity)
{
stuff to happen
}

Edit: I got ninjaed


RE: An event after reading a note - Kiwi2703 - 09-07-2012

Yesss, it works Smile Thanks Smile
The thing was, I had this:

void theprisoner(string &in asParent, string &in asChild, int alState)

instead of this:

void theprisoner(string &in asEntity)

because originally I set it to start when player collides with an area.
Thank you! Smile


RE: An event after reading a note - Robby - 09-07-2012

(09-07-2012, 05:05 PM)Steve Wrote: http://imageshack.us/photo/my-images/37/thisl.png/
this and this:
void thishappens(string &in asEntity)
{
stuff to happen
}

Edit: I got ninjaed
Kinda late, but also a great example.


RE: An event after reading a note - FlawlessHappiness - 09-07-2012

(09-07-2012, 05:06 PM)Kiwi2703 Wrote: Yesss, it works Smile Thanks Smile
The thing was, I had this:

void theprisoner(string &in asParent, string &in asChild, int alState)

instead of this:

void theprisoner(string &in asEntity)

because originally I set it to start when player collides with an area.
Thank you! Smile
Always remember to use the right syntax Wink