Frictional Games Forum (read-only)
[SCRIPT] Scripting Player reaction - 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] Scripting Player reaction (/thread-47930.html)



Scripting Player reaction - 3gamers - 05-23-2016

I want to script my custom story so that when the Player reads the first note, a body appears before them, along with a little jerking of the camera so it feels as if the character is jarred and frightened by this sight.

I believe I know how to do the second part, it is scripting the body to appear after reading the note. I know this is probably really simple but I've tried several kinds of callback functions and none of them work properly.

Any ideas?


RE: Scripting Player reaction - goodcap - 05-23-2016

void OnStart()
{
SetEntityPlayerInteractCallback("", "FUNC", true);
}

void FUNC(string &in asEntity)
{
SetEntityActive("NAMEOFBODY", true);

*put the screen shaking script here*
}


Go to the note you've placed. Press the Entity tab>PlayerInteractCallback.
and write FUNC (or whatever you've replaced FUNC with)


RE: Scripting Player reaction - Romulator - 05-23-2016

goodcap ninja'd me :p oh well, I'll leave my post here :3

SetEntityPlayerInteractCallback(); is what I believe you'll want. Don't know if you'll need to use an if-then-else conditional, but something like this should work:

PHP Code:
void KeyPickup(string &in asEntity)
{
    if(
asType == "OnPickup")
    {
    
SetEntityActive("Body"true);
    
//Player Reaction Scripting
    
}


If the body pops up "too" instantly, add a timer that triggers your script about 0.08f after picking up the note. Do so by scripting an AddTimer inside the if's {} code block, then script the sequence in the void <Timer> code block. Smile


RE: Scripting Player reaction - Darkfire - 05-24-2016

And I thought I'll never see Screaming Naked Guys again.