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
Scripting Help with good idea
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#1
Scripting Help with good idea

hey Guys. I got a good Idea with my custom story but I don't know if it's possible or how to do it.

I got the idea from the Mod "Nightmare House 2", theres a part where this door is locked so you turn around and a girl is standing right there and then she disappears and the door unlocks.

I want to do something similar with Alexander (SPOILER ALERT)




Since He's a ghost. I have a distraction in the room to hopefully make the person stare at what not until he appears and then when you look at him make him disappear really quickly (Jump Scare?)

I Just don't know how to do this in the script

Any Help Appreciated Hopefully this is Possible

-Grey Fox

Current Project
Forgotten
08-10-2011, 08:53 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#2
RE: Scripting Help with good idea

Sure is possible! I'm not gonna give full script, but just some functions what to use.

Just use AddEntityCollideCallback to start the event when the player is past the point where alexander spawns spawning alexander behind him. Then just use SetEntityPlayerLookAtCallback to check when player looks behind him (I suggest using an area) and use a timer to time the fade out of alexander.

I'm not sure if you can use SetPropActiveAndFade to fade him out smoothly or should you just use some particle effects.

(This post was last modified: 08-10-2011, 09:14 PM by Khyrpa.)
08-10-2011, 09:14 PM
Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#3
RE: Scripting Help with good idea

Okay i'm Completely lost on how to use the SetEntityPlayerLookAtCallback Syntax Function

this is what I have so far.

void OnStart()
{
SetEntityPlayerLookAtCallback("Alexander1", "Alexander1", true);
}

void Alexander1(string &in asEntity, int alState)
{
What Do I Put Here!?? I'm So Confused hhaa
}

I have the trigger for him Activating behind perfect.

Thank you

-Grey Fox

Current Project
Forgotten
08-10-2011, 10:17 PM
Find
xiphirx Offline
Senior Member

Posts: 662
Threads: 16
Joined: Nov 2010
Reputation: 5
#4
RE: Scripting Help with good idea

You would activate the ghost alexander entity and add a look at callback for the alexander entity. For the alexander entity's look at callback, just deactivate.


08-10-2011, 10:20 PM
Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#5
RE: Scripting Help with good idea

Uhh Xiphirx? I'm Sorry But you confused me? Lol could you possibly type it and elabrate a little? Or anyone? Is my script so far correct?

Thank you
-Grey Fox

Current Project
Forgotten
08-10-2011, 10:50 PM
Find
xiphirx Offline
Senior Member

Posts: 662
Threads: 16
Joined: Nov 2010
Reputation: 5
#6
RE: Scripting Help with good idea

Your script is a little wrong.

First, you want to have a look at callback (SetEntityPlayerLookAtCallback()) on the door you want to trigger the event.

The callback function associated with the door should activate the alexander entity you have (behind the player) and add a look at callback (SetEntityPlayerLookAtCallback()) to alexander.

The callback function associated with alexander should just simply deactivate alexander.

08-10-2011, 10:57 PM
Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#7
RE: Scripting Help with good idea

Ohh!, xiphirx I think i got you confused. that thing with the door was just with that mod,(Nightmare house)

I'll give you my setup.

I have a trigger, when you walk past the trigger it activates Alexander. (Theres a chest that I the player will open and grab the thing inside hopefully) When the play turns around I want Alexander to be floating there for a split second (or whatever) and disappear/Deactivate.

I've tried serveral other things but all seem to fail (Not giving me the correct idea I had, IE I turned around and he just sat there.....)

Thank you
-Grey Fox

Current Project
Forgotten
08-10-2011, 11:08 PM
Find
xiphirx Offline
Senior Member

Posts: 662
Threads: 16
Joined: Nov 2010
Reputation: 5
#8
RE: Scripting Help with good idea

Okay then... its the same deal. Just apply the first look at callback to the chest.

08-10-2011, 11:10 PM
Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#9
RE: Scripting Help with good idea

Okay I tried it, it didn't work. so I did it another way so when you open the chest Alexander Spawns. But whenever I look at him he doesn't disappear.

Don't Know what else to do.

I have

////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("chest_small_1", "CollideActivateAlex", true);
SetEntityPlayerLookAtCallback("alexander_1", "Alexander1", false);
}

void CollideActivateAlex(string &in Entity)
{
    SetEntityActive("alexander_1", true);
}

void Alexander1(string &in asEntity, int alState)
{
    SetEntityActive("alexander_1", false);
}


Thank you and Sorry For Not Understanding

-Grey Fox

Current Project
Forgotten
08-10-2011, 11:42 PM
Find
xiphirx Offline
Senior Member

Posts: 662
Threads: 16
Joined: Nov 2010
Reputation: 5
#10
RE: Scripting Help with good idea

try


////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("chest_small_1", "CollideActivateAlex", true);
}

void CollideActivateAlex(string &in Entity)
{
    SetEntityActive("alexander_1", true);
    SetEntityPlayerLookAtCallback("alexander_1", "Alexander1", false);
}

void Alexander1(string &in asEntity, int alState)
{
    SetEntityActive("alexander_1", false);
}

08-10-2011, 11:58 PM
Find




Users browsing this thread: 1 Guest(s)