Frictional Games Forum (read-only)

Full Version: callback syntax altering
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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();
}
}
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:
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:
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:
FadeRadialBlurTo(0.03f0.03f); 
Thanks all big help!