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
Script Help Checkpoint help
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#11
RE: Checkpoint help

I see the problem.

PHP Code: (Select All)
void ReloadCheckpoint2(string &in asNameint alCount)
{
    if(
HasItem("LevelEndKey_1"))
    {
        
SetSwingDoorClosed("prison_1"truefalse);
        
//AddEntityCollideCallback("Player", "LockCellarDoor_01", "CellarChase", true, 1);
        
SetEntityActive("CellarBrute_01"false);
        
RemoveItem("LevelEndKey_1");
        
CreateEntityAtArea("LevelEndKey_1""key_laboratory.ent""RespawnCellarKey"false);
    }


The script is saying "Only do this if the player has the key". Nothing happens if the player doesn't have the key. No doors are unlocked, no callback re-added etc.

I modified it slightly:

PHP Code: (Select All)
void ReloadCheckpoint2(string &in asNameint alCount)
{
    if(
HasItem("LevelEndKey_1"))
    {
        
SetSwingDoorClosed("prison_*"truefalse);
        
AddEntityCollideCallback("Player""LockCellarDoor_01""CellarChase"true1);
        
SetEntityActive("CellarBrute_01"false);
        
SetSwingDoorLocked("CellarDoor_01",false,false);
        
SetEntityActive("BruteDisappear_01",false);
        
RemoveItem("LevelEndKey_1");
        
CreateEntityAtArea("LevelEndKey_1""key_laboratory.ent""RespawnCellarKey"false);
    }
    
    else
    {
        
SetSwingDoorClosed("prison_*"truefalse);
        
SetSwingDoorLocked("CellarDoor_01",false,false);
        
SetEntityActive("BruteDisappear_01",false);
        
AddEntityCollideCallback("Player""LockCellarDoor_01""CellarChase"true1);
        
SetEntityActive("CellarBrute_01"false);
    }


Adding the else statement ensures everything is reset, regardless of whether or not player has the key.

You'll see that I deactivated "CellarBrute_01" area. This is because it locked the entrance to the maze after I had respawned. Also, be sure to make the "Checkpoint_2" area encompass the entire first room (I was able to bypass it a few times).

Hopefully this solves your issues.

RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
04-25-2013, 05:07 PM
Find


Messages In This Thread
Checkpoint help - by Dominic0904 - 04-24-2013, 06:01 PM
RE: Checkpoint help - by Tomato Cat - 04-24-2013, 07:16 PM
RE: Checkpoint help - by Dominic0904 - 04-24-2013, 09:01 PM
RE: Checkpoint help - by Tomato Cat - 04-24-2013, 11:08 PM
RE: Checkpoint help - by Dominic0904 - 04-25-2013, 02:13 PM
RE: Checkpoint help - by PutraenusAlivius - 04-25-2013, 02:33 PM
RE: Checkpoint help - by Dominic0904 - 04-25-2013, 03:58 PM
RE: Checkpoint help - by Tomato Cat - 04-25-2013, 02:51 PM
RE: Checkpoint help - by Tomato Cat - 04-25-2013, 04:14 PM
RE: Checkpoint help - by Dominic0904 - 04-25-2013, 04:32 PM
RE: Checkpoint help - by Tomato Cat - 04-25-2013, 05:07 PM
RE: Checkpoint help - by Dominic0904 - 04-25-2013, 06:47 PM
RE: Checkpoint help - by Tomato Cat - 04-25-2013, 08:08 PM
RE: Checkpoint help - by Dominic0904 - 04-25-2013, 09:21 PM
RE: Checkpoint help - by Dominic0904 - 04-27-2013, 06:36 PM
RE: Checkpoint help - by Tomato Cat - 04-27-2013, 07:07 PM



Users browsing this thread: 1 Guest(s)