![]() |
Loop Limits
HTML Code:
function onCreated()Can it be changed so that a loop counter of "for (object: objectlist)" loop has less impact on the limit? Or it only starts counting if the list is modified inside the loop? I'm trying to do something similar to the code above (related to checking for NPCs nearby, etc) but it dies out due to the loop limit. |
It's a little bit complicated, it checks how often a code is executed, not in what kind of loop it is contained. I would say it would be better to optimize the code, but if you can show me a realistic example where the loop limit need to be changed then we can probably add something (loop limit per npc ?)
|
Quote:
|
Why exactly are you checking what npcs are already there?
|
Quote:
|
Optimizing your script means doing less operations to achieve the same goal :)
|
Quote:
|
x-x less operations = less operations
|
Quote:
|
>_>
Fighting with Stefan is never good. What if you add to a level variable when an NPC is created, then subtract from it when it gets destroyed? Less operations. :O |
Quote:
|
Stefan's telling you to optimize it, so the loop limit isn't a problem. :O
DUH! |
Quote:
|
| All times are GMT +2. The time now is 11:01 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.