“Slow Grow”
In this example, a timer slowly changes a variety of parameters until it reaches the end of the full transition effect.
Place this script along with the API script:
float v = 0.32;
float stage = 0;
float f_mode = 1;
integer th = 0;
float fm = 0;
float fp = 0;
float thr = 0;
integer counter;
OBS_send(key target, string payload) {
llMessageLinked(LINK_THIS, -78000, payload, target);
}
default {
state_entry() {
llSetTimerEvent(1);
}
timer() {
v+=0.01;
OBS_send(llGetOwner(),
"v="+(string)v
+";s="+(string)stage
+";f_mode="+(string)f_mode
+";th="+(string)th
+";fm="+(string)fm
+";fp="+(string)fp
+";thr="+(string)thr);
if (v > 0.6) {
stage = 1;
f_mode = 0;
th = 1;
fm=0.75; // precum
thr = (counter % 5 == 0) * 0.5;
} else if (v > 0.5) {
stage = 0.66;
f_mode = 0.66;
th = 1;
fp=0.75; // precum
} else if (v > 0.4) {
stage = 0.33;
f_mode = 0.33;
}
if (v >= 0.65) llSetTimerEvent(FALSE);
counter++;
}
touch_start(integer i) {
llResetScript();
}
}Debugger
Here is an example of a script that can be rezzed and still receive notifications.
Place this script along with the API script:
OBS_send(key target, string payload) {
llMessageLinked(LINK_THIS, -78000, payload, target);
}
OBS_sub() {
if (!llGetAttached()) {
// If rezzed, subscribe to notifications from same-owner Obsidian
OBS_send(llGetOwner(), "sub=1");
}
}
default {
state_entry() {
OBS_sub();
llSetTimerEvent(15);
}
timer() {
OBS_sub();
}
touch_start(integer i) {
// On touch, send ";"-separated command var=val pairs
// In this example: random stage and vertical angle
float s = llFrand(1);
float v = 0.25+llFrand(0.5);
OBS_send(llGetOwner(), "s="+(string)s+";v="+(string)v);
}
link_message(integer sender_num, integer num, string str, key id) {
if (num >= -78002 && num <= -78001) {
if (llGetOwnerKey(id)!=llGetOwner()) return; // Filter by object owner
if (num == -78001) {
// Notifications
llOwnerSay("[!]\t"+str);
} else if (num == -78002) {
// Intents and constraints sent by the HUD or other attached add-ons.
// Same-owner only.
// Use it to learn HUD's commands.
// llOwnerSay("\t"+str);
}
}
}
}
Obsidian