Difference between revisions of "User:Lastro Greenwood"
Jump to navigation
Jump to search
(2 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
== Scratch Pad == | == Scratch Pad == | ||
=== llCastRay === | |||
Determines if something is blocking line of sight to avatar. | |||
Uses: | |||
* Radiation? | |||
* Checking to see if avatar is hiding behind cover | |||
* Checking to see if avatar has line of sight to a heat source | |||
* Other stuff that requires LOS | |||
Observations: | |||
* When running the trace it seems to go straight through all objects that get in its way | |||
* It will return false if you dont filter out the object, a quick fix would be to change "if(numobj == 0)" to "if(numobj == 1)" | |||
<lsl>integer getnumobj(list traceres) | <lsl>integer getnumobj(list traceres) | ||
{ | { | ||
Line 10: | Line 23: | ||
} | } | ||
integer isVisible(vector start, vector finish) | integer isVisible(vector start, vector finish, integer filter) | ||
{ | { | ||
list res = llCastRay(start,finish, | list res = llCastRay(start,finish,filter,0); | ||
integer numobj = getnumobj(res); | integer numobj = getnumobj(res); | ||
Line 32: | Line 45: | ||
vector pos = llGetPos(); | vector pos = llGetPos(); | ||
vector finalpos = llDetectedPos(0); | vector finalpos = llDetectedPos(0); | ||
if(isVisible(pos,finalpos) == TRUE) | if(isVisible(pos,finalpos,AGENT) == TRUE) | ||
llOwnerSay("I can see clearly now!"); | llOwnerSay("I can see clearly now!"); | ||
else | else | ||
llOwnerSay("Something is in my way!"); | llOwnerSay("Something is in my way!"); | ||
} | |||
}</lsl> | |||
== RLV == | |||
=== RLV ASN Stargate Script === | |||
Allows for auto-teleporting via RLV, supports most relays | |||
<lsl>vector regCorner; | |||
integer relayChannel = -1812221819; | |||
default | |||
{ | |||
link_message(integer sender, integer num, string msg, key id) | |||
{ | |||
if(num != 205902) | |||
return; | |||
list data = llParseString2List(id,["|"],[]); | |||
string cmd = llList2String(data,0); | |||
if(cmd == "dial succeeded") | |||
{ | |||
string region = llList2String(data,1); | |||
regCorner = (vector)llList2String(data,2); | |||
llRequestSimulatorData(region,DATA_SIM_POS); | |||
} | |||
if(cmd == "wormhole collision") | |||
{ | |||
string target = llList2String(data,2); | |||
string msg = "stargate," + (string)target + ",@tpto:" + | |||
(string)regCorner.x + "/" + | |||
(string)regCorner.y + "/" + | |||
(string)regCorner.z + "=force"; | |||
llWhisper(relayChannel,msg); | |||
} | |||
/*string msgOut = "LINK MSG\n"; | |||
msgOut += "sender: " + (string)sender + "\n"; | |||
msgOut += "num: " + (string)num + "\n"; | |||
msgOut += "msg: " + msg + "\n"; | |||
msgOut += "key: " + (string)id + "\n"; | |||
llOwnerSay(msgOut);*/ | |||
} | |||
dataserver(key req, string data) | |||
{ | |||
regCorner += (vector)data; | |||
} | } | ||
}</lsl> | }</lsl> |
Latest revision as of 00:18, 7 August 2010
Lastro Greenwood's Page
Hey everyone, I'm Lastro Greenwood.
I specialise in software development but can kinda build.
Scratch Pad
llCastRay
Determines if something is blocking line of sight to avatar.
Uses:
- Radiation?
- Checking to see if avatar is hiding behind cover
- Checking to see if avatar has line of sight to a heat source
- Other stuff that requires LOS
Observations:
- When running the trace it seems to go straight through all objects that get in its way
- It will return false if you dont filter out the object, a quick fix would be to change "if(numobj == 0)" to "if(numobj == 1)"
<lsl>integer getnumobj(list traceres) {
return (integer)llList2String(traceres,llGetListLength(traceres)-1);
}
integer isVisible(vector start, vector finish, integer filter) {
list res = llCastRay(start,finish,filter,0); integer numobj = getnumobj(res); if(numobj == 0) return TRUE; return FALSE;
}
default {
state_entry() { }
touch_start(integer total_number) { vector pos = llGetPos(); vector finalpos = llDetectedPos(0); if(isVisible(pos,finalpos,AGENT) == TRUE) llOwnerSay("I can see clearly now!"); else llOwnerSay("Something is in my way!"); }
}</lsl>
RLV
RLV ASN Stargate Script
Allows for auto-teleporting via RLV, supports most relays
<lsl>vector regCorner; integer relayChannel = -1812221819; default {
link_message(integer sender, integer num, string msg, key id) { if(num != 205902) return; list data = llParseString2List(id,["|"],[]); string cmd = llList2String(data,0); if(cmd == "dial succeeded") { string region = llList2String(data,1); regCorner = (vector)llList2String(data,2); llRequestSimulatorData(region,DATA_SIM_POS); } if(cmd == "wormhole collision") { string target = llList2String(data,2); string msg = "stargate," + (string)target + ",@tpto:" + (string)regCorner.x + "/" + (string)regCorner.y + "/" + (string)regCorner.z + "=force"; llWhisper(relayChannel,msg); }
/*string msgOut = "LINK MSG\n"; msgOut += "sender: " + (string)sender + "\n"; msgOut += "num: " + (string)num + "\n"; msgOut += "msg: " + msg + "\n"; msgOut += "key: " + (string)id + "\n"; llOwnerSay(msgOut);*/ } dataserver(key req, string data) { regCorner += (vector)data; }
}</lsl>