Frictional Games Forum
[SCRIPT] Variable Prefix - Printable Version

+- Frictional Games Forum (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: [SCRIPT] Variable Prefix (/thread-24051.html)



Variable Prefix - RaideX - 12-07-2013

So yeah. Basically what the title says:

when i use a callback syntax in my scriptfile like this:

PHP Code:
OnStart {
AddEntityCollideCallback("Player""HatchEvent""HatchEvent"true1);
}

void HatchEvent (string &in asParentstring &in asChildint alState

When the script is executed the variables asParent, asChild and alState are getting replaced by the function that calls the syntax above.

Now to my question, what excectly does "alState" mean. State is self explanatory, that is for sure, but what does the "al" before that mean. With "as" it's quite easy. But the other one is a mystery to me!

(I know that these variables can be replaced by everything else variable wise, but i'd really like to know what the normal variable names mean)

Hope you'r getting my point here.

-RaideX


RE: Variable Prefix - Daemian - 12-07-2013

As a programmer, I think al in alState stands for alternate cause it changes. (between -1, 0 and 1).
Just a guess, only FG know the real truth.


RE: Variable Prefix - Adrianis - 12-11-2013

Not sure exactly what the 'a' is (possibly meant to just be a, as in 'a string', although Amns suggestion sounds pretty reasonable), but 'l' is probably for long, which is an integer type in a number of languages
as - string
al - long
ab - bool
af - float

I usually just use my own, str in bl & fl to append the parameters


RE: Variable Prefix - Apjjm - 12-11-2013

I've always interpreted it as a style of hungarian notation, indicating information about the variable. In this case the 'a' is probably for angel-script (as this style was used in penumbra scripts too) and s/l/b/f etc are for the type.


RE: Variable Prefix - Daemian - 12-11-2013

You're totally right. Forget what I said.