Frictional Games Forum (read-only)
Script after note is read? - 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 after note is read? (/thread-26527.html)



Script after note is read? - Spazatron - 10-02-2014

Is there any way to execute a script after a note has been closed?


RE: Script after note is read? - Neelke - 10-02-2014

Yes. When you click the entity there's something named CallbackFunc. In there write the name of the function you want to execute.

In the script you write this.

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



RE: Script after note is read? - Spazatron - 10-02-2014

(10-02-2014, 01:50 PM)Neelke Wrote: Yes. When you click the entity there's something named CallbackFunc. In there write the name of the function you want to execute.

In the script you write this.

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

I thought of that, but will the script be put on hold until the note is closed? Or will it happen while the note is being read?


RE: Script after note is read? - Neelke - 10-02-2014

After it has been read.


RE: Script after note is read? - Mudbill - 10-02-2014

It actually happens AS you pick it up. If you for example play a sound effect, it will play instantly, even while the note is open.

Here's a trick: Timers freeze during notes. If you add a timer of just 0.001, it will freeze and not continue before the note has been closed.


RE: Script after note is read? - Spazatron - 10-04-2014

(10-02-2014, 03:48 PM)Mudbill Wrote: It actually happens AS you pick it up. If you for example play a sound effect, it will play instantly, even while the note is open.

Here's a trick: Timers freeze during notes. If you add a timer of just 0.001, it will freeze and not continue before the note has been closed.

Awesome, thanks.