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
Script Help Adding Delays
RaideX Offline
Member

Posts: 212
Threads: 33
Joined: May 2013
Reputation: 7
#5
RE: Adding Delays

(11-22-2013, 08:00 PM)sonataarctica Wrote:
(11-22-2013, 07:58 PM)RaideX Wrote:
Quote:
PHP Code: (Select All)
void OnStart() {

AddTimer ("ExecFunctionXY_1"10.0f"FunctionXY")
AddTimer ("ExecFunctionXY_2"11.0f"FunctionXY")
}


void FunctionXY (string &in asTimer) {
if(
asTimer=="ExecFunctionXY_1") {
thingXY()
}
if(
asTimer=="ExecFunctionXY_2") {
delayedthingZ()
}


Something like this maybe? It really depends on how many functions you want to use with delays. This is probably the simplest for just a function followed by a delay followed by a function.

Yeh that should work just fine. Awesome! Thank you for that.

How would i do it with collide areas?

Thanks for taking you'r time mate.

PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""CollideArea""CollideFunction"true1);    
}

void CollideFunction(string &in asParentstring &in asChildint alState)
{
AddTimer ("ExecFunctionXY_1"10.0f"FunctionXY")
AddTimer ("ExecFunctionXY_2"11.0f"FunctionXY")


Something like this?

yeh, that isn't what i excectly searched for but i can make this to do it my way. thanks anyway, you'r great.

EDIT: Just for the curious, i wanted to set it up so when the player enters the area, a certain music stops playing and after the delay timer ended it should excecute a sound at the player (like a scare sound).

If you don't draw first, you don't get to draw at all... -The False Shepherd
(This post was last modified: 11-22-2013, 08:11 PM by RaideX.)
11-22-2013, 08:07 PM
Find


Messages In This Thread
Adding Delays - by RaideX - 11-22-2013, 07:12 PM
RE: Adding Delays - by ExpectedIdentifier - 11-22-2013, 07:50 PM
RE: Adding Delays - by RaideX - 11-22-2013, 07:58 PM
RE: Adding Delays - by ExpectedIdentifier - 11-22-2013, 08:00 PM
RE: Adding Delays - by RaideX - 11-22-2013, 08:07 PM
RE: Adding Delays - by ExpectedIdentifier - 11-22-2013, 08:09 PM
RE: Adding Delays - by RaideX - 11-22-2013, 08:14 PM
RE: Adding Delays - by FlawlessHappiness - 11-23-2013, 01:37 AM
RE: Adding Delays - by RaideX - 11-23-2013, 11:06 AM
RE: Adding Delays - by FlawlessHappiness - 11-23-2013, 12:01 PM
RE: Adding Delays - by RaideX - 11-23-2013, 12:53 PM
RE: Adding Delays - by FlawlessHappiness - 11-24-2013, 07:29 PM



Users browsing this thread: 1 Guest(s)