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
Hepl script Amnesia The Dark Descent!
lllDash Offline
Member

Posts: 108
Threads: 12
Joined: Apr 2012
Reputation: 3
#7
RE: Hepl script Amnesia The Dark Descent!

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.

My Custom Story: KEY TO FREEDOM: http://www.moddb.com/mods/key-to-freedom
09-07-2013, 11:36 AM
Find


Messages In This Thread
RE: Hepl script Amnesia The Dark Descent! - by lllDash - 09-07-2013, 11:36 AM



Users browsing this thread: 1 Guest(s)