The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Script Help New Problem: SetEntityPlayerLookAtCallback
araphon1 Offline
Junior Member

Posts: 5
Threads: 2
Joined: Mar 2012
Reputation: 0
#1
New Problem: SetEntityPlayerLookAtCallback

I dont want the grunt to move away until I look at him. This is what Frictional Games say about this callback:

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

So, what I did was this:

void OnStart()
{
SetEntityPlayerLookAtCallback("Entity", "Function", true);
}

This means that when I look at "Entity" the script calls "Function" and then removes the callback, right?

Now here's the function:

void Function(string &in asEntity, 1)
{
AddEnemyPatrolNode("Entity","PathNodeArea_4",1,"idle");
AddEnemyPatrolNode("Entity","PathNodeArea_5",0,"idle");
}

Doesnt work. My error message: Expected Data Type (pointed at the ,1 in void Funtion)
So I figured, ok, I need to declare data type as Integer:

void Function(string &in asEntity,int 1)

Nope. THen I got the error "Expected ) or ," pointing right after the "int". So I added a ,

void Function(string &in asEntity,int, 1)

After which I get the data error again.
(This post was last modified: 03-14-2012, 02:17 PM by araphon1.)
03-14-2012, 02:15 PM
Find


Messages In This Thread
New Problem: SetEntityPlayerLookAtCallback - by araphon1 - 03-14-2012, 02:15 PM



Users browsing this thread: 1 Guest(s)