Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Player look at script
Author Message
Shives Offline
Member

Posts: 154
Joined: Jan 2012
Reputation: 1
Post: #1
Player look at script

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

My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


03-10-2012 08:57 AM
Find all posts by this user Quote this message in a reply
Mackiiboy Offline
Member

Posts: 101
Joined: Jan 2012
Reputation: 11
Post: #2
RE: Player look at script

(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);
03-10-2012 10:50 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Shives Offline
Member

Posts: 154
Joined: Jan 2012
Reputation: 1
Post: #3
RE: Player look at script

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

if (SetEntityPlayerLookAtCallback(grunt_1, Monster, false);

My Custom Story
http://www.frictionalgames.com/forum/thread-12587.html

Sorry for bad English


03-11-2012 11:02 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)