04-25-2013, 05:07 PM
I see the problem.
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:
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.
PHP Code:
void ReloadCheckpoint2(string &in asName, int alCount)
{
if(HasItem("LevelEndKey_1"))
{
SetSwingDoorClosed("prison_1", true, false);
//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:
void ReloadCheckpoint2(string &in asName, int alCount)
{
if(HasItem("LevelEndKey_1"))
{
SetSwingDoorClosed("prison_*", true, false);
AddEntityCollideCallback("Player", "LockCellarDoor_01", "CellarChase", true, 1);
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_*", true, false);
SetSwingDoorLocked("CellarDoor_01",false,false);
SetEntityActive("BruteDisappear_01",false);
AddEntityCollideCallback("Player", "LockCellarDoor_01", "CellarChase", true, 1);
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.