The map works now, but when I jump into the hole I just fall through the script area and it doesn't change the map. Here is the script:
void OnStart()
{
AddUseItemCallback("", "key1", "castle_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key2", "metal_1", "UsedKeyOnDoor2", true);
AddUseItemCallback("", "key2", "castle_3", "UsedKeyOnDoor3", true);
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player" , "ScriptArea_3" , "MonsterFunc2" , true , 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "ChangeMap", true, 1);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("key1");
}
void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("metal_1", false, true);
PlaySoundAtEntity("", "unlock_door", "metal_1", 0, false);
RemoveItem("key2");
}
void UsedKeyOnDoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_3", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_3", 0, false);
RemoveItem("key3");
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_grunt_1" , true);
}
void MonsterFunc2(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_grunt_2" , true);
}
void Changemap(string &in asParent, string &in asChild, int alStates)
{
ChangeMap("Level2", "PlayerStartArea_1", "break_stairs", "water_lurker_eat");
}