diff options
Diffstat (limited to '1AOor2.lsl')
-rw-r--r-- | 1AOor2.lsl | 48 |
1 files changed, 34 insertions, 14 deletions
@@ -11,7 +11,7 @@ string ScriptName; | |||
11 | key ScriptKey; | 11 | key ScriptKey; |
12 | key LibraryKey; | 12 | key LibraryKey; |
13 | key Owner; | 13 | key Owner; |
14 | string URL; | 14 | //string URL; |
15 | 15 | ||
16 | // Settings. | 16 | // Settings. |
17 | list Aliases; | 17 | list Aliases; |
@@ -319,6 +319,7 @@ integer doThing(key id, string button, string fr, string cmd, string data, integ | |||
319 | { | 319 | { |
320 | set = listFindString(Settings, fr + cmd, sSTRIDE); | 320 | set = listFindString(Settings, fr + cmd, sSTRIDE); |
321 | if (-1 != set) setSetting(id, fr + cmd, data, fINT); else S("Unknown setting '" + cmd); | 321 | if (-1 != set) setSetting(id, fr + cmd, data, fINT); else S("Unknown setting '" + cmd); |
322 | source = fINT; | ||
322 | } | 323 | } |
323 | if ((fr != (ScriptName + ".") && ("*." != fr))) return TRUE; | 324 | if ((fr != (ScriptName + ".") && ("*." != fr))) return TRUE; |
324 | integer av = findAvatar(id); | 325 | integer av = findAvatar(id); |
@@ -408,6 +409,7 @@ integer doThing(key id, string button, string fr, string cmd, string data, integ | |||
408 | --distance; | 409 | --distance; |
409 | if (0 > distance) distance = 0; | 410 | if (0 > distance) distance = 0; |
410 | Avs = llListReplaceList(Avs, [distance], av + aDIST, av + aDIST); | 411 | Avs = llListReplaceList(Avs, [distance], av + aDIST, av + aDIST); |
412 | // This is done so we can do a bit more than the usual menu showing stuff. | ||
411 | showMenu(id); | 413 | showMenu(id); |
412 | return FALSE; | 414 | return FALSE; |
413 | } | 415 | } |
@@ -724,7 +726,7 @@ d("SIT_DONE for " + llKey2Name(data)); | |||
724 | integer y = (integer)(cr.y / 256); | 726 | integer y = (integer)(cr.y / 256); |
725 | cr.x = cr.x % 256; | 727 | cr.x = cr.x % 256; |
726 | cr.y = cr.y % 256; | 728 | cr.y = cr.y % 256; |
727 | osTeleportAgent(Stalkee, x, y, cr, <1.0,1.0,1.0>); | 729 | osTeleportAgent(Stalkee, x, y, cr, ZERO_VECTOR); |
728 | } | 730 | } |
729 | } | 731 | } |
730 | else if ("RLV" == cmd) | 732 | else if ("RLV" == cmd) |
@@ -735,7 +737,11 @@ d("RLV command requested " + llList2String(dt, 0)); | |||
735 | if (2 < llGetListLength(dt)) | 737 | if (2 < llGetListLength(dt)) |
736 | addEvent(llList2Float(dt, 1), "RLV " + llDumpList2String(llList2List(dt, 2, -1), "|")); | 738 | addEvent(llList2Float(dt, 1), "RLV " + llDumpList2String(llList2List(dt, 2, -1), "|")); |
737 | } | 739 | } |
738 | else if ("URL" == cmd) | 740 | // else if ("URL" == cmd) |
741 | // { | ||
742 | // URL = data; | ||
743 | //d("New URL " + URL); | ||
744 | // } | ||
739 | else if ("BUILTINS" == cmd) | 745 | else if ("BUILTINS" == cmd) |
740 | { | 746 | { |
741 | integer l = llGetListLength(ANIMATIONS); | 747 | integer l = llGetListLength(ANIMATIONS); |
@@ -876,7 +882,7 @@ integer psNAME = 0; // Name of pose. | |||
876 | integer psANIM = 1; // | separated animations. | 882 | integer psANIM = 1; // | separated animations. |
877 | integer psEMOTE = 2; // | separated emotions and timers list. | 883 | integer psEMOTE = 2; // | separated emotions and timers list. |
878 | integer psPOSROT= 3; // | separated position and rotation pairs. | 884 | integer psPOSROT= 3; // | separated position and rotation pairs. |
879 | integer psSTRIDE= 4; | 885 | integer psSTRIDE= 4; |
880 | string Posed; // Single pose, overrides AO. | 886 | string Posed; // Single pose, overrides AO. |
881 | string Pose; // Couples pose name. | 887 | string Pose; // Couples pose name. |
882 | string State; // AO state name. | 888 | string State; // AO state name. |
@@ -1129,6 +1135,12 @@ savePose(string name, string anim, string exp, string posRot) | |||
1129 | exp = llList2String(Poses, f + psEMOTE); | 1135 | exp = llList2String(Poses, f + psEMOTE); |
1130 | } | 1136 | } |
1131 | else if ("" == posRot) posRot = llList2String(Poses, f + psPOSROT); | 1137 | else if ("" == posRot) posRot = llList2String(Poses, f + psPOSROT); |
1138 | } | ||
1139 | else | ||
1140 | { | ||
1141 | if ("" == posRot) | ||
1142 | posRot = "<0.0,0.0,0.0><0.0,0.0,0.0><0.3,0.0,0.0><0.0,0.0,0.0>"; | ||
1143 | } | ||
1132 | if (NULL_KEY == exp) exp = ""; | 1144 | if (NULL_KEY == exp) exp = ""; |
1133 | if (NULL_KEY == posRot) posRot = ""; | 1145 | if (NULL_KEY == posRot) posRot = ""; |
1134 | if (-1 != f) | 1146 | if (-1 != f) |
@@ -1150,9 +1162,13 @@ list reportPose() | |||
1150 | integer m = llGetListLength(prs); | 1162 | integer m = llGetListLength(prs); |
1151 | integer j; | 1163 | integer j; |
1152 | 1164 | ||
1153 | for (j = 0; j < m; j++) | 1165 | if (m) |
1154 | r += llList2String(prs, j); | 1166 | { |
1155 | result += [r]; | 1167 | for (j = 0; j < m; j++) |
1168 | r += llList2String(prs, j); | ||
1169 | result += [r]; | ||
1170 | } | ||
1171 | //s(r); | ||
1156 | } | 1172 | } |
1157 | return result; | 1173 | return result; |
1158 | } | 1174 | } |
@@ -1164,7 +1180,12 @@ lookAtMe(key id) | |||
1164 | d("setting camera for " + llKey2Name(id)); | 1180 | d("setting camera for " + llKey2Name(id)); |
1165 | llClearCameraParams(); | 1181 | llClearCameraParams(); |
1166 | llSetCameraParams( | 1182 | llSetCameraParams( |
1167 | [ CAMERA_ACTIVE, 1, CAMERA_FOCUS_OFFSET, <0.0, 0.0, 1.0>, CAMERA_PITCH, 12.5, | 1183 | // [ CAMERA_ACTIVE, TRUE, CAMERA_FOCUS_OFFSET, <0.0, 0.0, 0.0>, CAMERA_PITCH, 12.5, |
1184 | // CAMERA_BEHINDNESS_ANGLE, 10.0, CAMERA_BEHINDNESS_LAG, 0.0, CAMERA_DISTANCE, 3.0, | ||
1185 | // CAMERA_FOCUS_LAG, 0.1 , CAMERA_FOCUS_THRESHOLD, 1.0, | ||
1186 | // CAMERA_POSITION_LAG, 0.1, CAMERA_POSITION_THRESHOLD, 1.0 | ||
1187 | // ]); | ||
1188 | [ CAMERA_ACTIVE, TRUE, CAMERA_FOCUS_OFFSET, <0.0, 0.0, 1.0>, CAMERA_PITCH, 12.5, | ||
1168 | CAMERA_BEHINDNESS_ANGLE, 0.1, CAMERA_BEHINDNESS_LAG, 0.0, CAMERA_DISTANCE, 2.75, | 1189 | CAMERA_BEHINDNESS_ANGLE, 0.1, CAMERA_BEHINDNESS_LAG, 0.0, CAMERA_DISTANCE, 2.75, |
1169 | CAMERA_FOCUS_LAG, 0.0 , CAMERA_FOCUS_THRESHOLD, 0.0, | 1190 | CAMERA_FOCUS_LAG, 0.0 , CAMERA_FOCUS_THRESHOLD, 0.0, |
1170 | CAMERA_POSITION_LAG, 0.0, CAMERA_POSITION_THRESHOLD, 0.0 | 1191 | CAMERA_POSITION_LAG, 0.0, CAMERA_POSITION_THRESHOLD, 0.0 |
@@ -1194,6 +1215,7 @@ doControl(key id, integer level, integer edge) | |||
1194 | if (NULL_KEY != TheirKey) | 1215 | if (NULL_KEY != TheirKey) |
1195 | { | 1216 | { |
1196 | sendPrim(TheirKey, "CONTROLS", [id, level, edge]); | 1217 | sendPrim(TheirKey, "CONTROLS", [id, level, edge]); |
1218 | // TODO - check this. | ||
1197 | if ("Sitting" != llGetAnimation(id)) | 1219 | if ("Sitting" != llGetAnimation(id)) |
1198 | oldController(id); | 1220 | oldController(id); |
1199 | return; | 1221 | return; |
@@ -1222,7 +1244,7 @@ doControl(key id, integer level, integer edge) | |||
1222 | s(id, "Switched out of adjusting mode."); | 1244 | s(id, "Switched out of adjusting mode."); |
1223 | addEvent(Tick * Smooth, "Keys"); | 1245 | addEvent(Tick * Smooth, "Keys"); |
1224 | } | 1246 | } |
1225 | else | 1247 | else |
1226 | showMenu(id); | 1248 | showMenu(id); |
1227 | } | 1249 | } |
1228 | HeldKeys = held; | 1250 | HeldKeys = held; |
@@ -1384,14 +1406,14 @@ updateAvatar(key id) | |||
1384 | localrot = llList2Rot(local, 1); | 1406 | localrot = llList2Rot(local, 1); |
1385 | } | 1407 | } |
1386 | pos += <0.0, 0.0, 0.2>; // Fudge it. Pffft | 1408 | pos += <0.0, 0.0, 0.2>; // Fudge it. Pffft |
1387 | // <0.008906, -0.049831, 0.088967> are the coefficients for a parabolic curve that | 1409 | // <0.008906, -0.049831, 0.088967> are the coefficients for a parabolic curve that |
1388 | // best fits real avatars. It is not a perfect fit. | 1410 | // best fits real avatars. It is not a perfect fit. |
1389 | float fAdjust = ((((0.008906 * size.z) + -0.049831) * size.z) + 0.088967) * size.z; | 1411 | float fAdjust = ((((0.008906 * size.z) + -0.049831) * size.z) + 0.088967) * size.z; |
1390 | vector fa = llRot2Up(rot) * fAdjust; | 1412 | vector fa = llRot2Up(rot) * fAdjust; |
1391 | llSetLinkPrimitiveParamsFast(lnk, | 1413 | llSetLinkPrimitiveParamsFast(lnk, |
1392 | [ | 1414 | [ |
1393 | PRIM_POS_LOCAL, ((pos - fa) * localrot) + localpos, | 1415 | PRIM_POS_LOCAL, ((pos - fa) * localrot) + localpos, |
1394 | PRIM_ROT_LOCAL, rot * localrot // This does rotate around the avatar's centre, not the prims centre. | 1416 | PRIM_ROT_LOCAL, rot * localrot // This rotates around the avatar's centre, not the prims centre. |
1395 | ]); | 1417 | ]); |
1396 | } | 1418 | } |
1397 | } | 1419 | } |
@@ -1638,7 +1660,7 @@ updateVehicle(integer keys, integer mode, float move, float rotate) | |||
1638 | if (!f & PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS) d("No group create objects."); | 1660 | if (!f & PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS) d("No group create objects."); |
1639 | if (!f & PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY) d("No group object entry."); | 1661 | if (!f & PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY) d("No group object entry."); |
1640 | if ((f & PARCEL_FLAG_ALLOW_SCRIPTS) && (f & PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY)) | 1662 | if ((f & PARCEL_FLAG_ALLOW_SCRIPTS) && (f & PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY)) |
1641 | llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POSITION, pos, PRIM_ROTATION, | 1663 | llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POSITION, pos, PRIM_ROTATION, |
1642 | llEuler2Rot(<0.0, 0.0, rotate>) * llGetRot()]); | 1664 | llEuler2Rot(<0.0, 0.0, rotate>) * llGetRot()]); |
1643 | } | 1665 | } |
1644 | } | 1666 | } |
@@ -1927,8 +1949,6 @@ checkAO() | |||
1927 | integer fast = 0; integer i; integer f; float dpth; | 1949 | integer fast = 0; integer i; integer f; float dpth; |
1928 | if (NULL_KEY != TheirKey) return; | 1950 | if (NULL_KEY != TheirKey) return; |
1929 | 1951 | ||
1930 | // doAnim = (integer) getSetting("osAnim"); | ||
1931 | // doSpeed = (integer) getSetting("osSpeed"); | ||
1932 | if (Attached) | 1952 | if (Attached) |
1933 | { | 1953 | { |
1934 | // if (llGetAgentInfo(Owner) & AGENT_ALWAYS_RUN) fast = 1; else fast = 0; | 1954 | // if (llGetAgentInfo(Owner) & AGENT_ALWAYS_RUN) fast = 1; else fast = 0; |