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
Changing map if you die.
onv Offline
Member

Posts: 51
Threads: 12
Joined: Feb 2012
Reputation: 2
#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
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#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!

I rate it 3 memes.
07-30-2012, 01:50 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#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
Website Find
onv Offline
Member

Posts: 51
Threads: 12
Joined: Feb 2012
Reputation: 2
#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




Users browsing this thread: 1 Guest(s)