diff options
Diffstat (limited to '1AOor2.lsl')
-rw-r--r-- | 1AOor2.lsl | 62 |
1 files changed, 15 insertions, 47 deletions
@@ -477,7 +477,7 @@ integer doThing(key id, string button, string fr, string cmd, string data, integ | |||
477 | llKey2Name(Owner) + " would like to do '" + What + "' with you.", | 477 | llKey2Name(Owner) + " would like to do '" + What + "' with you.", |
478 | "Yes|No", "COUPLE_YES " + Stalkee + "|COUPLE_NO " + Stalkee); | 478 | "Yes|No", "COUPLE_YES " + Stalkee + "|COUPLE_NO " + Stalkee); |
479 | sendScript(lCMD, "1ring", [fINT, id, Stalkee, "GOTO", Stalkee]); | 479 | sendScript(lCMD, "1ring", [fINT, id, Stalkee, "GOTO", Stalkee]); |
480 | addEvent(120.0, "COUPLE_TIMEOUT"); | 480 | addEvent(300.0, "COUPLE_TIMEOUT"); |
481 | } | 481 | } |
482 | return FALSE; | 482 | return FALSE; |
483 | } | 483 | } |
@@ -625,6 +625,11 @@ d("SIT_DONE for " + llKey2Name(data)); | |||
625 | osMakeNotecard(".POSITIONS", data); | 625 | osMakeNotecard(".POSITIONS", data); |
626 | S("Current positions saved to the .POSITIONS notecard."); | 626 | S("Current positions saved to the .POSITIONS notecard."); |
627 | } | 627 | } |
628 | else if ("SWAP" == cmd) | ||
629 | { | ||
630 | Swapped = !Swapped; | ||
631 | checkSitters(TRUE); | ||
632 | } | ||
628 | else if ("TPRIM" == cmd) | 633 | else if ("TPRIM" == cmd) |
629 | { | 634 | { |
630 | if (Attached) | 635 | if (Attached) |
@@ -751,6 +756,7 @@ integer PIN; | |||
751 | key Leader = NULL_KEY; | 756 | key Leader = NULL_KEY; |
752 | float LeaderOffset = 0.0; | 757 | float LeaderOffset = 0.0; |
753 | key Controller = NULL_KEY; | 758 | key Controller = NULL_KEY; |
759 | integer Swapped = FALSE; | ||
754 | 760 | ||
755 | // AO | 761 | // AO |
756 | integer Lag = 100; | 762 | integer Lag = 100; |
@@ -884,7 +890,7 @@ integer findPose(string name) {return listFindString(Poses, name, psSTRIDE);} | |||
884 | savePose(string name, string anim, string exp, string posRot) | 890 | savePose(string name, string anim, string exp, string posRot) |
885 | { | 891 | { |
886 | integer f = findPose(name); | 892 | integer f = findPose(name); |
887 | posRot = normPose(posRot); | 893 | |
888 | if (-1 != f) | 894 | if (-1 != f) |
889 | { | 895 | { |
890 | if ("" == anim) | 896 | if ("" == anim) |
@@ -894,32 +900,10 @@ savePose(string name, string anim, string exp, string posRot) | |||
894 | } | 900 | } |
895 | else if ("" == posRot) posRot = llList2String(Poses, f + psPOSROT); | 901 | else if ("" == posRot) posRot = llList2String(Poses, f + psPOSROT); |
896 | Poses = llListReplaceList(Poses, [name, anim, exp, posRot], f, f + psSTRIDE - 1); | 902 | Poses = llListReplaceList(Poses, [name, anim, exp, posRot], f, f + psSTRIDE - 1); |
897 | } | ||
898 | else | 903 | else |
899 | Poses += [name, anim, exp, posRot]; | 904 | Poses += [name, anim, exp, posRot]; |
900 | } | 905 | } |
901 | 906 | ||
902 | string normPose(string posRot) | ||
903 | { | ||
904 | // Subtract the x,y of the first from both to normalise it around the prim. | ||
905 | // NOTE - only handles the first two. | ||
906 | list p = llParseStringKeepNulls(posRot, ["|"], []); | ||
907 | string pr0 = llList2String(p, 0); | ||
908 | integer jx0 = llSubStringIndex(pr0, "><"); | ||
909 | vector minp = (vector) llGetSubString(pr0, 0, jx0); | ||
910 | vector minr = (vector) llGetSubString(pr0, jx0 + 1, -1); | ||
911 | string pr1 = llList2String(p, 1); | ||
912 | integer jx1 = llSubStringIndex(pr1, "><"); | ||
913 | vector maxp = (vector) llGetSubString(pr1, 0, jx1); | ||
914 | vector maxr = (vector) llGetSubString(pr1, jx1 + 1, -1); | ||
915 | maxp.x = maxp.x - minp.x; | ||
916 | maxp.y = maxp.y - minp.y; | ||
917 | minp.x = 0.0; minp.y = 0.0; | ||
918 | maxr.z = maxr.z - minr.z; | ||
919 | minr.z = 0.0; | ||
920 | return prStr(((string) minp) + ((string) minr)) + "|" + prStr(((string) maxp) + ((string) maxr)); | ||
921 | } | ||
922 | |||
923 | list reportPose() | 907 | list reportPose() |
924 | { | 908 | { |
925 | list result = []; | 909 | list result = []; |
@@ -1612,7 +1596,6 @@ checkSitters(integer del) | |||
1612 | } | 1596 | } |
1613 | 1597 | ||
1614 | // AO functions. | 1598 | // AO functions. |
1615 | list States = []; | ||
1616 | integer loadCard(string card, integer casperMode) | 1599 | integer loadCard(string card, integer casperMode) |
1617 | { | 1600 | { |
1618 | if (NULL_KEY != llGetInventoryKey(card)) | 1601 | if (NULL_KEY != llGetInventoryKey(card)) |
@@ -1621,7 +1604,7 @@ integer loadCard(string card, integer casperMode) | |||
1621 | string section = ""; | 1604 | string section = ""; |
1622 | integer l = osGetNumberOfNotecardLines(card); | 1605 | integer l = osGetNumberOfNotecardLines(card); |
1623 | integer i; | 1606 | integer i; |
1624 | States = initialStates; | 1607 | |
1625 | for (i = 0; i <= l; ++i) | 1608 | for (i = 0; i <= l; ++i) |
1626 | { | 1609 | { |
1627 | string line = osGetNotecardLine(card, i); | 1610 | string line = osGetNotecardLine(card, i); |
@@ -1653,29 +1636,14 @@ integer loadCard(string card, integer casperMode) | |||
1653 | } | 1636 | } |
1654 | if ("" != name) | 1637 | if ("" != name) |
1655 | { | 1638 | { |
1656 | found = llListFindList(States, [name]); | 1639 | found = findPose(name); |
1657 | if ((0 <= found) && ((found % 2) == 0)) | 1640 | if (-1 != found) |
1658 | { | 1641 | { |
1659 | string data = llList2String(States, found + 1); | 1642 | string data = llList2String(Poses, found + psANIM); |
1660 | if ("" != data) data += "|"; | 1643 | if ("" != data) data += "|" + rest; |
1661 | States = llListReplaceList(States, [name, data + rest], found, found + 1); | 1644 | rest = data; |
1662 | } | 1645 | } |
1663 | else States += [name, rest]; | 1646 | savePose("AO_" + name, rest, NULL_KEY, NULL_KEY); |
1664 | } | ||
1665 | } | ||
1666 | l = llGetListLength(States); | ||
1667 | for (i = 0; i < l; i += 2) | ||
1668 | { | ||
1669 | list nA = llParseStringKeepNulls(llList2String(States, i + 1), ["|"], []); | ||
1670 | integer m = llGetListLength(nA); | ||
1671 | integer j; | ||
1672 | for (j = 0; j < m; ++j) | ||
1673 | { | ||
1674 | list a = llCSV2List(llList2String(nA, j)); | ||
1675 | integer n = llGetListLength(a); | ||
1676 | integer k; | ||
1677 | for (k = 0; k < n; ++k) | ||
1678 | checkAnim(llList2String(a, k)); | ||
1679 | } | 1647 | } |
1680 | } | 1648 | } |
1681 | d("Read " + card + " in " + (string) (llGetTimeOfDay() - now) + " seconds."); | 1649 | d("Read " + card + " in " + (string) (llGetTimeOfDay() - now) + " seconds."); |