Professional Documents
Culture Documents
October 2008
“New Scripting Options
with 1.21 Browser”
Salahzar Stenvaag
Previous Scripting Improvements
in 2007-2008
messages)
● Special detect features so you can do more
● LlDetectedTouchBinormal (tangent)
● position,
● rotation and
● Scale
● position,
● rotation and
● Scale
●
1st touch will set top-left corner to
highlight
nd
●
2 touch will define bottom-right corner
and will send a message to the glass
Board Script (toggling and sending
nd
info at 2 touch
default
integer status=0; {
vector st1; state_entry()
vector st2; 1 {
2
sendInfo() llSay(0, "Reset");
{ status=0;
// inform of my touched }
pos, pos, rot and scale
touch_start(integer total_number) {
if(status==0) {
llMessageLinked(LINK_SET,0
st1=llDetectedTouchST(0);
,llList2CSV([st1, st2,
llSay(0,"click for 2nd point");
llGetPos(),llGetRot(),llGetSca
status++;
le()]), NULL_KEY);
return;
}
}
st2=llDetectedTouchST(0); 3
sendInfo(); status=0;
llSay(0,"Click for next 1st
point"); } }
Glass
Flashing and receiving resizing pos
Glass must:
● 3. Resize accordingly
Glass Script flashing and resizing
integer st=0;
vector x1=ZERO_VECTOR; default {
rotation r1=ZERO_ROTATION; state_entry() { llSetTimerEvent(1); }1
vector s1=ZERO_VECTOR; timer() {
vector f=ZERO_VECTOR; if(st==0) llSetAlpha(0.1,ALL_SIDES);
vector st1=ZERO_VECTOR; else llSetAlpha(0.5,ALL_SIDES);
vector st2=ZERO_VECTOR; st=1-st; // toggle flashing alpha
vector s2=ZERO_VECTOR; }} s2.x=(st2.x-st1.x)*s1.x;
2 s2.y=0.1;
default {
s2.z=(st1.y-st2.y)*s1.z; 3
link_message(integer sender, integer
vector x2=llGetPos();
channel, string str, key id){
x2.x=-s1.x/2+s1.x*(1-st1.x)-s2.x/2;
list recvd=llCSV2List(str);
x2.y=0;
st1=(vector)llList2String(recvd,0);
x2.z=-s1.z/2+s1.z*(st1.y)-s2.z/2;
st2=(vector)llList2String(recvd,1);
llSetScale(s2);
x1=(vector)llList2String(recvd,2);
llSetPos(x2);
r1=(rotation)llList2String(recvd,3);
f=x1-s1/2;
s1=(vector)llList2String(recvd,4);
}}