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
Not sure if this is possible, but I want to ask anyways
Ermu Offline
Member

Posts: 86
Threads: 13
Joined: Jan 2012
Reputation: 2
#3
RE: Not sure if this is possible, but I want to ask anyways

(06-10-2012, 01:02 AM)Ananaias Wrote: the bed changes into "bed_simple_movable" with a dead body on it, or even a suitor, with a bloody/very red scene.
Why do you want it a bed_simple_movable?
The body's are easy to do, just make a body on the bed and untick the "active"
then use the SetEntityActive("bodyname", true); in the script you want.
Same for the red theme, use red lights or so.
Though if you use like PointLight, you need this: SetLightVisible("lightname", true);
(06-10-2012, 01:02 AM)Ananaias Wrote: However, I don't want it to change until the player turns AROUND. So as he's turning around, it looks normal, but when the player is full turned, it changes, then after a few seconds, goes back to normal.

So, now here's the big question:

Is this possible? And if so, how would I go about doing it? Is there some sort of tutorial I could follow?

I believe you need an; SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);



Calls a function when the player looks at a certain entity.
Callback syntax: void MyFunc(string &in asEntity, int alState)
alState: 1 = looking, -1 = not looking
asName - internal name (the items name to look at)
asCallback - function to call
abRemoveWhenLookedAt - determines whether the callback should be removed when the player looked at the entity


-------------------------------------

Except, on how to trigger it.
Insert the SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);

inside the function that is triggered when you pull the lever, after it's pulled, and when you look at the bed, it should trigger the function you put in "string& asCallback";
void YourFuncNameHere(string &in asEntity, int alState)



EXAMPLE:

(PUT THIS INSIDE THE FUNCTION THAT IS CALLED WHEN LEVER PULLED)
{
SetEntityPlayerLookAtCallback("bed_scare", lookedatbed, true);

}

(PUT THIS ANYWHERE IN YOUR SCRIPT FILE)
void lookedatbed(string &in asEntity, int alState)
{
SetEntityActive("deadbody_scare", true);

SetLightVisible("redlight", true);

}


Hope you understood, and that this helped!

Never used "SetEntityPlayerLookAtCallback" so can't really help if it doesn't work.
(This post was last modified: 06-10-2012, 01:39 AM by Ermu.)
06-10-2012, 01:36 AM
Find


Messages In This Thread
RE: Not sure if this is possible, but I want to ask anyways - by Ermu - 06-10-2012, 01:36 AM



Users browsing this thread: 1 Guest(s)