Frictional Games Forum (read-only)

Full Version: Hepl script Amnesia The Dark Descent!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone, sorry for my english, I'm Italian and I'm creating a mod of amnesia, I need the script of one or more monsters you kill me and I go into a different map, what is it? thanks in advance
Do you mean you want to be teleported somewhere after a monster kills you?
yes, I mean that, as I do?
You can try and create a script area at where you normally would re-spawn once you die. In the script file you can get that area to teleport the player when the player collides with that same script area.
I did not understand. How is the script?
Create a script area called "ScriptArea_death_1". place the script area on the spot where the player will respawn (the start area should be called "PlayerStartArea_1"). Create another start area called "PlayerStartArea_2" and place that where you want the player to teleport to after the player dies. make sure that "ScriptArea_death_1" is not active, then activate it when the monster spawns.

void OnEnter()
{
AddEntityCollideCallback("Player", "ScriptArea_death_1", "afterdeath", true, 1);
}

void afterdeath(string &in asParent, string &in asChild, int alState)
{
TeleportPlayer("PlayerStartArea_2");
}

If you want to teleport into a different map then use this instead:

void OnEnter()
{
AddEntityCollideCallback("Player", "ScriptArea_death_1", "afterdeath", true, 1);
}

void afterdeath(string &in asParent, string &in asChild, int alState)
{
ChangeMap("name_of_map.map", "PlayerStartArea_1", "", "");
}

I tend to make mistakes in my scripts, so if anyone can check this and confirm that this is correct.
Thank you very much!