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
Callback for when you look at a specific place
sgthale Offline
Junior Member

Posts: 22
Threads: 13
Joined: Aug 2011
Reputation: 1
#1
Callback for when you look at a specific place

Callback for when you look at a specific place. What script function would you use for it?
08-21-2011, 10:21 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: Callback for when you look at a specific place

void 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
asCallback - function to call
abRemoveWhenLookedAt - determines whether the callback should be removed when the player looked at the entity
08-21-2011, 10:27 PM
Find
Juby Away
Senior Member

Posts: 290
Threads: 2
Joined: May 2011
Reputation: 5
#3
RE: Callback for when you look at a specific place

There is also an option on all of the entities:

"PlayerLookAtCallback"
Put whatever you want in there.

Syntax for the lookat function:

void FuncName(string &in asEntity, int alState)
{
}

- I edit because there was misunderstanding, the (funcname) was just a placement Tongue

Insanity. Static.
(This post was last modified: 08-22-2011, 02:01 PM by Juby.)
08-21-2011, 10:38 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#4
RE: Callback for when you look at a specific place

(08-21-2011, 10:38 PM)Juby Wrote: There is also an option on all of the entities:

"PlayerLookAtCallback"
Put whatever you want in there.

Syntax for the lookat function:

void LookAt(funcname)(string &in asEntity, int alState)
{
}

I dont think the Function name goes in "()" so use this I guess:
void LookAt YourFuncName(string &in asEntity, int alState)

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

08-22-2011, 04:51 AM
Website Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#5
RE: Callback for when you look at a specific place

As Obliviator Stated it would be

SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);

not PlayerLookAtCallback (That Forces a Player to look somewhere)

-Grey Fox

Current Project
Forgotten
(This post was last modified: 08-22-2011, 04:54 AM by GreyFox.)
08-22-2011, 04:54 AM
Find




Users browsing this thread: 2 Guest(s)