Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: Speeding scripts up  (Read 16393 times)

0 Members and 1 Guest are viewing this topic.

PheliCan

  • Guest
Re:Speeding scripts up
« Reply #60 on: 18 Dec 2005, 15:45:30 »
- the 0.01 wait will not work within a block of code delineated by {}

That pretty much sais it all. The point of the pause was to give room for other tasks. Ohh, well...

Offline hardrock

  • Members
  • *
  • Title? What's that?
    • Operation FlightSim
Re: Speeding scripts up
« Reply #61 on: 26 May 2006, 11:02:31 »
The difference is that code blocks à foreach or while are executed within a single frame, just as are functions. All those blocks theoretically represent a line of a script, and OFP always parses one line at once.

So OFP takes the same time for executing
Code: [Select]
myVar = 1as for
Code: [Select]
myVar = 1; mySecondVar = 2; myThirdVar = 3or for
Code: [Select]
{myArray = myArray + [_x]} forEach [1,2,3,4,5]
Of course, the longer a line, the more lag will appear ingame on the long run. But if used wisely and sparely, you can get pretty good results.