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
how can i change what the map is like when he dies?
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#3
RE: how can i change what the map is like when he dies?

You need to create a checkpoint before the place the player will die at and in that checkpoint function, there is a callback feature (labelled "DEATHMAP" in my example). Give it a function to load the new map. When the player dies, it will call that checkpoint and will load the new map.

Example:
void OnStart()
{
    AddEntityCollideCallback("Player", "CPArea", "checkpoint1_func", true, 1); //area the player walks into to create the checkpoint
}

void checkpoint1_func(string &in asparent, string &in aschild, int alstate)
{
    CheckPoint("checkpoint1", "PlayerStartArea_1", "DEATHMAP", "DeathHintCategory", "DeathHintEntry"); //checkpoint with callback for new map
}

void DEATHMAP(string &in asname, int alcount)
{
    ChangeMap("MapName", "PlayerStartPos", "StartSound", "EndSound"); //loading new map upon death
}

Use Ctrl+F to find the functions here so you can get a better understanding of the strings and whatnot:
http://wiki.frictionalgames.com/hpl2/amn..._functions
(This post was last modified: 02-22-2013, 08:16 PM by Statyk.)
02-22-2013, 08:15 PM
Find


Messages In This Thread
RE: how can i change what the map is like when he dies? - by Statyk - 02-22-2013, 08:15 PM



Users browsing this thread: 1 Guest(s)