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 to make things happen only in a certain area
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: How to make things happen only in a certain area

To me, the idea is to have an area that starts a repeating timer, and stops a repeating timer.

void CollideCallback(string &in asParent, string &in asChild, int alState)
{
if(alState == 1) //If going inside area.
{
if(GetTimerTimeLeft("Breath") > 0)
else
{
AddTimer("Breath", 1.0f, "BreathTimer");
}
SetLocalVarInt("BreathTimerVar", 1);
}

if(alState == -1) //If going outside of area
{
SetLocalVarInt("BreathTimerVar", 0);
}
}

void BreathTimer(string &in asTimer)
{
if(GetLocalVarInt("BreathTimerVar") == 1)
{
//PlaySound
AddTimer("Breath", 1.0f, "BreathTimer");
}
}

Trying is the first step to success.
06-15-2015, 11:40 AM
Find


Messages In This Thread
RE: How to make things happen only in a certain area - by FlawlessHappiness - 06-15-2015, 11:40 AM



Users browsing this thread: 1 Guest(s)