Constants are pre-defined values that do not change–they’re constant: TRUE will always equal 1. However, this does not mean that values should be used instead; while there’s no technical reason not to, constants exist to simplify your code and make it easier to understand. It’s good coding practice to use them. This page is for general constants; function-specific ones should be documented on the functions page. You can find an almost complete list of constants & values on LexFile.
float
PI |
3.1415926535897932384626433832795 (pi) |
TWO_PI |
6.283185307179586476925286766559 (pi * 2) |
PI_BY_TWO |
1.5707963267948966192313216916398 (pi / 2) |
DEG_TO_RAD |
To convert from degrees to radians (multiply, example: radian = 90 * DEG_TO_RAD;) |
RAD_TO_DEG |
To convert to radians from degrees (multiply, example: degree = PI_BY_TWO * RAD_TO_DEG;) |
SQRT2 |
1.4142135623730950488016887242097 (square root of 2) |
integer
TRUE |
1, an integer constant for boolean operations. |
FALSE |
0, an integer constant for boolean operations. |
DEBUG_CHANNEL |
2147483647, a special chat channel used to print to the Script Error Window. |
PUBLIC_CHANNEL |
0, chat channel that broadcasts to all nearby users. |
OBJECT_UNKNOWN_DETAIL |
-1, an integer returned when an invalid object parameter type is passed to llGetObjectDetails. |
INVENTORY_NONE |
-1, an integer returned by llGetInventoryType when no item is found. |
string
NULL_KEY Indicates an empty key: “00000000-0000-0000-0000-000000000000”. This constant is typed as a string not as a key. EOF, “\n\n\n”, Indicates the last line (or a line past this) of a notecard was read (returned in the dataserver event), or that the notecard contained embedded objects.
Substring |
Replaced With |
\t |
four spaces |
\n |
new line |
\” |
double quote |
\\ |
backslash |
rotation
ZERO_ROTATION <0.0, 0.0, 0.0, 1.0> (Note that ZERO_ROTATION is not <0.0, 0.0, 0.0, 0.0>! This is important.)
vector
ZERO_VECTOR <0.0, 0.0, 0.0>
Credit: LSL Wiki
OSSL Additional constants to the LSL functions/events
changed() event
Name |
Value |
Description |
CHANGED_ANIMATION |
16384 |
the set of animations playing on the avatar to whom this object is attached has been changed. |
llRequestSimulatorData() and dataserver() event
Name |
Value |
Description |
DATA_SIM_RELEASE |
128 |
returns the version of the simulator the script is running in; the string parameter of llRequestSimulatorData is ignored. |
llDetectedType() and llSensor()
Name |
Value |
Description |
OS_NPC |
0x01000000 |
Target is NPC. Use this instead of NPC (Justincc’s blog) |
llSetVehicleVectorParam()
Name |
Value |
Description |
VEHICLE_RANGE_BLOCK |
45 |
|
llSetVehicleRotationParam()
Name |
Value |
Description |
VEHICLE_ROLL_FRAME |
46 |
|
llSetVehicleFlags() and llRemoveVehicleFlags()
Name |
Value |
Description |
VEHICLE_FLAG_NO_X |
1024 |
|
VEHICLE_FLAG_NO_Y |
2048 |
|
VEHICLE_FLAG_NO_Z |
4096 |
|
VEHICLE_FLAG_LOCK_HOVER_HEIGHT |
8192 |
|
VEHICLE_FLAG_NO_DEFLECTION |
16392 |
|
VEHICLE_FLAG_LOCK_ROTATION |
32784 |
|
llListStatistics()
Name |
Value |
Description |
LIST_STAT_HARMONIC_MEAN |
100 |
returns the harmonic mean of a list of numbers. |
llSetCameraParams()
Name |
Value |
Description |
CAMERA_FOCUS_OFFSET_X |
2 |
adjusts the camera focus x position relative to the target. (float) |
CAMERA_FOCUS_OFFSET_Y |
3 |
adjusts the camera focus y position relative to the target. (float) |
CAMERA_FOCUS_OFFSET_Z |
4 |
adjusts the camera focus z position relative to the target. (float) |
CAMERA_POSITION_X |
14 |
sets camera x position in region coordinates. (float) |
CAMERA_POSITION_Y |
15 |
sets camera y position in region coordinates. (float) |
CAMERA_POSITION_Z |
16 |
sets camera z position in region coordinates. (float) |
CAMERA_FOCUS_X |
18 |
sets camera x focus (target position) in region coordinates. (float) |
CAMERA_FOCUS_Y |
19 |
sets camera y focus (target position) in region coordinates. (float) |
CAMERA_FOCUS_Z |
20 |
sets camera z focus (target position) in region coordinates. (float) |
llSetPrimMediaParams()
Name |
Value |
LSL_STATUS_OK |
0 |
LSL_STATUS_MALFORMED_PARAMS |
1000 |
LSL_STATUS_TYPE_MISMATCH |
1001 |
LSL_STATUS_BOUNDS_ERROR |
1002 |
LSL_STATUS_NOT_FOUND |
1003 |
LSL_STATUS_NOT_SUPPORTED |
1004 |
LSL_STATUS_INTERNAL_ERROR |
1999 |
LSL_STATUS_WHITELIST_FAILED |
2001 |
For the OSSL functions
osGetRegionStats()
Name |
Value |
Statistics Bar Label |
STATS_TIME_DILATION |
0 |
Time Dilation |
STATS_SIM_FPS |
1 |
Sim FPS |
STATS_PHYSICS_FPS |
2 |
Physics FPS |
STATS_AGENT_UPDATES |
3 |
Agent Updates/Sec |
STATS_ROOT_AGENTS |
4 |
Main Agents |
STATS_CHILD_AGENTS |
5 |
Child Agents |
STATS_TOTAL_PRIMS |
6 |
Objects |
STATS_ACTIVE_PRIMS |
7 |
Active Objects |
STATS_FRAME_MS |
8 |
Total Frame Time |
STATS_NET_MS |
9 |
Net Time |
STATS_PHYSICS_MS |
10 |
Physics Time |
STATS_IMAGE_MS |
11 |
Images Time |
STATS_OTHER_MS |
12 |
(Other Time) |
STATS_IN_PACKETS_PER_SECOND |
13 |
Packets In |
STATS_OUT_PACKETS_PER_SECOND |
14 |
Packets Out |
STATS_UNACKED_BYTES |
15 |
Total Unacked Bytes |
STATS_AGENT_MS |
16 |
Agent Time |
STATS_PENDING_DOWNLOADS |
17 |
Pending Downloads |
STATS_PENDING_UPLOADS |
18 |
Pending Uploads |
STATS_ACTIVE_SCRIPTS |
19 |
Active Scripts |
STATS_SCRIPT_LPS |
20 |
(Script Line Per Second) |
osNpcMoveToTarget()
See function page for descriptions of each constants.
Name |
Value |
OS_NPC_FLY |
0 |
OS_NPC_NO_FLY |
1 |
OS_NPC_LAND_AT_TARGET |
2 |
OS_NPC_RUNNING |
4 |
osNpcSit()
See function page for descriptions of each constants.
Name |
Value |
OS_NPC_SIT_NOW |
0 |
osNpcCreate()
See function page for descriptions of each constants.
Name |
Value |
OS_NPC_CREATOR_OWNED |
0x1 |
OS_NPC_NOT_OWNED |
0x2 |
OS_NPC_SENSE_AS_AGENT |
0x4 |
osSetParcelDetails()
Name |
Value |
Description |
PARCEL_DETAILS_CLAIMDATE |
10 |
set parcel claim date |
osListenRegex()
Name |
Value |
Description |
OS_LISTEN_REGEX_NAME |
0x1 |
process name parameter as regex |
OS_LISTEN_REGEX_MESSAGE |
0x2 |
process message parameter as regex |
osMessageAttachments()
See function page for descriptions of each constants.
Name |
Value |
Description |
OS_ATTACH_MSG_ALL |
-65535 |
send the message to attachments on every point |
OS_ATTACH_MSG_INVERT_POINTS |
1 |
invert how the attachment points list should be treated |
OS_ATTACH_MSG_OBJECT_CREATOR |
2 |
send only to those have the same CreatorID with host object CreatorID |
OS_ATTACH_MSG_SCRIPT_CREATOR |
4 |
send only to those have the same CreatorID with sender script CreatorID |
lsGetWindlightScene() & lsSetWindlightScene() & lsSetWindlightSceneTargeted()
see LightShare Parameters for each description
Name |
Value |
WL_WATER_COLOR |
0 |
WL_WATER_FOG_DENSITY_EXPONENT |
1 |
WL_UNDERWATER_FOG_MODIFIER |
2 |
WL_REFLECTION_WAVELET_SCALE |
3 |
WL_FRESNEL_SCALE |
4 |
WL_FRESNEL_OFFSET |
5 |
WL_REFRACT_SCALE_ABOVE |
6 |
WL_REFRACT_SCALE_BELOW |
7 |
WL_BLUR_MULTIPLIER |
8 |
WL_BIG_WAVE_DIRECTION |
9 |
WL_LITTLE_WAVE_DIRECTION |
10 |
WL_NORMAL_MAP_TEXTURE |
11 |
WL_HORIZON |
12 |
WL_HAZE_HORIZON |
13 |
WL_BLUE_DENSITY |
14 |
WL_HAZE_DENSITY |
15 |
WL_DENSITY_MULTIPLIER |
16 |
WL_DISTANCE_MULTIPLIER |
17 |
WL_MAX_ALTITUDE |
18 |
WL_SUN_MOON_COLOR |
19 |
WL_AMBIENT |
20 |
WL_EAST_ANGLE |
21 |
WL_SUN_GLOW_FOCUS |
22 |
WL_SUN_GLOW_SIZE |
23 |
WL_SCENE_GAMMA |
24 |
WL_STAR_BRIGHTNESS |
25 |
WL_CLOUD_COLOR |
26 |
WL_CLOUD_XY_DENSITY |
27 |
WL_CLOUD_COVERAGE |
28 |
WL_CLOUD_SCALE |
29 |
WL_CLOUD_DETAIL_XY_DENSITY |
30 |
WL_CLOUD_SCROLL_X |
31 |
WL_CLOUD_SCROLL_Y |
32 |
WL_CLOUD_SCROLL_Y_LOCK |
33 |
WL_CLOUD_SCROLL_X_LOCK |
34 |
WL_DRAW_CLASSIC_CLOUDS |
35 |
WL_SUN_MOON_POSITION |
36 |
Credit to: Lslwiki.net (not working), and Opensimulator.org references for this material, with changes made for brevity and clarity.