Sunbleached Posted October 12, 2017 Share Posted October 12, 2017 (edited) Hello! How to make the texture be animated by script from here: llSetTextureAnim only on one face of the mesh with several materials - faces? Please, help! This wonderful script used; integer textureIsBeingAnimated; default { touch_start(integer num_detected) { if (textureIsBeingAnimated) llSetTextureAnim(ANIM_ON | SMOOTH | SCALE | PING_PONG | LOOP, ALL_SIDES, 0, -10, 1.0, .3, 5); else llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0); // toggle back and forth between TRUE (1) and FALSE (0) textureIsBeingAnimated = !textureIsBeingAnimated; } } Edited October 12, 2017 by Sunbleached 1 Link to comment Share on other sites More sharing options...
Rolig Loon Posted October 12, 2017 Share Posted October 12, 2017 (edited) Your first, quite reliable source of information about LSL functions is the LSL wiki, in which you will find So... specify the face number instead of ALL_SIDES. Edited October 12, 2017 by Rolig Loon 1 Link to comment Share on other sites More sharing options...
Sunbleached Posted October 13, 2017 Author Share Posted October 13, 2017 (edited) 10 hours ago, Rolig Loon said: Your first, quite reliable source of information about LSL functions is the LSL wiki, in which you will find So... specify the face number instead of ALL_SIDES. Yes, thanks! But how? More specifically please? I'm a noob at scripting.In the beginning it is necessary to specify a line: "integer face;". And then what to do? Just replace ALL_SIDES with face number? Edited October 13, 2017 by Sunbleached 1 Link to comment Share on other sites More sharing options...
Sunbleached Posted October 13, 2017 Author Share Posted October 13, 2017 (edited) @Rolig Loon Ok, I got it working! I just put '4' (my face number) instead of ALL_SIDES. One more question. What if you need to animate on two sides only? Specify them in the same way either through a comma or in parentheses? Is there a difference? Edited October 13, 2017 by Sunbleached 1 Link to comment Share on other sites More sharing options...
KT Kingsley Posted October 13, 2017 Share Posted October 13, 2017 I believe you can only animate either one or all the faces of a prim, and you can only run one animation on a prim. To get the effect you're asking about I'd use two identical prims, one set up with the animation on ALL_SIDES and with the unwanted faces transparent, and make the faces on the other prim that correspond to the desired faces of the first prim transparent. 1 Link to comment Share on other sites More sharing options...
Rolig Loon Posted October 13, 2017 Share Posted October 13, 2017 4 hours ago, Sunbleached said: What if you need to animate on two sides only? Again, read the information in the LSL wiki: "You can only have one texture animation on a prim Calling llSetTextureAnim more than once on a prim will reset the existing animation." You cannot animate just TWO faces.. It's ONE face or ALL_SIDES. 1 Link to comment Share on other sites More sharing options...
Sunbleached Posted October 13, 2017 Author Share Posted October 13, 2017 (edited) 7 hours ago, Rolig Loon said: Again, read the information in the LSL wiki: "You can only have one texture animation on a prim Calling llSetTextureAnim more than once on a prim will reset the existing animation." You cannot animate just TWO faces.. It's ONE face or ALL_SIDES. Thanks a lot! Edited October 13, 2017 by Sunbleached 1 Link to comment Share on other sites More sharing options...
tabletopfreak Toocool Posted April 19, 2018 Share Posted April 19, 2018 On 10/12/2017 at 6:28 PM, Rolig Loon said: Your first, quite reliable source of information about LSL functions is the LSL wiki, in which you will find So... specify the face number instead of ALL_SIDES. care to be more specific?? iv tried face_2 , face 2,face2,2,two Link to comment Share on other sites More sharing options...
Rolig Loon Posted April 19, 2018 Share Posted April 19, 2018 If you are trying to animate face 2, specify 2. In LSL, whenever you are asked to provide a face number, the syntax is expecting an integer. Hence, the wording in the function description: llSetTextureAnim( integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate ); Link to comment Share on other sites More sharing options...
tabletopfreak Toocool Posted April 19, 2018 Share Posted April 19, 2018 20 minutes ago, Rolig Loon said: If you are trying to animate face 2, specify 2. In LSL, whenever you are asked to provide a face number, the syntax is expecting an integer. Hence, the wording in the function description: llSetTextureAnim( integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate ); llSetTextureAnim(ANIM_ON | SMOOTH | LOOP | PING_PONG | ROTATE,2, 0, 0.01, .01, 0.01 ,0.005); nore llSetTextureAnim(ANIM_ON | SMOOTH | LOOP | PING_PONG | ROTATE, 2, 0, 0.01, .01, 0.01 ,0.005); seem to be ding itfor me i get an error .. function call mismatches type or number or arguments Link to comment Share on other sites More sharing options...
Rolig Loon Posted April 19, 2018 Share Posted April 19, 2018 (edited) The problem isn't the face number. llSetTextureAnim(ANIM_ON | SMOOTH | LOOP | PING_PONG | ROTATE,2, 0, 0.01, .01, 0.01 ,0.005); The syntax is expecting you to use an integer value for sizey. EDIT: As a secondary but important issue, notice that it make no sense to let either sizex or sizey equal zero. Edited April 19, 2018 by Rolig Loon Link to comment Share on other sites More sharing options...
tabletopfreak Toocool Posted April 19, 2018 Share Posted April 19, 2018 Just now, Rolig Loon said: The problem isn't the face number. llSetTextureAnim(ANIM_ON | SMOOTH | LOOP | PING_PONG | ROTATE,2, 0, 0.01, .01, 0.01 ,0.005); The syntax is expecting you to use an integer value for sizey. so what do it do?? i should mention im using a script that works fine for all faces and only changed the all_faces bit Link to comment Share on other sites More sharing options...
tabletopfreak Toocool Posted April 19, 2018 Share Posted April 19, 2018 i dont know what integer sizey means Link to comment Share on other sites More sharing options...
Rolig Loon Posted April 19, 2018 Share Posted April 19, 2018 1 minute ago, tabletopfreak Toocool said: i dont know what integer sizey means Again, read the specification: • integer sizex – horizontal frames (ignored for ROTATE and SCALE) • integer sizey – vertical frames (ignored for ROTATE and SCALE) Link to comment Share on other sites More sharing options...
Fionalein Posted April 19, 2018 Share Posted April 19, 2018 it is rather selfexplaining named for y size I think 1 Link to comment Share on other sites More sharing options...
tabletopfreak Toocool Posted April 19, 2018 Share Posted April 19, 2018 ohh size y not "sizey" i had no idea what "sizey" means i was reading like an odd spelling.. not really self explaining .. now if they used size y THEN THAT would be much more clear to the general public .. i see float rate isnt floatrate so why size y and x are sizey and sizex .. i dont know.. ok i still dont understand the issue tho.. what does sizey need to be a whole number? Link to comment Share on other sites More sharing options...
tabletopfreak Toocool Posted April 19, 2018 Share Posted April 19, 2018 ok ROTATE,2, 0, 1,1,1,0.005); got it working.. so id use size x and size y for like.. the texture scale setting? as in some trees might be 3 x 16 on the leaves faces 1 Link to comment Share on other sites More sharing options...
Rolig Loon Posted April 19, 2018 Share Posted April 19, 2018 1 minute ago, tabletopfreak Toocool said: what does sizey need to be a whole number? For three reasons: 1. Sizex and sizey (both defined in the specifications) count the number of frames in the texture that you want to use for the animation. If your texture has six frames, for example, you need to tell the function whether they are arranged with three frames on the top row and three on the bottom (sizex = 3 and sizey = 2) or two frames on each of three rows (sizex = 2 and sizey = 3). You obviously cannot ever have zero frames in either direction unless you are trying to tell the script that you've decided not to animate after all. 2. You can't have half of a frame in either direction, or 0.1 of a frame, or 3.1415729 of a frame. On;ly integers make any sense. 3. More simply, you need an integer because that's what the specification tells you to provide, an integer, not a float. 1 Link to comment Share on other sites More sharing options...
tabletopfreak Toocool Posted April 19, 2018 Share Posted April 19, 2018 sorry if i seemed frustrated.. just felt like we were dancing around the answer.. you know were on a dying platform.. and like if you want the ship to sync slower we have to do what we can to help people who want to be here.. not saying you guys weren't helpful but ,like fionaleins comment was for what?? it only servers to down someone who is trying to keep this ship afloat 1 1 Link to comment Share on other sites More sharing options...
tabletopfreak Toocool Posted April 19, 2018 Share Posted April 19, 2018 2 minutes ago, Rolig Loon said: For three reasons: 1. Sizex and sizey (both defined in the specifications) count the number of frames in the texture that you want to use for the animation. If your texture has six frames, for example, you need to tell the function whether they are arranged with three frames on the top row and three on the bottom (sizex = 3 and sizey = 2) or two frames on each of three rows (sizex = 2 and sizey = 3). You obviously cannot ever have zero frames in either direction unless you are trying to tell the script that you've decided not to animate after all. 2. You can't have half of a frame in either direction, or 0.1 of a frame, or 3.1415729 of a frame. On;ly integers make any sense. 3. More simply, you need an integer because that's what the specification tells you to provide, an integer, not a float. ohh thats for like cell images when the animation is like 3 rows and 3 columns our whatever the case may be? Link to comment Share on other sites More sharing options...
Rolig Loon Posted April 19, 2018 Share Posted April 19, 2018 Just now, tabletopfreak Toocool said: ohh thats for like cell images when the animation is like 3 rows and 3 columns our whatever the case may be? That's exactly what this function is designed for. Using it to animate a texture with only one frame in each direction only makes sense in the trivial case when you are intending to rotate the texture or just offset it gently across the face. It's usually used to simulate something like an animated GIF. Link to comment Share on other sites More sharing options...
Rolig Loon Posted April 19, 2018 Share Posted April 19, 2018 20 minutes ago, tabletopfreak Toocool said: ohh size y not "sizey" i had no idea what "sizey" means i was reading like an odd spelling.. not really self explaining .. now if they used size y THEN THAT would be much more clear to the general public .. i see float rate isnt floatrate so why size y and x are sizey and sizex .. i dont know.. Just going back to clear up a misconception .... Take a look at the specification. Each of the parameters that the function expects is defined by telling you what type of variable to use. So when the specification says llSetTextureAnim( integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate ); it is telling you to provide an integer for the mode, an integer for the face number, an integer for the number of frames in the X direction, an integer for the number of frames in the Y direction, a float for the frame to start with, a float for the number of frames in the anim, and a float for the rate. As written, each is given a placeholder variable name, which is used in the specification table below it. Variable names in LSL cannot have blank spaces in them, so they can't use a name like "size x" or "size y". They might have named them "size_x" or "Xsize" or "SX", but "sizex" and "sizey" work just as well. When you use the function yourself, you may use whatever names you wish -- as long as they don't have spaces in them. 1 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now