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
callback syntax altering
Southlaguna Offline
Member

Posts: 70
Threads: 21
Joined: Jan 2012
Reputation: 0
#1
callback syntax altering

Hey...

So i'm trying to figure out how to change the value of an int in my callback syntax. Specifcally:

void OnEnter()
{
SetEntityPlayerLookAtCallback("telewaves", "telewaves", false);
}

void telewaves(string &in asEntity, int alState)
{
if (int alState()==1){
FadeRadialBlurTo(0.03, 0.03);
AddDebugMessage("looking corner 1", false);
}
else if (int alState()==-1){
ChangePlayerStateToNormal();
}

}

I dont know if im waaaay off or like just off by a few pointers. im just trying to make it that visual effects happen in specific locations and instantly stop after i look away from that spot.

10-28-2015, 09:04 AM
Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#2
RE: callback syntax altering

void OnEnter()
{
SetEntityPlayerLookAtCallback("telewaves", "telewaves", false);
}

void telewaves(string &in asEntity, int alState)
{
if (alState == 1){
FadeRadialBlurTo(0.03, 0.03);
AddDebugMessage("looking corner 1", false);
}
else if (alState == -1){
ChangePlayerStateToNormal();
}
}
10-28-2015, 09:20 AM
Website Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
RE: callback syntax altering

You were close.
Jens showed you how it is supposed to look.

Usually you'd put '()' if what you're trying to call is a function (Which 'alState' isn't).
Ex.

PHP Code: (Select All)
void OnEnter()
{
ChangePlayerStateToNormal();


And the 'int' is a declaration of the variable 'alState' that you're going to be using. It should only be declared in the first line, where all the parameters go.
Ex.
PHP Code: (Select All)
void CollideFunction(string &in asParentstring &in asChildint alState

Also:
I'm not sure if the HPL engine will give you an error for this, but when you have a decimal number you should write an 'f' after it, to show that it's a float.
Ex.
PHP Code: (Select All)
FadeRadialBlurTo(0.03f0.03f); 

Trying is the first step to success.
10-28-2015, 05:09 PM
Find
Southlaguna Offline
Member

Posts: 70
Threads: 21
Joined: Jan 2012
Reputation: 0
#4
RE: callback syntax altering

Thanks all big help!

11-03-2015, 12:07 PM
Find




Users browsing this thread: 1 Guest(s)