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?
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#4
RE: how can i change what the map is like when he dies?

(02-22-2013, 08:15 PM)Statyk Wrote: 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

thanks that was what i am looking for Smile

When you are looking for someone, to do the scripting for your Custom Story, ask me!
02-23-2013, 12:41 AM
Find


Messages In This Thread
RE: how can i change what the map is like when he dies? - by tonitoni1998 - 02-23-2013, 12:41 AM



Users browsing this thread: 1 Guest(s)