Frictional Games Forum (read-only)
callback syntax altering - 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: callback syntax altering (/thread-31457.html)



callback syntax altering - Southlaguna - 10-28-2015

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.


RE: callback syntax altering - jens - 10-28-2015

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();
}
}


RE: callback syntax altering - FlawlessHappiness - 10-28-2015

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); 



RE: callback syntax altering - Southlaguna - 11-03-2015

Thanks all big help!