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
Activating a ScriptArea in one map from a different map
Cyphermur9t Offline
Junior Member

Posts: 38
Threads: 17
Joined: Jan 2013
Reputation: 2
#1
Activating a ScriptArea in one map from a different map

I wouldn't have an idea how to do this:
Activate a ScriptArea in one map from a different map.



I know how to use a key in a different map from the one it originates from. Sooo, that's basically my question. Sorry, completely clueless on this one Huh
03-25-2013, 02:50 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Activating a ScriptArea in one map from a different map

You have to set up global variables as well as make a global.hps to make it work.
03-25-2013, 03:34 AM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#3
RE: Activating a ScriptArea in one map from a different map

As Statyk said, you will need to use global variables. Create a file called "global.hps" and put it in your maps folder. Then write this in the file:
PHP Code: (Select All)
void OnGameStart()
{
    
SetGlobalVarInt("EventHappened"0);

(you can name the variable anything you want)

Then once the event happens in the other map and you want to activate the script area, write
AddGlobalVarInt("EventHappened", 1);

In the script for the map with the script area, write this (make sure you write it in the OnEnter function):
PHP Code: (Select All)
void OnEnter()
{
    if(
GetGlobalVarInt("EventHappened") == 1) {
        
SetEntityActive("ScriptAreaNameHere"true);
    }


In Ruins [WIP]
03-25-2013, 06:01 AM
Find




Users browsing this thread: 2 Guest(s)