Frictional Games Forum (read-only)
How to activate entities by looking at an area - 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: How to activate entities by looking at an area (/thread-19196.html)



How to activate entities by looking at an area - tonitoni1998 - 11-12-2012

hey guys,

i need your help once again. i already checked the wiki but cant find the code for it...

and if you could give me the code for signs, you collide with... thanks


RE: How to activate entities by looking at an area - Steve - 11-12-2012

There is an Playerlookatcallback thingy in the options of an area try working with that Wink


RE: How to activate entities by looking at an area - tonitoni1998 - 11-12-2012

(11-12-2012, 06:37 PM)Steve Wrote: There is an Playerlookatcallback thingy in the options of an area try working with that Wink
yes i know but i dont know how to work with that Big Grin im a noob here Tongue


RE: How to activate entities by looking at an area - FlawlessHappiness - 11-12-2012

It works like this:
When the cursor is inside the area, the function is calling.

Ex. if the function is "LookAtAreaFunc"

then it is:

void LookAtAreaFunc(string &in asEntity, int alState)
{
if(alState == 1) //Only if the player is look at the area
{
//Do stuff
}
}


RE: How to activate entities by looking at an area - The chaser - 11-12-2012

(11-12-2012, 06:48 PM)tonitoni1998 Wrote:
(11-12-2012, 06:37 PM)Steve Wrote: There is an Playerlookatcallback thingy in the options of an area try working with that Wink
yes i know but i dont know how to work with that Big Grin im a noob here Tongue
SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);


Name: Name of the entity
Callback: Function