View Single Post
Old
chip
Member
 
chip's Avatar
 
Status: Offline
Posts: 24
Join Date: May 2011
Location: New Hampshire
Default 05-26-2011, 05:29 PM

Quote:
Originally Posted by arty-fishL View Post
Im not sure why there would be any lag if you are using a thread. Never have a while outside a thread, that's all I can think of. You could try inserting pauses with time.sleep in the thread, but I dont think that's what you are looking for.

For the extra Java class can you not just translate it all into Jython. Its not really that big a challenge and there isn't really a noticeable compile difference.
Yeah, I was surprised that using a thread didn't reduce or eliminate the lag. But it's definitely tied to the while loop in the thread's run() code, because modifying that changes the effect of the lag. I know it is actually threaded because errors in the thread are not trapped by the main thread -- they're not fatal, it seems, so I just use try:/except: to stop the thread when they occur and then it restarts again when the character moves.

The only other while loop I have is event-driven, so if I understand Alice events properly, that, too is threaded.

The main reason I'd like to do straight Java class-building is because so many of the main "tiled" features are kind of clumsy to access from script, if you can do it at all. For example I don't seem to be able to call any of the user-designed tiled methods from script, and have direct access only to variables, which can be used to trigger the tiled methods, but that's a kludge imo. There is also a great deal that the tiled methods cannot do, or do in an odd fashion that I'd like to modify. I'll probably use a combination of scripting and custom compiled classes, as well as taking advantage of some of the more convenient features of the tiled stuff.

Last edited by chip; 05-26-2011 at 05:31 PM.
   
Reply With Quote