Jump to content
Leopard20

Executing scripts in scheduled environment outside the execution queue - Possible?

Recommended Posts

Hello everyone.

Let's say I'm running a mission that currently has over 1000 running scripts (diag_activeScripts#0 > 1000):

for"_i" from 0 to 1000 do {
  [] spawn {
    while {true} do {
       for "_i" from 0 to 50000 do {true}
    }
  }
}


Each iteration of every script requires about 20 ms to complete, which is well above the scheduler's execution time limit (3 ms). This practically means that if my game is running @60 FPS (16.6 ms per frame) and I have a script at the 1001st position in the queue, it will be executed at least over ~17 seconds later! And this is just the first iteration of my script. There will be a ~17s delay between each iteration.

This is only a stress test of course, but still I'd rather my scripts were executed ASAP. I don't mean like 'call', because my scripts are way too demanding for calling. They have to be executed in the scheduled environment.

I can think of a dirty method (using a perFrame eventHandler, and executing the code bit by bit), but I was hoping for a more straightforward solution.

Does anyone know a way?

Share this post


Link to post
Share on other sites
10 minutes ago, Dedmen said:

No.

Then I guess I'll have to create my own scheduler! 😄

Share this post


Link to post
Share on other sites

revise your script / component / system design

use as much EHs as possible. use a scripted event system like in CBA

Share this post


Link to post
Share on other sites
53 minutes ago, .kju said:

revise your script / component / system design

use as much EHs as possible. use a scripted event system like in CBA

Not possible. I want this for my path generation algorithm (way better than the vanilla pathCalculated), which is used by my new AI.

Anyway, I think I came up with a solution. Let's see if it works.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×