Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing map if you die.
Author Message
onv Offline
Member

Posts: 51
Joined: Feb 2012
Reputation: 2
Post: #1
Changing map if you die.
Hello.

I'm making a custom story where i'm in a nightmare , and i wanna know if it's possible to make the map change (waking up Tongue ) if you die.

Help would be appreciated , thanks.
07-30-2012 01:43 PM
Find all posts by this user Quote this message in a reply
Adny Offline
Posting Freak

Posts: 1,750
Joined: Mar 2012
Reputation: 169
Post: #2
RE: Changing map if you die.
Here's a timer that checks the player's health every 0.2 seconds (this is smallest time to loop without having an effect on performance); if the player's health reaches 0, the map will change:


void OnStart()
{
AddTimer("dead", 0.2f, "Check_Dead");
}

void Check_Dead(string &in asTimer)
{
AddTimer("dead", 0.2f, "Check_Dead");

if(GetPlayerHealth() == 0.0f)
{
ChangeMap("NAME_OF_MAP", "NAME_OF_START_POSITION", "", "");
RemoveTimer(asTimer);
}
}

Hope that helped!

Timorem and Friends are Hungryâ„¢
07-30-2012 01:50 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,229
Joined: Jul 2011
Reputation: 215
Post: #3
RE: Changing map if you die.
Or you can just set a check point and use the checkpoint callback to call ChangeMap.

Tutorials: From Noob to Pro
07-30-2012 02:21 PM
Visit this user's website Find all posts by this user Quote this message in a reply
onv Offline
Member

Posts: 51
Joined: Feb 2012
Reputation: 2
Post: #4
RE: Changing map if you die.
kk , Thanks for your help , i did Your Computer's method :>
07-30-2012 06:55 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)