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


Messages In This Thread
RE: Activating a ScriptArea in one map from a different map - by NaxEla - 03-25-2013, 06:01 AM



Users browsing this thread: 1 Guest(s)