DiSaMe Posted July 9, 2010 Share Posted July 9, 2010 A script in my gamemode uses a loop which isn't infinite, but execution takes too long, so it's aborted before it's finished. Is it possible to increase maximum loop length? Link to comment
50p Posted July 9, 2010 Share Posted July 9, 2010 No, you can't extend the loop maximum execution time. Link to comment
dzek (varez) Posted July 9, 2010 Share Posted July 9, 2010 post your code.. i think your script isn't made properly and this problem can be fixed. Link to comment
DiSaMe Posted July 10, 2010 Author Share Posted July 10, 2010 It's not about script made improperly. It's about lots of data having to be processed. It's done when resource starts, so it wouldn't cause problems such as freezing during the game. Anyway, that's just a temporary way to see how things work, and I'm going to make a better script without long loops. Link to comment
Lordy Posted July 10, 2010 Share Posted July 10, 2010 Well how much data is lots of data? And if it's really optimised code, you should maybe break the loops up I'm not sure if this would work, but worth a try imo local n = 1 local steps = 20 for n,n+steps do --whatever you do n = n + steps end for n,n+steps do n = n+steps end etc. so it would effectively do the whole loop but would be several loops so it wouldn't time out Link to comment
DiSaMe Posted July 10, 2010 Author Share Posted July 10, 2010 That would be the same, because code would be executed on the same frame. Timers are necessary to do things like that, but it would need more scripting. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now