Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Scripting Player reaction
3gamers Offline
Junior Member

Posts: 10
Threads: 6
Joined: Oct 2013
Reputation: 0
#1
Scripting Player reaction

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?

Nepenthe- WIP
05-23-2016, 09:06 PM
Find
goodcap Offline
Member

Posts: 193
Threads: 112
Joined: Jun 2012
Reputation: 3
#2
RE: Scripting Player reaction

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)
05-23-2016, 10:08 PM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#3
RE: Scripting Player reaction

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: (Select All)
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

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 05-24-2016, 04:01 PM by Romulator.)
05-23-2016, 10:10 PM
Find
Darkfire Offline
Senior Member

Posts: 371
Threads: 22
Joined: May 2014
Reputation: 15
#4
RE: Scripting Player reaction

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

05-24-2016, 03:11 PM
Find




Users browsing this thread: 1 Guest(s)