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
Script Help common scripts
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#6
RE: common scripts

(08-07-2012, 12:50 PM)Lake Wrote: I'm talking about two different maps! Use this script if nothing will happen because the entities to appear is in a dose map from this script will be activated
Fret not my friend! What you need is a variable, a global variable. Global variables act as normal variables, except they work on different levels of the game. You've been pretty vague up to this point in actually describing what causes the change in levels and what the change actually is, so I had to improvise some ideas, but change them to whatever suits your needs.

///First Map
void OnStart()
{
SetGlobalVarInt("global_var", 0);
}

void YourFunction()
{
AddGlobalVarInt("global_var", 1); //add this to change the second map
}

//--------------------------------------------------------------------------------//

///Second Map
void OnEnter()
{
if(GetGlobalVarInt("global_var") == 1)
{
///stuff you want to have happen in the second map
}
}


Hope that helped.

I rate it 3 memes.
08-07-2012, 05:50 PM
Find


Messages In This Thread
common scripts - by Lake - 08-07-2012, 12:00 PM
RE: common scripts - by lolmaster - 08-07-2012, 12:32 PM
RE: common scripts - by Lake - 08-07-2012, 12:39 PM
RE: common scripts - by lolmaster - 08-07-2012, 12:45 PM
RE: common scripts - by Lake - 08-07-2012, 12:50 PM
RE: common scripts - by Adny - 08-07-2012, 05:50 PM



Users browsing this thread: 1 Guest(s)