DiSaMe Posted July 9, 2010 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? -
50p Posted July 9, 2010 Posted July 9, 2010 No, you can't extend the loop maximum execution time. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
dzek (varez) Posted July 9, 2010 Posted July 9, 2010 post your code.. i think your script isn't made properly and this problem can be fixed. Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
DiSaMe Posted July 10, 2010 Author 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. -
Lordy Posted July 10, 2010 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
DiSaMe Posted July 10, 2010 Author 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. -
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