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
Lake Offline
Member

Posts: 58
Threads: 20
Joined: Jul 2012
Reputation: 0
#1
common scripts

I want to go into the map A when in an area of ​​script, something happens in another B map.

But if they are separate maps the usual script does not work ... so how can I do?

P.S. sorry for grammatical error (I used a google translate, I'm italian)
08-07-2012, 12:00 PM
Find
lolmaster Offline
Member

Posts: 170
Threads: 9
Joined: Jul 2012
Reputation: 6
#2
RE: common scripts

You mean:

ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);


08-07-2012, 12:32 PM
Find
Lake Offline
Member

Posts: 58
Threads: 20
Joined: Jul 2012
Reputation: 0
#3
RE: common scripts

(08-07-2012, 12:32 PM)lolmaster Wrote: You mean:

ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
o, I do not try to change a script map, I'll explain:

To take time to map an object, I want something that appears in map B was not there before, I want a way to make something happen in a different map from where you are
08-07-2012, 12:39 PM
Find
lolmaster Offline
Member

Posts: 170
Threads: 9
Joined: Jul 2012
Reputation: 6
#4
RE: common scripts

Do you mean:
SetEntityActive(string& asName, bool abActive);


08-07-2012, 12:45 PM
Find
Lake Offline
Member

Posts: 58
Threads: 20
Joined: Jul 2012
Reputation: 0
#5
RE: common scripts

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
08-07-2012, 12:50 PM
Find
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




Users browsing this thread: 1 Guest(s)