-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPotty.lsl
More file actions
157 lines (141 loc) · 5.93 KB
/
Potty.lsl
File metadata and controls
157 lines (141 loc) · 5.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*==========================================================
DrizzleScript
Created By: Ryhn Teardrop
Original Date: Dec 3rd, 2011
GitHub Repository: https://github.com/DoomRater/DrizzleScript
Programming Contributors: Ryhn Teardrop, Brache Spyker
Resource Contributors: Murreki Fasching, Brache Spyker
License: RPL v1.5 (Outlined at http://www.opensource.org/licenses/RPL-1.5)
The license can also be found in the folder these scripts are distributed in.
Essentially, if you edit this script you have to publicly release the result.
(Copy/Mod/Trans on this script) This stipulation helps to grow the community and
the software together, so everyone has access to something potentially excellent.
*Leave this header here, but if you contribute, add your name to the list!*
============================================================*/
//This script offloads the adjusting of wet and mess prims and faces from Menu
string g_diaperType;
integer g_mainPrim;
string g_mainPrimName = ""; // by default, set to ""
/* Puppy Pawz Pampers Variables */
integer g_wetPrim;
integer g_messPrim;
/* End of PPP variables*/
/* Nezzy's Brand Kawaii Diapers Variables */
//Kawaii doesn't use multiple prims for its settings, instead it uses faces
integer g_wetFace = 0;
integer g_errorCount = 0;
/*End of Kawaii variables*/
findPrims() {
integer i; // Used to loop through the linked objects
integer primCount = llGetNumberOfPrims(); //should be attached, not sat on
for(i = 0; i <= primCount; i++) {
string primName = (string) llGetLinkPrimitiveParams(i, [PRIM_NAME]); // Get the name of linked object i
if(primName == "Pee") {
g_wetPrim = i;
}
else if(primName == "Poo") {
g_messPrim = i;
}
else if(primName == g_mainPrimName) {
g_mainPrim = i;
}
}
//just in case there is an unnamed prim in the linkset, do this here
if(g_mainPrimName == "") { // No specified prim. Look for root.
if(primCount == 1) { //not a linked set, so the first prim is 0
g_mainPrim = 0;
}
else {
g_mainPrim = 1;
}
}
}
detectDiaperType() {
key mainPrimCreator = llGetCreator();
//JDroo Resident, creator of Kawaii Diapers
if(mainPrimCreator == "b9878483-a1fc-411f-8d9c-be53795eca6e") {
g_diaperType = "Kawaii";
}
//our fallback is to use Fluffems
else {
g_diaperType = "Fluffems";
}
}
adjustWetMessPrims(string msg) {
integer index;
index = llSubStringIndex(msg, ":"); // Pull out wet level
integer wetLevel = (integer) llGetSubString(msg, 0, index - 1);
msg = llGetSubString(msg, index+1, -1);
index = llSubStringIndex(msg, ":"); // Pull out mess level
integer messLevel = (integer) llGetSubString(msg, 0, index - 1);
if(llGetAlpha(ALL_SIDES) != 0.0) { // Only adjust the prims if the model isn't hidden!
if(g_diaperType == "Fluffems") {
if(wetLevel == 0) {
llSetLinkPrimitiveParamsFast(g_wetPrim, [PRIM_COLOR, ALL_SIDES, <1,1,1>, 0.0]);
}
else if(wetLevel == 1) {
llSetLinkPrimitiveParamsFast(g_wetPrim, [PRIM_COLOR, ALL_SIDES, <1,1,.666>, 0.20]);
}
else if(wetLevel == 2) {
llSetLinkPrimitiveParamsFast(g_wetPrim, [PRIM_COLOR, ALL_SIDES, <1,1,.5>, 0.35]);
}
else if(wetLevel == 3) {
llSetLinkPrimitiveParamsFast(g_wetPrim, [PRIM_COLOR, ALL_SIDES, <1,1,.333>, 0.45]);
}
else if(wetLevel == 4) {
llSetLinkPrimitiveParamsFast(g_wetPrim, [PRIM_COLOR, ALL_SIDES, <1,1,.25>, 0.55]);
}
else if(wetLevel == 5) {
llSetLinkPrimitiveParamsFast(g_wetPrim, [PRIM_COLOR, ALL_SIDES, <1,1,.1667>, 0.65]);
}
else if(wetLevel >= 6) {
llSetLinkPrimitiveParamsFast(g_wetPrim, [PRIM_COLOR, ALL_SIDES, <1,1,0>, 0.85]);
}
//mess levels
if(messLevel < 3) {
llSetLinkPrimitiveParamsFast(g_messPrim, [PRIM_COLOR, ALL_SIDES, <0.749, 0.588, 0.392>, 0.0]);
}
else {
llSetLinkPrimitiveParamsFast(g_messPrim, [PRIM_COLOR, ALL_SIDES, <0.749, 0.588, 0.392>, 0.65]);
}
}
else if(g_diaperType == "Kawaii") {
if(wetLevel == 0) {
llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_COLOR, g_wetFace, <1,1,1>, 0.0]);
}
else if(wetLevel == 1) {
llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_COLOR, g_wetFace, <1,1,.666>, 0.20]);
}
else if(wetLevel == 2) {
llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_COLOR, g_wetFace, <1,1,.5>, 0.35]);
}
else if(wetLevel == 3) {
llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_COLOR, g_wetFace, <1,1,.333>, 0.45]);
}
else if(wetLevel == 4) {
llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_COLOR, g_wetFace, <1,1,.25>, 0.55]);
}
else if(wetLevel == 5) {
llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_COLOR, g_wetFace, <1,1,.1667>, 0.65]);
}
else if(wetLevel >= 6) {
llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_COLOR, g_wetFace, <1,1,0>, 0.85]);
}
}
}
}//End WetMessPrims()
default {
state_entry() {
findPrims();
detectDiaperType();
}
link_message(integer sender_num, integer num, string msg, key id) {
if(num == -2 || num == -4) {
integer index = llSubStringIndex(msg, ":"); //Pull out the gender *Always first in list
msg = llGetSubString(msg, index+1, -1); //Cut msg down to reflect change and move on
if(~llSubStringIndex(msg, ":")) { // We got a message from main, let's adjust the wet and mess prims!
adjustWetMessPrims(msg);
}
}
}
}