Jump to content

Xiija

Resident
  • Posts

    920
  • Joined

  • Last visited

Everything posted by Xiija

  1. using the same number will keep you from having to check both the number and the message, so it's better?
  2. you can use http to activate an SL script, or have a script call your server with http, process someting on the web and have a return to SL ?
  3. you could use keyframes or a timer and a step variable?
  4. this is an example of SLPPF and a fast timer... script is made for an unlinked object .. rez a box and drop it in, and see if it is fast enuff? the movement is very small, mebbe that will help? integer k;integer flip = 1;list params;vector pos;integer link = 0;default{ state_entry() { params = llGetLinkPrimitiveParams(link, [PRIM_POSITION]); pos = llList2Vector(params,0); } touch_start(integer total_number) { if( k = !k) llSetTimerEvent(0.02); else llSetTimerEvent(0.0); } timer() { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_POSITION, pos + ( (flip = -flip) * <0.02, 0.0, 0.0> )] ); }}
  5. you could use flags? (Freya's suggestion) something like .... integer mouseFlag = TRUE; default{ state_entry() { llSetTimerEvent(0.5); owner = llGetOwner(); } timer() { info = llGetAgentInfo(owner); if(info & AGENT_MOUSELOOK) mouseFlag = TRUE; else { if(mouseFlag == TRUE) { llTriggerSound("foxblast2", 1); mouseFlag = FALSE; } } }} this should change the flag when you switch to mouselook, and change it again when you leave mouselook...
  6. you need to get each link's local position, then set it and toggle the change... something like this.....? ( this assumes one button ... an ON button) integer linkNum; vector currButton; list paramsONbutton; vector onButtonPos; float ONzee = 0.05; //add more button definitions here default { state_entry() { paramsONbutton = llGetLinkPrimitiveParams(2, [PRIM_POS_LOCAL]); onButtonPos = llList2Vector(paramsONbutton,0); // add more buttons here } touch_start(integer total_number) { linkNum = llDetectedLinkNumber(0); if( linkNum == 2) { currButton = onButtonPos; llSetLinkPrimitiveParamsFast(linkNum, [ PRIM_POS_LOCAL, currButton - <0.0, 0.0, ONzee> ] ); ONzee = -ONzee; } // add more link checks here } } you will need a list , float and vector variable for each button prim, and IF statements for each button link number?
  7. this will get the names of the sounds automatically. just drop as many sounds as you want in the prim, and this script, and start typing to test it?
  8. first , get all your sounds in a list in state entry. next count the items in your list of sounds and choose a random numbered one to play. list sounds; default { state_entry() { integer count; string name; while ( (name = llGetInventoryName(INVENTORY_SOUND, count)) ) { sounds += name; ++count; } llSetTimerEvent(0.2); } timer() { integer len = llGetListLength(sounds) - 1; if (llGetAgentInfo(llGetOwner()) & AGENT_TYPING) { integer place = llRound( llFrand(len) ); llLoopSound( llGetInventoryName(INVENTORY_SOUND, place), 0.2); } else { llStopSound(); } } }
  9. mebbe try setting push to a negative z? <0,0,-100>; ETA: this didn't work
  10. no idea what is happening... did your server mebbe get a new key?
  11. casting a float to an integer will round it? 0.20 becomes 0 mebbe change your integers to floats? float glow = llList2Float(GL, 0); if (glow == glowon)
  12. not sure what you mean but.. you can make your variables global, or just update local variables of your user functions with the timer? in this example, when the timer fires, each of your user functions is called, and updated? ___________________________________ integer min = 30; integer max = 180; intger a; integer b; integer c; Step1() { //do stuff a += 1; llOwnerSay("Step one result: " + (string)a ); } Step2() { //do stuff b += 2; llOwnerSay("Step two result: " + (string)b ); } Step3() { //do stuff c += 3; llOwnerSay("Step three result: " + (string)c ); } default { state_entry() { // llSetTimerEvent( max - llFrand(min) ); } timer() { //? Step1(); Step2(); Step3(); } } _________________________________ hope this helps
  13. ** The response body is limited to 2048 bytes by default; if it is longer it will be truncated.** I have a response body that is longer than this, is there any way to get just a certain portion of a google doc? would it be better to use a spreadsheet/chart etc?
  14. other options besides the desc. field are.... Using SLPPF and storing the info in a string and storing the string in a prim's "texture" field. i.e. llSetPrimitiveParams([ PRIM_TEXTURE, 3, "this is a storage area", <1.0, 1.0, 0.0>, ZERO_VECTOR, 0.0, PRIM_TEXTURE, 4, "this is also a storage area", <1.0, 1.0, 0.0>, ZERO_VECTOR, 0.0]); Using Void's Teacup code. http://wiki.secondlife.com/wiki/Teacup
  15. just curious about what this does? If i have a prim, and it requests a URL, will any HTTP requests from another prim go to this one just like they go to a webpage? Can this prim respond like a webpage? .... i'm just wondering if I could use this method without needing any php... Thanx for any info :)
  16. i use this for my HUD and it seems to work ok? rotate 90 forward...... llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROTATION,llGetLocalRot() * llEuler2Rot(<0,0,90>*DEG_TO_RAD)]); rotate negative 90 back to position ...... llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROTATION,llGetLocalRot() * llEuler2Rot(<0,0,-90>*DEG_TO_RAD)]);
  17. there is a freebie on MP that you could try also... https://marketplace.secondlife.com/p/LAMU-HOVERING-ANIMATION-by-Su-Voir-and-MrS/1860277
  18. try putting your loop in the data event? adding to "i" and querying from within the dataserver will loop for you, then check for list end and reset "I" ... integer detectionTime = 25;integer listLength;string currName;key currID;key query;integer findDays(string data){ integer result; list parse_date = llParseString2List(data, ["-"], []); integer year = llList2Integer(parse_date, 0); result = (year - 2000) * 365; list days = [ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 ]; result += llList2Integer(days, (llList2Integer(parse_date, 1) - 1)); if (year/4 == llRound(year/4)) result += 1; result += llList2Integer(parse_date, 2); return result;} list allAvatars; integer i ; default{ state_entry() { llSetTimerEvent(0.1); } timer() { allAvatars = llGetAgentList(AGENT_LIST_REGION, []); listLength = llGetListLength(allAvatars); llOwnerSay("avis in region: " + (string)listLength); query = llRequestAgentData(llList2String(allAvatars,i), DATA_BORN); llSetTimerEvent(detectionTime); } dataserver(key queryid, string data) { if ( queryid == query) { integer age = findDays(data); currName = llKey2Name(llList2Key(allAvatars,i)); currID = llList2Key(allAvatars,i); llOwnerSay(currName+"("+(string)currID+") was born "+(string)age+" days ago."); ++i; query = llRequestAgentData(llList2String(allAvatars,i), DATA_BORN); if( i == listLength ) { i = 0; return; } } } }
  19. If you are touching a HUD, you will need either a texture with certain areas representing buttons, or a multi prim HUD? if you use a multi prim, you can get the link number ( and name) of the prim button that was touched... if( llGetLinkName(llDetectedLinkNumber(0)) == "button_1") { } .... or just get the number.... if( llDetectedLinkNumber(0)) == 2) { } if you are using a texture, you will need touch UV ? http://wiki.secondlife.com/wiki/LlDetectedTouchUV after you have gotten the button touched, you will need to send a msg from your HUD to the objects... if (gON = !gON ) // toggle the switch and check if it is true or flase { llRegionSay(-123,"Alpha ONE on"); } else { llRegionSay(-123,"Alpha ONE off"); } then you need a listen event in your objects to act on the message they recieve... hope this helps E.T.A. for changing alpha... http://wiki.secondlife.com/wiki/LlSetAlpha http://wiki.secondlife.com/wiki/LlSetLinkAlpha http://wiki.secondlife.com/wiki/LlSetLinkPrimitiveParamsFast#llSetLinkPrimitiveParamsFast
  20. in your root object, get the name of the link that was hit and send a message to the skeeball if it was a "score" prim collision_start(integer num) { if( llGetLinkName(llDetectedLinkNumber(0)) == "score") { key id = llDetectedKey(0); // the key of the skeeball that hit it llRegionSayTo(id, 0, "die"); // send a message to that skeeball ONLY } } in your skeeball , put a listen listen(integer channel, string name, key id, string message) { if(message == "die" { llDie(); } } this should send a message Only to the skeeball that did the hitting, use a different channel than zero for your listen and regionsay
  21. This will play either as an attatched drum, or if it is rezzed. **assumes one sound and one animation in the drum's contents** integer isPlaying = FALSE; string anim; integer tog; default { state_entry() { anim = llGetInventoryName(INVENTORY_ANIMATION,0); } touch_start(integer total_number) { if( llGetAttached() ) { llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); if(isPlaying) { llStopSound(); llStopAnimation(anim); isPlaying = FALSE; llResetScript(); } else { llLoopSound(llGetInventoryName(INVENTORY_SOUND, 0), 1.0); isPlaying = TRUE; } } else { if(tog = !tog) llLoopSound(llGetInventoryName(INVENTORY_SOUND, 0), 1.0); else llStopSound(); } } run_time_permissions(integer perm) { if (perm & PERMISSION_TRIGGER_ANIMATION) { llStartAnimation(anim); } } }
  22. I think you get the regional position kinda like this.... key id = llGetOwner(); list details = llGetObjectDetails(id, ([OBJECT_POS]) ); vector pos = llList2Vector(details, 0); and you do something like this to show the position on a (square?) prim... vector myPos = <pos.x*255, pos.y*255, 24>; You could maybe use an invis texture with a dot at center, in front of your map prim and just adjust the dot texture offset, otherwise you will need to get the map prims position,& size and the marker prim position & size, etc.... hope this helps, i have a sim map that zooms in to the touched point, and i use something like this
  23. You could set the HUD object's name every time it is worn....it will revert to the name you gave it when removed... something like this..... string name; string MYname; init() { name = llKey2Name( llGetOwner() ); MYname = llGetSubString(name,0,llSubStringIndex(name," ")); llSetObjectName(MYname); } default { state_entry() { init(); } on_rez(integer param) { init(); } attach(key id) { init(); } } _______________________________ now when the HUD whispers, it will use the wearer's first name
  24. float cloakSpeed = 0.1; float alpha = 1.0; default { state_entry() { llListen(0,"",llGetOwner(),""); } listen(integer channel, string name, key id, string message) { if(message == "fold") { while(alpha > 0.0) { alpha -= 0.1; llSetAlpha(alpha, ALL_SIDES); llSleep(cloakSpeed); } } if(message == "pull") { while (alpha < 1.0) { alpha += 0.1; llSetAlpha(alpha, ALL_SIDES); llSleep(cloakSpeed); } } } }
  25. the script needs to know what item is being requested? You need a detected touch event,that matches either a face, or the co-ordinates of the touch as it relates to the display texture?
×
×
  • Create New...