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
Maps change other maps
FragdaddyXXL Offline
Member

Posts: 136
Threads: 20
Joined: Apr 2012
Reputation: 7
#7
RE: Maps change other maps

Say you have a lever in level 2 that opens a door in level 1.

Level 1:
Quote: In the OnEnter() function, check your global variable with an if-else statement to see if it has changed from it's initial value.
void OnEnter()
{
    CheckPoint("WaveChpt", "PlayerStartArea_FromLevel2", "ResetWave", "", "");
    AddTimer("SanityTimer", 0.5f, "UpdateSanity"); //Set up a timer on entry.
    int temp = GetGlobalVarInt("lockdown");
    if(temp == 1)
    {        
        AddEntityCollideCallback("Player", "ScriptArea_FinalWave", "FinalWave", true, 1);
        AddTimer("TriggerBrute2", 4.0f, "SpawnBrute");        
    }
    
}

Now, in level 2, set the lever to change the global variable from 0 to 1.

void StopLockdown(string &in asEntity, int alState)
{
    
    if(alState <= -0.9)
    {
        PlaySoundAtEntity("", "unlock_door.snt", "Player", 0, false);        
        StartScreenShake(0.1f, 6.0f, 1.0f, 1.4f);        
        PlaySoundAtEntity("", "21_alex_low_freq_rumble2.snt", "Player", 0, false);        
        SetMessage("Messages", "SwitchMessage", 9);
        SetGlobalVarInt("lockdown", 1);        
    }    
    
}

(Ripped this straight from one of my CSs, so sorry about the extra code Tongue)

Dark Seclusion Here
(This post was last modified: 05-18-2012, 08:35 PM by FragdaddyXXL.)
05-18-2012, 08:34 PM
Find


Messages In This Thread
Maps change other maps - by lllDash - 05-14-2012, 01:34 AM
RE: Maps change other maps - by Putmalk - 05-14-2012, 02:23 AM
RE: Maps change other maps - by FragdaddyXXL - 05-15-2012, 12:40 AM
RE: Maps change other maps - by lllDash - 05-17-2012, 03:11 PM
RE: Maps change other maps - by Putmalk - 05-17-2012, 03:33 PM
RE: Maps change other maps - by lllDash - 05-18-2012, 05:58 PM
RE: Maps change other maps - by FragdaddyXXL - 05-18-2012, 08:34 PM
RE: Maps change other maps - by lllDash - 05-18-2012, 11:42 PM
RE: Maps change other maps - by lllDash - 05-20-2012, 12:15 AM
RE: Maps change other maps - by FragdaddyXXL - 05-20-2012, 01:58 AM



Users browsing this thread: 1 Guest(s)