The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
#1
Adding Delays

So, hi again people. First of all (as some might have noticed) i got to the scripting section for my coming full conversion. And sadly that's where i'm weakest at.

But i am aware of the basics and can do stuff that i have planned, but for one thing i can't get working without adding too much code.

I think i'll explain it with an example:

I want to execute functionXY with a timer that starts when the player enters a specific area. After the player entered the area, functionXY is going to be excecuted and does thingXY. Now i want that after thingXY happens something else should happen with a delayXY, let's say 1 second.

What i would do is the following:

PHP Code: (Select All)
void OnStart() {

AddTimer ("ExecFunctionXY"10.0f"FunctionXY")
}


void FunctionXY (string &in asTimer) {
thingXY()
AddTimer ("FunctionZDelay"1.0f"FunctionZDelay")
}

void FunctionZDelay (string &in asTimer) {
delayedthingZ()


So basically i'm adding a timer after a certain function has been called to execute something delayed.

Is there a way to code that a bit more "pretty"?
I'm guessing it has to do with parameters, but sadly i'm really not good at this part. Hope you guys can help and hopefully i can learn something new. :3

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, 07:14 PM by RaideX.)
11-22-2013, 07:12 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: 3 Guest(s)