Frictional Games Forum (read-only)

Full Version: common scripts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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)
You mean:

Code:
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
(08-07-2012, 12:32 PM)lolmaster Wrote: [ -> ]You mean:

Code:
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
Do you mean:
Code:
SetEntityActive(string& asName, bool abActive);
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)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.