Frictional Games Forum (read-only)
Variable - 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: Variable (/thread-9569.html)



Variable - X4anco - 08-03-2011

Hello peoples Big Grin ,
Would:
Code:
GetLocalVarInt(string& asName);
Get the value of the variable so I could use it like this:
Code:
void Wake(string &in asTimer)
{
    if(GetLocalVarInt(Breath)==3) Something
    else PlayGuiSound("react_breath_slow.snt", 1);
        AddLocalVarInt("Breath", 1);
        AddTimer("return", 2.45, "Wake");
}
And so it repeats until "Breath" has got to three. I have already set up "Breath" to 0

Thanks


RE: Variable - Apjjm - 08-03-2011

Yes it would, but your code has some errors.
Firstly, you missed a pair of quotation marks. Secondly your function would loop endlessly; What you are currently doing:
Code:
void Wake(string &in asTimer)
{
    if(GetLocalVarInt("Breath")==3)
     {
       //Something
      }
    else
       {
          PlayGuiSound("react_breath_slow.snt", 1);
        }
        AddLocalVarInt("Breath", 1);
        AddTimer("return", 2.45, "Wake");
}
What you want (i assume):
Code:
void Wake(string &in asTimer)
{
  if(GetLocalVarInt("Breath")==3)
   {
     //Something
    }
   else
     {
       PlayGuiSound("react_breath_slow.snt", 1);
       AddLocalVarInt("Breath", 1);
       AddTimer("return", 2.45, "Wake");
     }
}
Hope that helps Wink



RE: Variable - X4anco - 08-03-2011

Thank-you Big Grin Big Grin Big Grin Big Grin