Frictional Games Forum (read-only)
Callback for when you look at a specific place - 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: Callback for when you look at a specific place (/thread-9905.html)



Callback for when you look at a specific place - sgthale - 08-21-2011

Callback for when you look at a specific place. What script function would you use for it?


RE: Callback for when you look at a specific place - Obliviator27 - 08-21-2011

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


RE: Callback for when you look at a specific place - Juby - 08-21-2011

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


RE: Callback for when you look at a specific place - JetlinerX - 08-22-2011

(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)


RE: Callback for when you look at a specific place - GreyFox - 08-22-2011

As Obliviator Stated it would be

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

not PlayerLookAtCallback (That Forces a Player to look somewhere)

-Grey Fox