llSetPrimitiveParams([ PRIM_SIZE, <1, 1, 1>, PRIM_COLOR, ALL_SIDES, <1, 0, 0>,1.0 ]); //sets the size of the prim to 1x1x1, and then the color of the prim to red
llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, <0, 0, 0>, 1.0, PRIM_COLOR, 0, <0, 1, 0>, 1.0]);
llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, <0, 0, 0>, 1.0,PRIM_PHANTOM, TRUE]);
Constant Name | Description Alternative | Parameter(s) | Example Rule | Value |
PRIM_BUMP_SHINY | Sets bumpmapping and shininess of a face | integer face, PRIM_SHINY_xxx, PRIM_BUMP_xxx | [PRIM_BUMP_SHINY, 2, PRIM_SHINY_LOW, PRIM_BUMP_GRAVEL] | 19 |
PRIM_COLOR | Sets color and alpha of a face llSetColor, llSetAlpha | integer face, vector color, float alpha | [PRIM_COLOR, 1, <1, 0, 0>, 0.75] | 18 |
PRIM_FLEXIBLE | Toggles flexible property and attributes: softness, gravity, drag (friction), wind, tension, and force. | boolean TRUE/FALSE, integer softness, float gravity, float friction, float wind, float tension, vector force | [PRIM_FLEXIBLE, TRUE, 2, 0.3, 2.0, 0.0, 1.0, <0, 0, 0>] | 21 |
PRIM_FULLBRIGHT | Sets full bright of a face on or off. | integer face, boolean on on = TRUE/FALSE | [PRIM_FULLBRIGHT, ALL_SIDES, TRUE] | 20 |
PRIM_GLOW | Sets WindLight prim glow intensity of a face. (To be fully functional in 1.19.2, see WindLight: Make glow scriptable. Note also that the glow is not rendered for HUDs ) | integer face, float intensity | [PRIM_GLOW, ALL_SIDES, 1.0] | 25 |
PRIM_MATERIAL | Sets material of the prim | PRIM_MATERIAL_xxx | [PRIM_MATERIAL, PRIM_MATERIAL_RUBBER] | 2 |
PRIM_PHANTOM | Sets phantom property of an object llSetStatus | TRUE/FALSE | [PRIM_PHANTOM, TRUE] | 5 |
PRIM_PHYSICS | Sets physics property of an object llSetStatus | TRUE/FALSE | [PRIM_PHYSICS, TRUE] | 3 |
PRIM_POINT_LIGHT | Toggles light property and attributes: color, intensity, radius, and falloff. | TRUE/FALSE, vector color, float intensity, float radius, float falloff | [PRIM_POINT_LIGHT, TRUE, <1, 1, 1>, 1.0, 10.0, 0.75] | 23 |
PRIM_POSITION | Moves object to position. This will silently fail for a child prim of a link set if the child prim exceeds the link distance! Also, as with llSetPos, will not move an object below ground; its center will be set at ground height. llSetPos | vector position | [PRIM_POSITION, <128, 128, 40>] | 6 |
PRIM_ROTATION | Sets the rotation of the object llSetRot | rotation rot | [PRIM_ROTATION, <0, 0, 0, 1>] | 8 |
PRIM_SIZE | Sets the scale of an object (Between <0.01,0.01,0.01> and <64,64,64>) llSetScale | vector size | [PRIM_SIZE, <4, 3, 0.1>] | 7 |
PRIM_TEMP_ON_REZ | Sets temporary on rez property of an object | TRUE/FALSE | [PRIM_TEMP_ON_REZ, TRUE] | 4 |
PRIM_TYPE | Sets the basic prim type; will unsit all avatars on object. | See next table | 9 | |
PRIM_TEXGEN | Sets the texture mapping mode, either PRIM_TEXGEN_DEFAULT or PRIM_TEXGEN_PLANAR. | integer face, integer type | [PRIM_TEXGEN, ALL_SIDES, PRIM_TEXGEN_DEFAULT] | 22 |
PRIM_TEXTURE | Sets the texture properties of a face llSetTexture, llScaleTexture, llOffsetTexture, llRotateTexture | integer face, string name, vector repeats, vector offsets, float rotation Note: name can be the name of a texture in the prim's contents or the key of a texture, but must be of type string. Seems you can use a raw key now without typecasting to string (08/08) - ED | [PRIM_TEXTURE, 0, "66864f3c-e095-d9c8-058d-d6575e6ed1b8", <1,1,1>, <0,0,0>, 0] | 17 |
PRIM_TEXT | Sets the text property of a prim llSetText | string text, vector color, float alpha Note: To remove text from a prim, leave text empty | [PRIM_TEXT, "Hello world", <1.0, 1.0, 1.0>, 1.0] | 26 |
Constant Name | Value | Type | Parameter(s) | Example rule |
PRIM_TYPE_BOX | 0 | Box | integer holeshape, vector cut, float hollow, vector twist, vector taper_b, vector topshear | [PRIM_TYPE, PRIM_TYPE_BOX, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>] |
PRIM_TYPE_CYLINDER | 1 | Cylinder | integer holeshape, vector cut, float hollow, vector twist, vector taper_b, vector topshear | [PRIM_TYPE, PRIM_TYPE_CYLINDER, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>] |
PRIM_TYPE_PRISM | 2 | Prism | integer holeshape, vector cut, float hollow, vector twist, vector taper_b, vector topshear | [PRIM_TYPE, PRIM_TYPE_PRISM, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <0.0, 0.0, 0.0>, <0.0, 0.0, 0.0>] |
PRIM_TYPE_SPHERE | 3 | Sphere | integer holeshape, vector cut, float hollow, vector twist, vector dimple | [PRIM_TYPE, PRIM_TYPE_SPHERE, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>] |
PRIM_TYPE_TORUS | 4 | Torus | integer holeshape, vector cut, float hollow, vector twist, vector holesize, vector topshear, vector profilecut, vector taper_a, float revolutions, float radiusoffset, float skew | [PRIM_TYPE, PRIM_TYPE_TORUS, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.25, 0.0>, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 1.0, 0.0, 0.0] |
PRIM_TYPE_TUBE | 5 | Tube | integer holeshape, vector cut, float hollow, vector twist, vector holesize, vector topshear, vector profilecut, vector taper_a, float revolutions, float radiusoffset, float skew | [PRIM_TYPE, PRIM_TYPE_TUBE, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.25, 0.0>, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 1.0, 0.0, 0.0] |
PRIM_TYPE_RING | 6 | Ring | integer holeshape, vector cut, float hollow, vector twist, vector holesize, vector topshear, vector profilecut, vector taper_a, float revolutions, float radiusoffset, float skew | [PRIM_TYPE, PRIM_TYPE_RING, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 0.25, 0.0>, <0.0, 0.0, 0.0>, <0.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 1.0, 0.0, 0.0] |
PRIM_TYPE_SCULPT | 7 | Sculpted | string map, integer type | [PRIM_TYPE, PRIM_TYPE_SCULPT, "c110440b-c276-88fb-9f3b-abf123f7ea2b", PRIM_SCULPT_TYPE_SPHERE] |
Parameter | Note |
repeats | x and y range from 0.0 to 100 (z is ignored) |
offsets | x and y range from -1 to 1 (z is ignored) |
cut/dimple/profilecut | x and y range from 0.0 to 1.0, x must be at least 0.05 smaller than y (z is ignored) |
hollow | ranges from 0.0 (solid) to 0.95 (maximum hollowed) |
twist | boxes, cylinders, prisms ranges from -0.5 (-180 degree in the edit window) to 0.5 (+180 degree in the edit window) for both x and y (z is ignored) spheres, tubes, torii, rings ranges from -1.0 (-360 degree in the edit window) to 1.0 (+360 degree in the edit window) for both x and y (z is ignored) |
holesize taper_b | x ranges from 0.05 to 1.0 y ranges from 0.05 (large hole) to 0.50 (no hole) ranges from 0.0 to 2.0 for both x and y (z is ignored) |
topshear | ranges from -0.5 to 0.5 for both x and y (z is ignored) |
taper_a | ranges from -1.0 to 1.0 for both x and y (z is ignored) |
revolutions | ranges from 1.0 to 4.00 |
radiusoffset | depends on holesize y and revolutions |
skew |
Constant | Value | Shape |
PRIM_HOLE_DEFAULT | 0 | default (matches the prim type: square for box, circle for cylinder, etc.) |
PRIM_HOLE_SQUARE | 32 | square |
PRIM_HOLE_CIRCLE | 16 | circle |
PRIM_HOLE_TRIANGLE | 48 | triangle |
Constant | Value | Shape |
PRIM_SCULPT_TYPE_SPHERE | 1 | sphere (Converge top & bottom, stitch left side to right) |
PRIM_SCULPT_TYPE_TORUS | 2 | torus (Stitch top to bottom, stitch left side to right) |
PRIM_SCULPT_TYPE_PLANE | 3 | plane (No stitching or converging) |
PRIM_SCULPT_TYPE_CYLINDER | 4 | cylinder (Stitch left side to right, leave top and bottom open) |
Constant | Value | Description |
PRIM_BUMP_NONE | 0 | none: no bump map |
PRIM_BUMP_BRIGHT | 1 | brightness: generate bump map from highlights |
PRIM_BUMP_DARK | 2 | darkness: generate bump map from lowlights |
PRIM_BUMP_WOOD | 3 | woodgrain |
PRIM_BUMP_BARK | 4 | bark |
PRIM_BUMP_BRICKS | 5 | bricks |
PRIM_BUMP_CHECKER | 6 | checker |
PRIM_BUMP_CONCRETE | 7 | concrete |
PRIM_BUMP_TILE | 8 | crustytile |
PRIM_BUMP_STONE | 9 | cutstone: blocks |
PRIM_BUMP_DISKS | 10 | discs: packed circles |
PRIM_BUMP_GRAVEL | 11 | gravel |
PRIM_BUMP_BLOBS | 12 | petridish: blobby amoebalike shapes |
PRIM_BUMP_SIDING | 13 | siding |
PRIM_BUMP_LARGETILE | 14 | stonetile |
PRIM_BUMP_STUCCO | 15 | stucco |
PRIM_BUMP_SUCTION | 16 | suction: rings |
PRIM_BUMP_WEAVE | 17 | weave |
Constant | Value | Description |
PRIM_SHINY_NONE | 0 | none |
PRIM_SHINY_LOW | 1 | low |
PRIM_SHINY_MEDIUM | 2 | medium |
PRIM_SHINY_HIGH | 3 | high |
Constant | Value | Description |
PRIM_MATERIAL_STONE | 0 | stone |
PRIM_MATERIAL_METAL | 1 | metal |
PRIM_MATERIAL_GLASS | 2 | glass |
PRIM_MATERIAL_WOOD | 3 | wood |
PRIM_MATERIAL_FLESH | 4 | flesh |
PRIM_MATERIAL_PLASTIC | 5 | plastic |
PRIM_MATERIAL_RUBBER | 6 | rubber |
PRIM_MATERIAL_LIGHT | 7 | light (deprecated in SL 1.9.1) |
/////////////////////////////////////////////////////////////////////////////// // // ccFixListDatatypes // Walks a list and casts the data to the appropriate type, then returns // the cast list. Useful for things like llSetPrimitiveParams when data is // parsed from strings. // // v3 - Initial public release // v4 - Fixes parsing of negative elements in vectors and rotations. // /////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2008, Ceawlin Creations // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of Ceawlin Creations, Liandra Ceawlin, or A. J. // Taylor, nor the names of its contributors may be used to endorse or promote // products derived from this software without specific prior written // permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////////// // This code is far from optimal, lol. list ccFixListDatatypes( list l ) { //Liandra Ceawlin 2008-09-20 integer i; for( i=0; i<llGetListLength(l); i++ ) { integer is_integer = TRUE; integer is_float = TRUE; integer is_vector = TRUE; integer is_rot = TRUE; integer j; string s = llStringTrim(llList2String(l,i),STRING_TRIM); if( s == "" ) jump cont1; for( j=0; j<llStringLength(s); j++ ) { string c = llGetSubString(s,j,j); if( (integer)c==0 && c!="0" ) { is_integer = FALSE; if( c != "." ) is_float = FALSE; } } if( llGetSubString(s,0,0)=="<" && llGetSubString(s,llStringLength(s)-1,llStringLength(s)-1)==">" ) { string tmp = llDeleteSubString(s,0,0); tmp = llDeleteSubString(tmp,llStringLength(tmp)-1,llStringLength(tmp)-1); list tl = llParseString2List(tmp,[","],[]); if( llGetListLength(tl) == 3 ) is_rot = FALSE; else if( llGetListLength(tl) == 4 ) is_vector = FALSE; else { is_rot = FALSE; is_vector = FALSE; jump cont2; } for( j=0; j<llGetListLength(tl); j++ ) { integer k; string ts = llStringTrim(llList2String(tl,j),STRING_TRIM); for( k=0; k<llStringLength(ts); k++ ) { string tc = llGetSubString(ts,k,k); if( (integer)tc==0 && tc!="0" && tc!="." && tc!="-" ) { is_rot=FALSE; is_vector = FALSE; jump cont3; } } } } else { is_vector = FALSE; is_rot = FALSE; } list n; if( is_integer ) n += (integer)s; else if( is_float ) n += (float)s; else if( is_vector ) n += (vector)s; else if( is_rot ) n += (rotation)s; else jump cont4; l = llListReplaceList(l,n,i,i); @cont1; @cont2; @cont3; @cont4; } return l; } default { on_rez( integer param ) { llSay( 0, "Open your script error/warning window and touch me to run the test." ); } touch_start(integer det) { llSay( DEBUG_CHANNEL, "Testing..." ); list shape= llGetPrimitiveParams([PRIM_TYPE]); // cast shape to all strings, like we just parsed it out of some chat or something.... integer i; for( i=0; i<llGetListLength(shape); i++ ) shape = llListReplaceList( shape, [llList2String(shape,i)], i, i ); llSay( DEBUG_CHANNEL, "This will cause an error." ); llSetPrimitiveParams( shape ); // Cast the string list into the proper datatypes. list new = ccFixListDatatypes( shape ); llSay( DEBUG_CHANNEL, "But this shouldn't..." ); llSetPrimitiveParams( [PRIM_TYPE]+new ); llSay( DEBUG_CHANNEL, "Done." ); } }