Frictional Games Forum (read-only)
Changing map after being killed by monster - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Changing map after being killed by monster (/thread-14230.html)



Changing map after being killed by monster - Sprytny - 03-25-2012

Hi, I have big problem as I wrote in thread subject. I have the door and after putting the key into them the monster appears. I want the player to spawn on the other map after being killed by him. I don't have any idea, here is a part of my code:



Code:
void DoorKeyIn(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("ambushdoor", false, true);
    PlaySoundAtEntity("", "unlock_door", "ambushdoor", 0, false);
    RemoveItem("ambushdoorkey");
    PlayGuiSound("player_bodyfall5.ogg",1);
    PlaySoundAtEntity("", "enabled.snt", "servant_grunt_1", 0,false);
    PlaySoundAtEntity("", "attack_claw_hit.snt", "servant_grunt_1", 0,false);
    SetEntityActive("servant_grunt_1", true);
}

void CheckPointAbduction(string &in asName, int alCount)
{
    AddTimer("ChangeMap", 5.0, "TimerChangeMap");
    FadeOut(0.0f);
    SetPlayerActive(false);
    PlayGuiSound("22_end.snt", 1.0f);
}
void TimerChangeMap(string &in asChangeMap)
{
    ChangeMap("piwnica.map","PlayerStartArea_1", "", "");    
}



RE: Changing map after being killed by monster - Unearthlybrutal - 03-25-2012

Smile Use this:

Spoiler below!

void DoorKeyIn(string &in asItem, string &in asEntity)
{ // .lang category and entry for death hints
CheckPoint ("checkpoint", "", "CheckPointAbduction", " [.lang category] ", " [.lang entry] ");
SetSwingDoorLocked("ambushdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "ambushdoor", 0, false);
RemoveItem("ambushdoorkey");
PlayGuiSound("player_bodyfall5.ogg",1);
PlaySoundAtEntity("", "enabled.snt", "servant_grunt_1", 0,false);
PlaySoundAtEntity("", "attack_claw_hit.snt", "servant_grunt_1", 0,false);
SetEntityActive("servant_grunt_1", true);
}

void CheckPointAbduction(string &in asName, int alCount)
{
AddTimer("ChangeMap", 5.0, "TimerChangeMap");
FadeOut(0.0f);
SetPlayerActive(false);
PlayGuiSound("22_end.snt", 1.0f);
}
void TimerChangeMap(string &in asChangeMap)
{
ChangeMap("piwnica.map","PlayerStartArea_1", "", "");
}





RE: Changing map after being killed by monster - Sprytny - 03-25-2012

It works ! Thanks a lot !!!


RE: Changing map after being killed by monster - Unearthlybrutal - 03-25-2012

No problem Smile