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
Variable
X4anco Offline
Member

Posts: 157
Threads: 66
Joined: Apr 2011
Reputation: 0
#1
Variable

Hello peoples Big Grin ,
Would:
GetLocalVarInt(string& asName);
Get the value of the variable so I could use it like this:
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

...
08-03-2011, 12:36 AM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#2
RE: Variable

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:
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):
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
(This post was last modified: 08-03-2011, 12:42 AM by Apjjm.)
08-03-2011, 12:40 AM
Find
X4anco Offline
Member

Posts: 157
Threads: 66
Joined: Apr 2011
Reputation: 0
#3
RE: Variable

Thank-you Big Grin Big Grin Big Grin Big Grin

...
08-03-2011, 12:47 AM
Find




Users browsing this thread: 1 Guest(s)