-
Posts
915 -
Joined
-
Last visited
Content Type
Forums
Blogs
Knowledge Base
Everything posted by Xiija
-
when the lamp in ON, just add the SLPPF call ? llSetLinkPrimitiveParamsFast(LINK_THIS, [ PRIM_FULLBRIGHT,0, TRUE ] ); and when it is OFF .... llSetLinkPrimitiveParamsFast(LINK_THIS, [ PRIM_FULLBRIGHT,0, FALSE ] ); ...or if you use a variable for the on/off ...lets call it "switch"... then llSetLinkPrimitiveParamsFast(LINK_THIS, [ PRIM_FULLBRIGHT,0, switch ] );
-
Change transparency of prims with the use of audio stream?
Xiija replied to Jadey Whitefalcon's topic in LSL Scripting
pleh, i used the new stuff and now i get Status; 403 Code: Forbidden it's so strange how such a popular thing as streaming music is SO arcane. I search the web and forums, and no one seems to have any decent info on how to do something so simple. anyhoo, ::shrugs:: -
worked great TY list add = [ PSYS_SRC_TEXTURE,fireTexture]; list params = fire_particle_definition + add; I'll be aware of globals from now on
-
I'm trying to change textures on a particle generator but must be missing something simple? here is a test script i cut out to test with. // UUID of fire textures to use key fire0 = "d051f508-4a32-7c5f-1efc-1a9291dea812"; key fire1 = "fd94f349-c7f4-fe85-0050-c2ef380c96e8"; key fire2 = "8964b921-980a-2ce5-553c-bbe954e352a0"; key fire3 = "2d945ba8-8069-53b4-384b-fb59e06c28cd"; key fire4 = "b5ddb836-3124-ca56-d2b1-00d6984f9fce"; key smoke = "84fae6b5-c6d4-fe78-9be7-3051b615a46d"; list firesMAIN = [ "d051f508-4a32-7c5f-1efc-1a9291dea812", "fd94f349-c7f4-fe85-0050-c2ef380c96e8", "8964b921-980a-2ce5-553c-bbe954e352a0", "2d945ba8-8069-53b4-384b-fb59e06c28cd", "b5ddb836-3124-ca56-d2b1-00d6984f9fce" ]; list fires = [fire0, fire1, fire2, fire3, fire4]; key fireTexture; string test; list fire_particle_definition = [ PSYS_PART_MAX_AGE,2.23, PSYS_PART_FLAGS, 259, PSYS_PART_START_COLOR, <0.79431, 0.67517, 0.20598>, PSYS_PART_END_COLOR, <0.96520, 0.25110, 0.15348>, PSYS_PART_START_SCALE,<0.00000, 0.09467, 0.00000>, PSYS_PART_END_SCALE,<6.8211, 8.8212, 0.00000>, PSYS_SRC_PATTERN, 2, PSYS_SRC_BURST_RATE,0.12, PSYS_SRC_ACCEL, <0.00000, 0.00000, 1.72082>, PSYS_SRC_BURST_PART_COUNT,9, PSYS_SRC_BURST_RADIUS,0.7, PSYS_SRC_BURST_SPEED_MIN,0.04, PSYS_SRC_BURST_SPEED_MAX,0.30, PSYS_SRC_ANGLE_BEGIN, 1.65, PSYS_SRC_ANGLE_END, 0.00, PSYS_SRC_OMEGA, <0.00000, 0.00000, 0.00000>, PSYS_SRC_MAX_AGE, 0.0, PSYS_PART_START_ALPHA, 0.30, PSYS_PART_END_ALPHA, 0.00, PSYS_SRC_TEXTURE,fireTexture ]; //add texture to end of list test01() { fireTexture = llList2Key(firesMAIN,x); // test = (string)fireTexture; // fireTexture = llList2Key(fires,x); // fireTexture = fire0; llOwnerSay( "\nlist pos : " + (string)x + "\nfire key : " + (string)fireTexture ); // list params = fire_particle_definition + [fireTexture]; list params = fire_particle_definition; llParticleSystem(params); x = ++x % 5; } integer k; integer x; default { state_entry() { } touch_start(integer total_number) { if( k = !k) test01(); else llParticleSystem([]); } } if you paste this into a box prim and click it, the fire textures SHOULD cycle thru, but i am only seeing one texture each time. The weird thing is, if i change the line... PSYS_SRC_TEXTURE,fireTexture ... to... PSYS_SRC_TEXTURE,fire0 it will show that texture. I've used variables in particle scripts before, ...just been staring at this so long that i cannot see it....lil help? p.s. ... as you can see from the parts commented out, i've been trying many variations, even setting the variable directly wont work?.. ( fireTexture = fire0; )
-
Change transparency of prims with the use of audio stream?
Xiija replied to Jadey Whitefalcon's topic in LSL Scripting
A snippet example on using lsl to capture and parse an http body? /* Old style request : HTTPRequest=llHTTPRequest(URL + "/7.html HTTP/1.0\nUser-Agent: LSL Script (Mozilla Compatible)\n\n",[],""); new style request: HTTPRequestKey=llHTTPRequest(url + "/stats?sid=1 HTTP/1.0\nUser-Agent: XML Getter (Mozilla Compatible)\n\n",[],""); ** july - 2017 won't work with this script - string URL = "http://ice1.somafm.com/lush:80"; WORKING - string URL = "http://149.56.155.209:80"; */ list StatusCodes =[ 100,"Continue", 101,"Switching Protocols", 200,"OK", 201,"Created", 202, "Accepted", 203, "Non-Authoritative Information", 204, "No Content", 205, "Reset Content", 206, "Partial Content", 300, "Multiple Choices", 301, "Moved Permanently", 302, "Found", 303, "See Other", 304, "Not Modified", 305, "Use Proxy", 306, "(Unused)", 307, "Temporary Redirect", 400, "Bad Request", 401, "Unauthorized", 402, "Payment Required", 403, "Forbidden", 404, "Not Found", 405, "Method Not Allowed", 406, "Not Acceptable", 407, "Proxy Authentication Required", 408, "Request Timeout", 409, "Conflict", 410, "Gone", 411, "Length Required", 412, "Precondition Failed", 413, "Request Entity Too Large", 414, "Request-URI Too Long", 415, "Unsupported Media Type", 416, "Requested Range Not Satisfiable", 417, "Expectation Failed", 500, "Internal Server Error", 501, "Not Implemented", 502, "Bad Gateway", 503, "Service Unavailable", 504, "Gateway Timeout", 505, "HTTP Version Not Supported"]; string Genre; string SongTitle; string URL = "http://149.56.155.209:80"; key HTTPRequestKey; default { state_entry() { } touch_start(integer total_number) { HTTPRequestKey = llHTTPRequest(URL + "/stats?sid=1 HTTP/1.0\nUser-Agent: XML Getter (Mozilla Compatible)\n\n", [HTTP_METHOD, "GET", HTTP_MIMETYPE, "text/application/xml;charset=utf-8", HTTP_BODY_MAXLENGTH,16384, HTTP_PRAGMA_NO_CACHE,TRUE], ""); } http_response(key k,integer status, list meta, string body) { if(k != HTTPRequestKey) { llSay(0," nope"); return; } if(status != 200) { integer index = llListFindList(StatusCodes, [status]); string msg = llList2String(StatusCodes,index+1); llOwnerSay("\nStatus; " + (string)status + "\nCode: " + msg ); return; } else { list my_list = llParseString2List(body,["><","</"],[""]); integer index1 = llListFindList(my_list, ["SERVERGENRE"]); Genre = llList2String(my_list,index1 -1); Genre = llGetSubString(Genre, 12, -1); integer index2 = llListFindList(my_list, ["SONGTITLE"]); SongTitle = llList2String(my_list,index2 -1); SongTitle = llGetSubString(SongTitle, 10, -1); llOwnerSay(" got \n" + Genre + " \n" + SongTitle); // for debug } } } -
vector euler = llRot2Euler( some_rot ); // change rotation to vector euler *= RAD_TO_DEG;// change vector to degrees http://wiki.secondlife.com/wiki/LlRot2Euler
-
Change transparency of prims with the use of audio stream?
Xiija replied to Jadey Whitefalcon's topic in LSL Scripting
this is an advanced script, because you have to determine what kind of stream is being used. old style streams might use... HTTPRequest=llHTTPRequest(URL + "/7.html HTTP/1.0\nUser-Agent: LSL Script (Mozilla Compatible)\n\n",[],""); while newer shoutcast one may use... llHTTPRequest(URL + "/stats?sid=1 HTTP/1.0\nUser-Agent: XML Getter (Mozilla Compatible)\n\n", etc etc... seems you need the employment forum, and it won't be cheap -
here is an idea of what you might do? list rot_list; check_prims() { rot_list = []; integer prims=llGetNumberOfPrims(); integer x; for(x = 1; x <= prims;++x) { key link_key = llGetLinkKey(x); list temp = llGetLinkPrimitiveParams(x,[ PRIM_ROT_LOCAL ] ); rotation r = llList2Rot( temp,0); rot_list += link_key; rot_list += r; } } compare_lists(); { // make a function to compare list elements, and return TRUE or FALSE } reset_rotations() { // make a function to reset all rotations } list start_rotations; list chk_rotations; default { state_entry() { check_prims(); start_rotations = rot_list; } touch_start(integer total_number) { check_prims(); chk_rotations = rot_list; integer status = compare_lists(); if( status ) llOwnerSay("rotations correct"); else reset_rotations(); } }
-
Position HUD attachment over something in-world?
Xiija replied to Wulfie Reanimator's topic in LSL Scripting
mebbe you can mod this, or get some ideas from it? http://wiki.secondlife.com/wiki/Target_Crosshair_HUD -
to check specific areas with cast ray use something like this...? vector start = llGetPos(); vector end = start ; (zero meters) integer filter = RC_REJECT_PHYSICAL | RC_REJECT_NONPHYSICAL | RC_REJECT_LAND ; // avatars only? list results = llCastRay(start, end, [RC_REJECT_TYPES, filter, RC_MAX_HITS, 4] ); and to increase range to 10m, vector start = llGetPos() + <10.0, 0.0, 0.0>; (10 meters on X axis) vector end = start; cast ray is best used to detect things in a straight line from the prim the script is in, unlike sensor, which detects in a circle or portions thereof your sensor code above merely increases the range of the sensor, but will still detect people standing at 3m .... you need to parse the target's distance from the prim to decide who to affect? // ************** in a timer or where-ever, put your sensor, llSensor("", "", AGENT_BY_LEGACY_NAME, 10.0, PI); // Detect any avatars within a 10 metre radius sphere // use the sensor event to check ********************** sensor(integer number_detected) { integer i = 0; do { llOwnerSay(llDetectedName(i) + " is " + (string) llVecDist(llGetPos(), llDetectedPos(i) ) + "m away."); // if avatar is at 10 meters, you could add code here to affect them...tho between 9.5m & 10.0m would be // easier to detect as it would be rare to have someone EXACTLY at 10m away? } while(++i < number_detected); } no_sensor() { llOwnerSay("No avatars in range."); }
-
JSON radio example with moded VoidSinger dialog code. Parcel radios must usually be deeded. Notecard station format is... SecretAgent = http://mp2.somafm.com:9016 Techno = http://81.88.36.42:8010 etc.... _________________________________________________ /* Xiija Resident, 2017 Json Radio example with moded VoidSinger Dialog code */ string station; string Stations; string name; string url; string NC; string TuneIn; key kQuery; integer iLine; integer len; string Curr; list gLstMnu; string txt; key id; integer chan ; integer handle; integer idx; integer ttlPG; integer currPG = 1; list uDlgBtnLst( integer vIdxPag ) { list vLstRtn; if ((gLstMnu != []) > 9) { integer vIntTtl = -~((~([] != gLstMnu)) / 9); //-- Total possible pages integer vIdxBgn = (vIdxPag = (vIntTtl + vIdxPag) % vIntTtl) * 9; //-- first menu index string vStrPag = llGetSubString( " ", 21 - vIdxPag, 21 ); //-- encode page number as spaces vLstRtn = llListInsertList( llList2List( gLstMnu, vIdxBgn, vIdxBgn + 8 ), (list)(" «" + vStrPag), vIdxBgn + 9 ) + "OFF/CLOSE" + (list)(" »" + vStrPag); } else { vLstRtn = gLstMnu + [" ", "OFF/CLOSE"," "] ; } return //-- fix the order for [L2R,T2B] and send it out llList2List( vLstRtn, -3, -1 ) + llList2List( vLstRtn, -6, -4 ) + llList2List( vLstRtn, -9, -7 ) + llList2List( vLstRtn, -12, -10 ); } init() { chan = 0x80000000 | (integer)("0x"+(string)llGetOwner()); // unique channel based on owners UUID NC = llGetInventoryName(INVENTORY_NOTECARD,0); Stations = llList2Json( JSON_OBJECT, [] ); // must declare JSON object before using. llSay(0,"Stations Loading....."); kQuery = llGetNotecardLine(NC, iLine); txt = "\n Radio Menu\nPage : " + (string) currPG + " of " + (string)ttlPG + "\n \nOff - turns off radio\nCLOSE - closes this menu\n \nCurrently listening to " + "\n " + Curr; } default { state_entry() { init(); } on_rez(integer param) { init(); } touch_start(integer total_number) { id = llDetectedKey(0); llDialog( id, txt, uDlgBtnLst( 0 ), chan ); handle = llListen(chan,"","",""); llListenControl(handle, TRUE); llSetTimerEvent(20); } dataserver(key query_id, string data) { if (query_id == kQuery) { if (data == EOF) { iLine = 0; llSay(0,"Stations Loaded"); list details = llJson2List ( Stations ); details = llList2ListStrided(details,0,-1,2); // strided list of button names from notecard gLstMnu = details; integer c = llGetListLength(gLstMnu); ttlPG = llCeil(c/9.0 ); txt = "\n Radio Menu\nPage : " + (string) currPG + " of " + (string)ttlPG + "\n \nOff - turns off radio\nCLOSE - closes this menu\n \nCurrently listening to " + "\n " + Curr; } else { if(data != "") { list extract = llParseString2List(data,[" "],["="]); name = llList2String(extract, 0); name = llGetSubString(name, 0, 23) ; // a check ..if !( name = 0 < button_text_length < 23) url = llList2String(extract, 2); if (llJsonGetValue (Stations, [name] ) == JSON_INVALID) // if not a JSON key-value pair in the JSON object, add one { Stations = llJsonSetValue (Stations, [name, "URL"], url); } } ++iLine; kQuery = llGetNotecardLine(NC, iLine); } } } listen( integer vIntChn, string vStrNom, key vKeySpk, string vStrMsg ) { if (!llSubStringIndex( vStrMsg, " " )) { integer SSI = llSubStringIndex(vStrMsg, "»"); if(SSI == 1) { ++currPG; if(currPG > ttlPG) { currPG = 1;} } else { --currPG; if(currPG < 1) { currPG = ttlPG;} } txt = "\n Radio Menu\nPage : " + (string) currPG + " of " + (string)ttlPG + "\n \nOff - turns off radio\nCLOSE - closes this menu\n \nCurrently listening to " + "\n " + Curr; llDialog( vKeySpk, txt, uDlgBtnLst( llStringLength( vStrMsg ) + llSubStringIndex( vStrMsg, "»" ) - 2 ), vIntChn ); llSetTimerEvent(20); } else if (vStrMsg == "OFF/CLOSE") { llDialog( vKeySpk, "\n \nPick an option...",["OFF","CLOSE"], vIntChn );} else if (vStrMsg == "CLOSE") { llSetTimerEvent(0.5);} else if (vStrMsg == "OFF") { llListenControl(handle, FALSE); llSetParcelMusicURL(" "); llSay(0,"Turning Radio off... " ); llSetTimerEvent(0); llMessageLinked(LINK_THIS, 0, TuneIn, ""); // for a seperate titler script perhaps? } else { Curr = vStrMsg; llSay(0,"Tuning in to... " + vStrMsg ); TuneIn = llJsonGetValue (Stations, [vStrMsg, "URL"]) ; llSetParcelMusicURL(TuneIn); idx = llListFindList( gLstMnu, (list)vStrMsg ) / 9; txt = "\n Radio Menu\nPage : " + (string) currPG + " of " + (string)ttlPG + "\n \nOff - turns off radio\nCLOSE - closes this menu\n \nCurrently listening to " + "\n " + Curr; llDialog( id, txt, uDlgBtnLst(idx ), chan ); llSetTimerEvent(20); llMessageLinked(LINK_THIS, 1, TuneIn, ""); // for a seperate titler script perhaps? } } timer() { llListenControl(handle, FALSE); llSetTimerEvent(0); } changed(integer change) { if (change & (CHANGED_REGION_START | CHANGED_OWNER | CHANGED_INVENTORY) ) { llOwnerSay("Radio Resetting..."); llResetScript(); } } }
-
Does anyone know a good scripting tutor for lsl?
Xiija replied to SupaDupaTroopa's topic in LSL Scripting
You can search for "script" in your client's search bar, and choose 'groups' to see all the scripting groups, also, NCI (New Citizens Inc) has classes for building and scripting... http://maps.secondlife.com/secondlife/Kuula/66/169/28 type this in your chatbar to view the NCI group ( free to join) secondlife:///app/group/a053573f-e2b3-ccb0-954a-177ad62e4d37/about- 6 replies
-
- lsl
- block code
-
(and 5 more)
Tagged with:
-
json is mebbe a little easier than manipulating a lot of lists and list items? you can do something like.... string Stations = llList2Json( JSON_OBJECT, [] ); name = "jazz" url = "http://some.jazz.stream"; if (llJsonGetValue (Stations, [name] ) == JSON_INVALID) { Stations = llJsonSetValue (Stations, [name, "URL"], url); } and then get the info from the exact location by name, (if your listen event gets the string message "jazz") TuneIn = llJsonGetValue (Stations, [Msg, "URL"]) ; llSetParcelMusicURL(TuneIn); you can do most of the json stuff with strided lists, so, what ever you like http://wiki.secondlife.com/wiki/Json_usage_in_LSL http://wiki.secondlife.com/wiki/Talk:Json_usage_in_LSL http://wiki.secondlife.com/wiki/User:Vegas_Silverweb/LSL_to_JSON
-
Burningman: Burnstock music & poetry artists needed.
Xiija replied to Xiija's topic in Upcoming Events and Activities
Weekly bump to try and get more performers ty ! -
Something to mebbe play with? http://wiki.secondlife.com/wiki/LlGetRegionTimeDilation
-
there are some suggestions on drop boxes here... http://wiki.secondlife.com/wiki/LlAllowInventoryDrop
-
Needing help with animation in a command listen script
Xiija replied to Sumomo Cheri's topic in LSL Scripting
I think you can use the Take_Controls stuff if you want your script to work in no script areas? I'm not real sure, and it's been a long time, but it used to be something like... // no script area hack? state_entry { if(llGetAttached()) llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS); } attach(key k) { if(k) llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS); } run_time_permissions(integer p) { if (p & PERMISSION_TAKE_CONTROLS) llTakeControls(CONTROL_FWD, TRUE, TRUE); } control(key k, integer l, integer e) {} -
Burningman: Burnstock music & poetry artists needed.
Xiija replied to Xiija's topic in Upcoming Events and Activities
Weekly bump to try and get more performers ty ! -
here is a snippet to display a small subset of a list at a time on hovertext. list names = [ "name lastname 0", "name lastname 1", "name lastname 2", "name lastname 3", "name lastname 4", "name lastname 5", "name lastname 6", "name lastname 7", "name lastname 8", "name lastname 9", "name lastname 10" ]; integer len; integer k; integer index; list display; string msg = "Waiting List: \n \n"; default { state_entry() { len = llGetListLength(names); llSetText("Line Closed",<0,1,0>,1.0); } touch_start(integer total_number) { if(k = !k) { llSetTimerEvent(0.5); } else { llSetTimerEvent(0.0); llSetText("Line Closed",<0,1,0>,1.0); index = 0; } } timer() { display = llList2List(names, index, (index+ 3) ); string tmp = llDumpList2String(display,"\n"); llSetText(msg + tmp,<0,1,0>,1.0); index = ++index%len; llSetTimerEvent(1.5); } }
-
http://wiki.secondlife.com/wiki/LlTextBox http://wiki.secondlife.com/wiki/Listen above your head sounds like a titler, .... https://marketplace.secondlife.com/p/Multiline-Titler/6735253
-
July 21-23, 2017 Octoburn is quickly approaching and for one final large fundraiser for the purchase of extra sims for our week-long flagship event, we will be holding a non-stop music weekend that will run straight from midnight SLT Friday, July 21 through noon Sunday July 23. Immediately following the Conception's "Leave No Trace" deadline, the playa will be cleared, an awesome stage will be set up and we'll kick off the party with music fireworks. Other activities will be available such as bowling, games, art cars, etc. Help us celebrate the Ten Principles with fun, community, and of course lots of FIRE! Performances will include DJs, open mic, poetry readings, etc. Yes, we invite YOUR participation! Artist signup sheet: Burnstock 2017 Performer Signup
-
...this is a limit to physical linked objects for vehicles, but you can have more than 32 if you make all but the root Phys shape NONE. ( as Innula suggested) llSetLinkPrimitiveParamsFast(LINK_ALL_CHILDREN, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_NONE]); if your beam seat has a sit target, you should still be able to sit on it even if it is ..type- NONE?
-
I tried to help someone once by doing a scripting job that was posted in help wanted, and the client paid lindens and then started changing their mind about what they wanted as compared to the original project. It was the last time i took on a project for a stranger for payment. Now i only do scripting for certain groups.... Burningman, SL Roller Derby etc, and i don't charge and all the scripts are full perm. I don't even ask for any creative commons attribution to be included. For me, this is less stress or worry and it allows the scripts to be used or shared with anyone. If you do scripting for a business, you should clearly define what you are selling, and what (if any) kind of licensing is included with your scripts. Even with Creative Commons (CC), there are many alternatives, and if the scripts are Not CC, there are prolly many more types of license, ...so good luck picking one you like
-
you can do arrays with json? JsonGetValue JsonSetValue llJson2List llList2Json Here is a small example by Dora on how to use json that i was playing with, ... there should be forum posts on Json somewhere.... // JSON array forum example by Dora Gustafson, Studio Dora 2013 // Building an 3 by 5 array in a JSON Object // Rows are indexed by name and columns are indexed by number = 0,1,2,3,4 string JSONVotes; string JSONVotes2; tellVotes( string voter) { string Js = llJsonGetValue( JSONVotes, [voter]); list Jl = llParseString2List( Js,[",","[","]","\""],[]); string output = llDumpList2String( Jl, ", "); llOwnerSay( "Votes from "+voter+" are: "+output); } integer x; string Main; string votes; default { state_entry() { // Building the JSON object votes = llList2Json( JSON_ARRAY, [0, 0, 0, 0, 0]); // one row // Main = llList2Json( JSON_OBJECT, ["MAIN",JSONVotes] ); <--- cannot define before or will be null JSONVotes2 = llList2Json( JSON_OBJECT, [ "Betty2", votes, "Jerry2", votes, "Pierre2", votes]); // complete object JSONVotes = llList2Json( JSON_OBJECT, [ "Betty", votes, "Jerry", votes, "Pierre", votes]); // complete object Main = llList2Json( JSON_OBJECT, ["MAIN",JSONVotes] ); //<--- top lvl defined last } touch_end( integer num) { // Testing the JSON object ++x; llOwnerSay( "main before " + Main); string name = llDetectedName(0); Main += (string) llList2Json( JSON_OBJECT, ["SECOND", JSONVotes2] ); llOwnerSay( "main after " + Main); } }
-
Lol ! ... Now That is a Big Listen!