Frictional Games Forum (read-only)
Player look at script - 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: Player look at script (/thread-13889.html)



Player look at script - Shives - 03-10-2012

Hi
I've got a question
How to script following:
If the player looks at the enemy the Path nodes should be cleared

I can't find the syntax to do it



RE: Player look at script - Mackiiboy - 03-10-2012

(03-10-2012, 08:57 AM)Shives Wrote: Hi
I've got a question
How to script following:
If the player looks at the enemy the Path nodes should be cleared

I can't find the syntax to do it
.
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) <-Do not forget to use this syntax

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

And put this in the called function, it clears the current path of patrol nodes of the enemy:
ClearEnemyPatrolNodes(string& asEnemyName);




RE: Player look at script - Shives - 03-11-2012

when I want to put it in an "If"
Should it looks like this?

if (SetEntityPlayerLookAtCallback(grunt_1, Monster, false);