Im pretty sure this would not be a problem if the trigger only runs occasionally. If it has to run really often though (like once a second) it could cause performance issue.
you could add a 0.1 or 0.5 wait action or something in between each loop cycle to delay it a bit if you test it and find out it does actually cause lag, but it should probably be ok.
In one part of my triggers im using loops within loops, and im just a little bit worried that to many will cause a huge lag spike in the game.
Having about 100 items when im done, looping all those and replacing up to 5 substrings with a loop of 100 items,
do you guys think it will be a big deal if i do it once?
-Like this: For each int in ibutton from 0 to (100) if then (are there any elements to replace?)
While icompare < (100)
for each (up to 5 elements). Replace substrings
icompare +1
I personally think it will but it will have to be tested in game for truth.
Im pretty sure this would not be a problem if the trigger only runs occasionally. If it has to run really often though (like once a second) it could cause performance issue.
you could add a 0.1 or 0.5 wait action or something in between each loop cycle to delay it a bit if you test it and find out it does actually cause lag, but it should probably be ok.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
Depending on what you are doing there may be better algorithms to use which have lower, non linear complexity.