Frictional Games Forum (read-only)
[SCRIPT] common scripts - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] common scripts (/thread-17564.html)



common scripts - Lake - 08-07-2012

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)


RE: common scripts - lolmaster - 08-07-2012

You mean:

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



RE: common scripts - Lake - 08-07-2012

(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


RE: common scripts - lolmaster - 08-07-2012

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



RE: common scripts - Lake - 08-07-2012

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


RE: common scripts - Adny - 08-07-2012

(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.