Log in

View Full Version : Script bug or not?



Xurr
03-21-2008, 22:44
So today I took a look at the giant script that comes with EB. I noticed in section 10 at the end a bunch of do while loops that would effectively stop the script at the "while" loop. This would and probably is the cause of most of the "lag" that players see. I'm wondering if there is any real reason to use a loop like this?



console_command date 10
console_command season summer
set_counter seasonCounter 3
while I_TurnNumber = 1130
suspend_unscripted_advice true
end_while

I guess my question really is, is there a reason to turn off unscripted advice 1000 times per second other than stopping the script?

I think if you replaced each block with a simple if test you increase performance quite a bit

Something like this.


If I_TurnNumber = 1130
console_command date 11
console_command season summer
set_counter seasonCounter 2
suspend_unscripted_advice true
end_If


Hope this helps.

LorDBulA
03-21-2008, 23:36
I'm wondering if there is any real reason to use a loop like this?


There must be one while loop that lasts till the end of EB timeframe.
Without it script will run to the end and exit.

Of course you can try different implementations of 4tpy script but you will still end up with while loop that is running all the time.

I dont remember if we used this script from the beginning but I remember that there was no significant ( relative to current EB slowness ) slowdowns.
It just grew over the time as we where adding more and more scripts.

Atilius
03-22-2008, 07:34
I think if you replaced each block with a simple if test you increase performance quite a bit

Something like this.


If I_TurnNumber = 1130
console_command date 11
console_command season summer
set_counter seasonCounter 2
suspend_unscripted_advice true
end_If


Yeah, you're right. It'll have a huge impact on performance because the script will terminate almost instantly.

Xurr
03-24-2008, 18:27
Yeah, you're right. It'll have a huge impact on performance because the script will terminate almost instantly.

Will it? Or will one of the 20 odd other endless while loops keep it going?