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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reset Triggers Upon Death?
Author Message
W10607059 Offline
Junior Member

Posts: 11
Joined: Feb 2012
Reputation: 0
Post: #11
RE: Reset Triggers Upon Death?

(04-08-2012 08:50 PM)JetlinerX Wrote:  RemoveTimer("YOUR TIMER'S INTERNAL NAME");

Example:
AddTimer("looper", 0.1f, "restart_walk");

To remove:
RemoveTimer("looper");
How do I remove it on the condition that the player dies?
04-08-2012 10:50 PM
Find all posts by this user Quote this message in a reply
Mackiiboy Offline
Member

Posts: 101
Joined: Jan 2012
Reputation: 11
Post: #12
RE: Reset Triggers Upon Death?

(04-08-2012 10:50 PM)W10607059 Wrote:  How do I remove it on the condition that the player dies?
.
Ya'll just put in a RemoveTimer as JetlinerX said, into the DeadFunc.
I'll copy the old stuff I wrote so it will be easier for you to see what I mean.

void OnStart()
{
AddEntityCollideCallback("Player", "YOUR_AREA", "YOUR_FUNC", false, 1);
}

void YOUR_FUNC(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("YOUR_AREA", false);
CheckPoint("name_of_your_checkpoint", "Spawn_Area", "DeathFunc1", "DeathHint", "DescriptionOne");
}

void DeathFunc1(string &in asName, int alCount)
{
SetEntityActive("YOUR_AREA", true);
RemoveTimer("YOUR TIMER'S INTERNAL NAME"); <----------If the player dies, the timer will be removed.
}
04-09-2012 12:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
W10607059 Offline
Junior Member

Posts: 11
Joined: Feb 2012
Reputation: 0
Post: #13
RE: Reset Triggers Upon Death?

(04-09-2012 12:08 AM)Mackiiboy Wrote:  
(04-08-2012 10:50 PM)W10607059 Wrote:  How do I remove it on the condition that the player dies?
.
Ya'll just put in a RemoveTimer as JetlinerX said, into the DeadFunc.
I'll copy the old stuff I wrote so it will be easier for you to see what I mean.

void OnStart()
{
AddEntityCollideCallback("Player", "YOUR_AREA", "YOUR_FUNC", false, 1);
}

void YOUR_FUNC(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("YOUR_AREA", false);
CheckPoint("name_of_your_checkpoint", "Spawn_Area", "DeathFunc1", "DeathHint", "DescriptionOne");
}

void DeathFunc1(string &in asName, int alCount)
{
SetEntityActive("YOUR_AREA", true);
RemoveTimer("YOUR TIMER'S INTERNAL NAME"); <----------If the player dies, the timer will be removed.
}


haha you guys are so smart and im so stupid. Thanks for the help!
04-09-2012 06:12 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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