Home |
Add a script
|
||
|---|---|---|---|
| Category: | Contributor: | Description | |
| Prim Face Numbers | Ferd Frederix | Put a number on all faces of a prim | |
This script is used to put a number of the prims face on each prim. Then you can use the prim number in scripts to texture any single face.
The Script
Download this script - Please use this link to get this script. If you see all the code on one long line, please use Wordpad or another editor, such as LSLEdit.exe. The .LSL file you will download is an ordinary text file.

This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License unless stated otherwise in the script below), by Fred Beckhusen, aka Ferd Frederix.
NC - No Commerce clause means that the sale of the script is NOT allowed. This means you cannot sell my scripts but you can give them away if they are FREE. This script may be included in a prim or other object and the object itself sold. Putting my script in a prim and selling it on marketplace or anywhere else is not allowed (except for free).
BY - You must leave author credits intact in any script you use or republish.
--ooo------///-----|(------ooo------///-----|(------ooo----
2 { 3 float cell_width = 0.25; // in this example the width 4 float cell_height = 0.25; // and height are the same 5 6 llSetTexture("9e59ddf7-d7c3-5248-0894-00ce2154ee8e", face ); 7 llScaleTexture( cell_width, cell_height, face ); 8 if ( value == 0 ) 9 llOffsetTexture( -1.5 * cell_width, 1.5 * cell_height, face ); 10 else if ( value == 1 ) 11 llOffsetTexture( -0.5 * cell_width, 1.5 * cell_height, face ); 12 else if ( value == 2 ) 13 llOffsetTexture( 0.5 * cell_width, 1.5 * cell_height, face ); 14 else if ( value == 3 ) 15 llOffsetTexture( 1.5 * cell_width, 1.5 * cell_height, face ); 16 else if ( value == 4 ) 17 llOffsetTexture( -1.5 * cell_width, 0.5 * cell_height, face ); 18 else if ( value == 5 ) 19 llOffsetTexture( -0.5 * cell_width, 0.5 * cell_height, face ); 20 else if ( value == 6 ) 21 llOffsetTexture( 0.5 * cell_width, 0.5 * cell_height, face ); 22 else if ( value == 7 ) 23 llOffsetTexture( 1.5 * cell_width, 0.5 * cell_height, face ); 24 else if ( value == 8 ) 25 llOffsetTexture( -1.5 * cell_width, -0.5 * cell_height, face ); 26 else if ( value == 9 ) 27 llOffsetTexture( -0.5 * cell_width, -0.5 * cell_height, face ); 28 else if ( value == 10 ) 29 llOffsetTexture( 0.5 * cell_width, -0.5 * cell_height, face ); 30 else if ( value == 11 ) 31 llOffsetTexture( 1.5 * cell_width, -0.5 * cell_height, face ); 32 else if ( value == 12 ) 33 llOffsetTexture( -1.5 * cell_width, -1.5 * cell_height, face ); 34 else if ( value == 13 ) 35 llOffsetTexture( -0.5 * cell_width, -1.5 * cell_height, face ); 36 else if ( value == 14 ) 37 llOffsetTexture( 0.5 * cell_width, -1.5 * cell_height, face ); 38 else if ( value == 15 ) 39 llOffsetTexture( 1.5 * cell_width, -1.5 * cell_height, face ); 40 } 41 42 default 43 { 44 state_entry() 45 { 46 integer i; 47 48 for ( i = 0; i < llGetNumberOfSides(); i++ ) 49 display( i, i ); 50 } 51 53 { 54 if ( (changed_flag == CHANGED_SHAPE) || 55 (changed_flag == CHANGED_SCALE) ) 56 llResetScript(); 57 } 58 }