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
how do I use global variables concept? [Solved]
jssjr90 Offline
Member

Posts: 169
Threads: 39
Joined: Jun 2011
Reputation: 0
#5
RE: how do I use global variables concept?

I think im getting it, so I think I would set it up like this mabye

void OnStart()
{
SetEntityPlayerInteractCallback("phonecall", "phonecallfunc", true);

}



void phonecallfunc(string &in asEntity)
{
//"TasksDone" can be what ever i want like "TasksDoneLevel1"
AddGlobalVarInt("TasksDone", 1);

SetPlayerActive(false);
StartPlayerLookAt("phone", 0.2, 1, "");
AddTimer("", 1.0f, "stoplookat");
}
void stoplookat(string &in asTimer)
SetPlayerActive(true);
{
StopPlayerLookAt();
}



//Another map file where the bed is

void OnStart()
{
SetEntityPlayerInteractCallback("bed", "bedfunc", true);

}

void bedfuncfunc(string &in asEntity)

{
if (GetLocalVarInt("TasksDone") == 20)



{
//I know what to put. to change level incert here
}
else
SetMessage("Tips", "I was not tired yet", 0.0f);


}




So where do I set the Global main Variable so that it reads though all maps? Is it in some special file?


12-05-2011, 12:04 AM
Find


Messages In This Thread
RE: how do I use global variables concept? - by jssjr90 - 12-05-2011, 12:04 AM



Users browsing this thread: 1 Guest(s)