Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Problems displaying a single frame with llSetTextureAnim

shockedfrog Shriner
Registered User
Join date: 21 Oct 2005
Posts: 7
05-01-2006 08:51
For a game I'm making, I'm using llSetTextureAnim to display individual 32x32 tile graphics taken from a 1024x256 texture. The game is 101 prims - 1 which takes care of the main game logic, the other 100 displaying the tiles.

llSetTextureAnim(ANIM_ON, ALL_SIDES, 32, 8, (turn*32)+(max*(max+1)/2)-(max-val), 1, 1);

This generally works fine, but when rezzing the game, some of the prims show the full texture instead. Also, if I sit on the game, the last of the linked prims resets to show the full texture. Quitting and logging back in seems to make everything appear right, but I'd imagine players would rather not have to keep logging out every time there's a glitch, so to get around this, I tried changing it to ANIM_ON | LOOP, which helps sort out the resetting (there are still problems with it displaying the full texture in the above cases, but the proper texture comes back a moment later), but this causes a new problem: sometimes the next 32x32 frame quickly flickers before going back to the correct frame. I'm pretty sure this could be fixed by changing the math a little and uploading a 2048x256 texture which contains 2 of each frame, so that when it displays the next frame, it's the same as the previous one anyway - but I'm wondering if anyone knows a better way that doesn't require increasing the texture size. Using individual textures for each image just isn't an option due to the 0.2 second delay and the price of uploading them all for any different skin.

A search brought up one similar topic: /111/44/8015/1.html - from 2003, which isn't exactly a good sign.

Also, will using 1 side instead of using ALL_SIDES affect the clientside performance? I haven't noticed any major difference, but I haven't tested it on a slower computer.
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
05-01-2006 10:34
Have you tried to use llSetTextureOffset() instead? llSetTextureAnim() is made to show animations and such, and doesn't work that well for showing a single part like llSetTextureOffset().

http://secondlife.com/badgeo/wakka.php?wakka=llGetTextureOffset
_____________________
shockedfrog Shriner
Registered User
Join date: 21 Oct 2005
Posts: 7
05-01-2006 11:28
Unfortunately llOffsetTexture() has the 0.2 second delay which I think would cause problems. I haven't actually tested it though, so I'll give it a go.