This could very well be a bug, but I'm going to post this here because it could be an error in my implementation.
In my work-in-progress game, I have text that scrolls up 16 pixels (half a tile) at a time. I am using screen objects to show the text on the player's window. Then to scroll, I have a for loop to go through every screen object that is attached to that player's client. This for loop checks to see if its text (I use a separate layer to make this easier) and if it is, then it takes the current location and changed the y coordinate in the screen_loc variable so that it reappears 16 pixels (half a tile) above its old location.
The idea I have works...in fact it works 70% of the time flawlessly. The other 30% of the time, DreamSeeker doesn't redraw the object in the correct location...so one letter (an object per letter) will be in its original location whereas everything else is correct. If I scroll again, then the misplaced object(s) will move to where it is suppose to be that time around (appearing correctly) while others may "forget" to move that time around.
Any suggestions on how to fix this and/or go about another way of making this work?
ID:175047
Jun 18 2003, 9:34 am (Edited on Jun 18 2003, 9:40 am)
|
|
Jun 18 2003, 9:44 am
|
|
You might want to add some debugging text to make sure each screen object is being hit in the loop, sometimes it will skip them for an unknown reason (this might be a bug), if they are, you should add a double check to make sure they moved correctly, maybe some proc attached to the object that checks its location, and if the given location is not correct force it to move.
|
In response to Nadrew
|
|
I might try this tonight when I'm sitting in front of the code again...but I assume that it is changing them all being that on the next scroll, the text that was misplaced is once again in the correct location (which would then be one tile above where it was when it was mislocated)
|
In response to Nadrew
|
|
The data is being updated properly. This problem seems to be releated to lag. Here are my test cases thus far:
Case 1
Case 2
Case 3
|
In response to CableMonkey
|
|
Here is a screenshot from Case 1:
http://richland.k12.la.us/~dhogan/messedup.png On the above screen, I am being prompted to select YES or NO. At that time, the cursor is at YES. I pushed the down button to move the cursor to NO. This involved deleting the arror and creating a new one beside NO. Nothing else was done to the screen objects; however, the screen now look like it does in the following image: http://richland.k12.la.us/~dhogan/noprob.png |
I have ripped the code out of the game and made a demo of it. The code can be downloaded here as source code or as a binary. Below is the code that moves the text:
for (var/obj/window/i in usr.client.screen) ...and the xcoord and ycoord functions... proc |
In response to CableMonkey
|
|
I replaced the entire system and am using /image instead. Works flawlessly now.
|