Jump to content

Xiija

Resident
  • Posts

    917
  • Joined

  • Last visited

Everything posted by Xiija

  1. is this a pathfinding path? dunno if this will help, but it's kinda like a keyframe motion thing, ? just adjust stuff and experiment vector next; list path = [ <5.0, 0.0, 0.0>, <5.0, 5.0, 0.0>, <0.0, 5.0, 0.0>, <0.0, 0.0, 0.0> ]; move() { vector base = llGetPos(); integer x; integer len = llGetListLength(path); for(; x < len; ++x) { next = base + llList2Vector(path,x); llNavigateTo( next , [ FORCE_DIRECT_PATH,TRUE ]); llSleep(2.5); } llSetPos( base ); } integer k; default { state_entry() { llCreateCharacter([ CHARACTER_MAX_SPEED, 6, CHARACTER_DESIRED_SPEED, 2.0]); } touch_start(integer total_number) { if( k = !k) llSetTimerEvent(0.5); else llSetTimerEvent(0.0); } timer() { move(); } }
  2. if it is just for yourself, you could mebbe do a user function with something like this in it? ( untested snippet) integer new_Gloss = 250; SET_GLOSS() // user func { integer prims = llGetObjectPrimCount( llGetKey() ); integer curr_link; for( curr_link = 1; curr_link <= prims; ++curr_link) // cycle thru prims { integer numOfSides = llGetLinkNumberOfSides( curr_link ); integer curr_face; for(curr_face = 0; curr_face <= numOfSides; ++curr_face) // cycle thru faces per prim { list params = llGetLinkPrimitiveParams( curr_link, [ PRIM_SPECULAR, curr_face ]); string S_texture = llList2String( params,0 ); vector V_repeats = llList2Vector( params,1 ); vector V_offsets = llList2Vector( params,2 ); float F_rotation_in_radians = llList2Float( params,3 ); vector V_color = llList2Vector( params,4 ); integer I_glossiness = llList2Integer( params,5 ); integer I_environment = llList2Integer( params,6 ); I_glossiness = new_Gloss; llSetLinkPrimitiveParamsFast( curr_link, [ PRIM_SPECULAR, curr_face, S_texture, V_repeats, V_offsets, F_rotation_in_radians, V_color, I_glossiness, I_environment ]); } } }
  3. mebbe try something like this... integer moveFlag; // global variable timer() { float current_speed; current_speed = llVecMag(llGetVel()); if(current_speed > 1.0 && moveFlag == 0) // fire only once to use looping { llLoopSound("horsegalloping",1.0); moveFlag = 1; } if(current_speed < 2.0 && moveFlag == 1) // fire only once to stop, not every timer pulse { llStopSound(); moveFlag = 0; } }
  4. // god i hate these boards... // @LaurisFashion's code should work fine?... touch_start(integer touchers) { string rezName = llGetLinkName(llDetectedLinkNumber(0)); if(rezName == "box") { llSay(0, "Nothing is here"); } else { if(~llGetInventoryType(rezName)) { llGiveInventory(llDetectedKey(0), rezName); } } }
  5. mebbe something kinda like this? ( change child = 2 to whatever link you are rotating...) integer child = 2; vector vPosTarget; vector pos ; default { state_entry() { } on_rez(integer param) { } touch_start(integer num) { pos = llGetPos(); vPosTarget = llDetectedPos(0); llSetLinkPrimitiveParamsFast( child, [ PRIM_ROT_LOCAL , llRotBetween( <1.0, 0.0, 0.0>, llVecNorm( <vPosTarget.x, vPosTarget.y, pos.z> - pos ) ) ]); } }
  6. Cross origin mebbe? since the site seems to redirect to https://secondlife.com/httprequest/homepage.php do you use llRequestSecureURL( ); for your inworld script?
  7. you could add a glow or fullbright to a face... i think particles only affect the prim as a whole?
  8. There is nothing wrong with my script or yours that i can see, try copying the script and rezzing a new prim to put it in.
  9. Your isday variable is mebbe messin stuff up? dunno... this may work... integer time = 120; //How many seconds between checking Check() { vector sun_dir = llGetSunDirection(); if (sun_dir.z > 0 ) { llSay(0, "It is currently day."); //Do something here for when it is DAY. } else { llSay(0, "It is currently night."); //Do something here for when it is NIGHT. } } default { on_rez(integer start_param) { llResetScript(); } state_entry() { Check(); llSetTimerEvent(time); } touch_start(integer total_number) { Check(); } timer() { Check(); } }
  10. I dunno if this will help ya at all , but just incase... I've been using this for KFM tours for our Burningman events, mebbe something to try? to get the waypoints, I rez a box and put this script in it, then move, rotate and click it.. then I copy the text into my waypoints list and then move to the next waypoint etc... Waypoint finder script default { state_entry() { } touch_start(integer total_number) { vector RC = llGetRegionCorner(); vector mypos = llGetPos(); vector RCregPos = llGetRegionCorner() + mypos; vector vRadBase = llRot2Euler( llGetRot() ); vRadBase *= RAD_TO_DEG; integer Z = (integer)vRadBase.z; llOwnerSay("\n RegionCorner is " + (string)RC + "\nPos is " + (string)mypos ); llOwnerSay("\n \n Waypoint:\n"+ (string)RCregPos + ", < 0.0 , 0.0 , " + (string)Z + " >," ); } } Then i use this script to do the movement... ( i have another script that handles sitting etc) for rotations, i just copy the next waypoint's rotation to the current one? ( makes it rotate in place) i.e. curr waypoint :................................................. <262243.10000, 262133.10000, 23.65183>, < 0.0 , 0.0 , 0 >, curr waypoint with next waypoint's rotation : <262245.10000, 262133.10000, 23.65183>, < 0.0 , 0.0 , -90 >, next waypoint: .................................................<262245.00000, 262125.50000, 23.65183>, < 0.0 , 0.0 , -90 >, Movement Script float Speed = 3.1; // ORIGINAL SPEED 3.1 //#################################################################################################### // DON´T CHANGE ANYTHING BELOW //#################################################################################################### // DATA FOR THE ROUTE A TO B // POSITION ROTATION list Waypoints = [ <262234.10000, 262122.80000, 23.65183>, < 0.0 , 0.0 , 90 >, <262234.10000, 262133.10000, 23.65183>, < 0.0 , 0.0 , 0 >, <262243.10000, 262133.10000, 23.65183>, < 0.0 , 0.0 , 0 >, <262245.20000, 262133.10000, 23.65183>, < 0.0 , 0.0 , -90 >, <262245.00000, 262125.50000, 23.65183>, < 0.0 , 0.0 , -90 >, <262244.40000, 262123.80000, 23.65183>, < 0.0 , 0.0 , -135 >, <262242.70000, 262123.10000, 23.65183>, < 0.0 , 0.0 , 180 >, <262234.10000, 262122.80000, 23.65183>, < 0.0 , 0.0 , 180 >, <262234.10000, 262122.80000, 23.65183>, < 0.0 , 0.0 , 90 > ]; // End //#################################################################################################### // DON´T CHANGE ANYTHING BELOW //#################################################################################################### integer ListLength; integer Start; list Current_route; float Seconds; calculate_tour() { ListLength = llGetListLength(Waypoints); integer Step; float dist; vector v_now = llGetRegionCorner() + llGetPos(); float f_temp = 600; for(Step = 0; Step < ListLength-1; Step = Step+2) { if(llVecDist(v_now, (vector)llList2String(Waypoints,Step)) < f_temp) { f_temp = llVecDist(v_now, (vector)llList2String(Waypoints,Step)); Start = Step; } } if(llList2String(Waypoints,Start+1) == llList2String(Waypoints,Start+3)) Start = Start+2; for(Step = 0; Step < llGetListLength(Waypoints)-1; Step = Step+2) { integer Calc = Start + Step; if(Calc > ListLength-2) Calc = Calc - ListLength; vector v1a;//Position vector v1b = (vector)llList2String(Waypoints,Calc); vector v2a;//Rotation vector v2b = (vector)llList2String(Waypoints,Calc + 1); if(Step == 0) { v1a = llGetRegionCorner() + llGetPos(); v2a = llRot2Euler( llGetRot())* RAD_TO_DEG; } else { integer ido = Calc; if(ido < 0) ido = ido + ListLength; v1a = (vector)llList2String(Waypoints,ido-2); v2a = (vector)llList2String(Waypoints,ido-1); } float distance = llVecDist(v1b, v1a); float seconds = distance / Speed; if(seconds < 0.45) seconds = 0.45; Seconds = Seconds + seconds; vector diff_p = v1b - v1a; vector diff_r = v2b - v2a; Current_route += [diff_p, llEuler2Rot(diff_r* DEG_TO_RAD), seconds]; } Begin(); } Begin() { llSay(0,"\nTour is Departing! \nPlease toggle your AO if sim crossings make you stand\n"); llLoopSound("3573c7a5-5555-65a8-8c1a-63bd1e445a7a",0.1); llSleep( 5 ); Start_driving(); // llSetTimerEvent(0.02); } Start_driving() { llMessageLinked(LINK_SET , 100, "fwd", NULL_KEY); llSetKeyframedMotion(Current_route,[KFM_MODE,KFM_FORWARD]); llSleep(Seconds + 2.0); llSay(0,"\nTour resumes in 2 minutes"); llMessageLinked(LINK_SET , 100, "stopped", NULL_KEY); llSetTimerEvent(0.0); llSleep(BREAK); // llSay(0,"Tour is Departing! \nPlease toggle your AO if sim crossings make you stand"); llResetScript(); // ************* reset this for tour LOOP ************** } float BREAK = 120; // number of minutes to pause at DMV IN SECONDS integer flip = 1; default { on_rez(integer honk) { llResetScript(); } state_entry() { llMessageLinked(LINK_SET , 100, "stopped", NULL_KEY); llSetLinkPrimitiveParamsFast( LINK_ROOT, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX, PRIM_LINK_TARGET, LINK_ALL_CHILDREN, PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_NONE]); llSleep(1); llSetKeyframedMotion([],[KFM_COMMAND,KFM_CMD_STOP]); calculate_tour(); } link_message(integer s_link, integer s_chan, string s_msg, key id) { if(s_chan == 200) { if(s_msg == "start") { Start_driving(); //llSetTimerEvent(0.02); } } } timer() { } }
  11. @arton Rotaru ty it's been a weird day heh, works good with HUD sending uuid now
  12. You could add a product channel offset to help keep all your items on separate channels, and add a lil more security? integer chan_offset = -545; // a unique integer for each hud/product pair? MyOwner = llGetOwner(); MyChannel = 0x80000000 | (integer)("0x"+(string)MyOwner); // the basic owner-key channel hash .. which anyone can get easily? MyChannel += chan_offset; llListen(MyChannel,"",NULL_KEY,""); I can't comment on sending the UUID from a HUD to a prim... I've been trying it in-world, but I'm having trouble getting it to work (grrr) ***For the receiver, i linked 2 boxes, and put this in the root , then i made 2 more boxes for the HUD and when clicking the child on the HUD ( supposed to be the button, it's name is "2" ) it seems to send okay, but i'm not getting the texture ? prolly something easy i am missing the HUD is sending this... 2,4d304955-2b01-c6c6-f545-c1ae1e618288,0 ( link number, texture uuid string, face number ) RECEIVER prim integer chan_offset = -545; integer MyChannel; key MyOwner; integer face; key txtr; integer linkNum; default { state_entry() { MyOwner = llGetOwner(); MyChannel = 0x80000000 | (integer)("0x"+(string)MyOwner); MyChannel += chan_offset; llListen(MyChannel,"",NULL_KEY,""); llOwnerSay("Channel "+(string)MyChannel); llSetLinkTexture( 2, "4d304955-2b01-c6c6-f545-c1ae1e618288" , 2); } changed(integer change) { if (change & CHANGED_OWNER) { llResetScript(); } } listen(integer channel, string name, key id, string msg) { llOwnerSay("IN \n" + msg + "\n"); list my_list = llParseString2List( msg,[" "],[" "]); string tmp = llDumpList2String( my_list, "\n"); llOwnerSay("Dbug \n" + tmp + "\n"); // DISPLAYS .... 2,4d304955-2b01-c6c6-f545-c1ae1e618288,0 linkNum = llList2Integer( my_list, 0); txtr = llList2String( my_list, 1); // txtr = llList2Key( my_list, 1); *** TXTR NOT WORKING face = llList2Integer( my_list, 2); llOwnerSay("got " + "\nName-linkNum: " + (string)linkNum + "\nTxtr: " + (string)txtr + "\nFace: " + (string)face ); llSetLinkPrimitiveParamsFast( linkNum, [ PRIM_TEXTURE, face,txtr, <1.0, 1.0, 0.0>, ZERO_VECTOR, 0.0] ); } }
  13. works for me inworld... are your scripts set to "running" ?
  14. I may be way off here but.... It seems the situation is this, Bob, Ted, and Ann come up to the campfire. Bob clicks the fire and gets perms and is animated. Next Ted clicks it, and the perms are evoked for Bob, and given to Ted, who now gets animated. Lastly Ann clicks the fire and now has the script perms and gets animated. When the script tries to stop Bob's animation, he no longer has the script permissions? Mebbe keeping a list of the avi's currently using the fire & re-requesting perms before stopping the anim would work? Also, i have a blank anim i use sometimes for stopping looping anims.. i think it is from MP? "b43c9176-112c-944f-33fa-da2d275a9acf" ... you play it for a moment and then stop it - no more loop Anyhoo, was just a guess, Did i get close...?
  15. https://community.secondlife.com/forums/forum/312-inworld-employment/
  16. Here is a small omega snippet for the OP to test with, mebbe see if Omega is what they are lookin for? ( this assumes a cylinder, flattened and rotated onto its edge) integer k; float rate = 5.0; // initial spin speed float adj = 0.5; // how much to slow down each timer pulse float rand; default { state_entry() { } touch_start(integer total_number) { if( k = !k) { rand = llFrand(3.0) + 1.0; // random time each spin llSetTimerEvent(0.2); } else // turn off / reset { llSetTimerEvent(0.0); llTargetOmega(ZERO_VECTOR, 0, 0); rate = 5.0; } } timer() { llTargetOmega(<0,0,1>*llGetRot(), rate, 0.5); rate -= adj; // slow down each timer pulse if ( rate <= 0.5) { llSetTimerEvent(0.0); llTargetOmega(ZERO_VECTOR, 0, 0); rate = 5.0; return; } llSetTimerEvent(rand); } }
  17. If you will need to get the specific section each wheel has landed on, mebbe change the number of sections from 32 to 36... so your movement can be in 10 degree intervals?.. if it's all visual, you could just use llTargetOmega ? ... http://wiki.secondlife.com/wiki/LlTargetOmega and change the spinrate in a timer event? a pretty ambitious project for someone who is not a scripter
  18. mebbe for the collisions bit... // global var list added = []; // in the script collision_start(integer num) { key give_to = llDetectedKey( 0 ); if (~llListFindList( added ,[ (string)give_to ])) { return; // they already got one! } added += give_to; // else, add them now llSay(0, "Rezzing HUD for " + llKey2Name(give_to) + " using channel " + (string)channel); llRezObject("phone3", llGetPos(), ZERO_VECTOR, ZERO_ROTATION, channel); llRezObject("ss-hud-01we5", llGetPos(), ZERO_VECTOR, ZERO_ROTATION, channel); llRegionSay(channel, "ATTACH|" + (string)give_to); }
  19. Here is an example of using sun direction to change a texture. This particular snippet will only work during the "day". just rez a box, and drop in the script, then touch the box. The number texture is from LL, you can see how using offsets changes it. the list - "nums" ... is a key / value list, ..."1" has an offset value of -0.45 , etc etc vector repeats = <0.05, 1.0, 0.0>; vector offsets = < -0.45, 0.0, 0.0>; integer face = 0; float set; string numbers_Texture = "a93f7b84-8edf-b465-b3c8-207986881d78"; string transparent_Texture = "5c50e129-0b07-3834-0748-f1df74234a65"; list nums = ["1",-0.45,"2",-0.35,"3",-0.25,"4",-0.15,"5",-0.05,"6",0.05,"7",0.15,"8",0.25,"9",0.35,"0",0.45 ]; default { state_entry() { set = llList2Float(nums,1); llSetLinkPrimitiveParams( LINK_THIS, [ PRIM_TEXTURE,face ,transparent_Texture, repeats, < set, 0.0, 0.0>, 0.0 ]); } touch_start(integer total_number) { vector sun = llGetSunDirection(); integer Z = (integer) llFloor( sun.z * 10); string sunZ = (string)Z; llOwnerSay("Sun z is... " + sunZ); integer index = llListFindList(nums, [sunZ]); integer indx = index + 1; set = llList2Float(nums,indx); llSetLinkPrimitiveParams( LINK_THIS, [ PRIM_TEXTURE, face ,numbers_Texture, repeats, < set, 0.0, 0.0>, 0.0 ]); } }
  20. http://wiki.secondlife.com/wiki/LlGetNotecardLine if it's only 5, and if they never change, just hard code them into yer script mebbe?
  21. example snippet, rez a sphere and drop in, then touch? you can make a variable called "dimple" and do.... vector sun = llGetSunDirection(); if (sun.z < 0) {dimple = night_dimple;} and make the SLPPF call .... [PRIM_TYPE , PRIM_TYPE_SPHERE, PRIM_HOLE_CIRCLE, <0,1,0>, 0.0,<0,0,0>, dimple]); vector night_dimple = <0.88, 1.0, 0.0>; vector day_dimple = <0.98, 1.0, 0.0>; default { state_entry() { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TYPE , PRIM_TYPE_SPHERE, PRIM_HOLE_CIRCLE, <0,1,0>, 0.0,<0,0,0>, day_dimple]); } touch_start(integer total_number) { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TYPE , PRIM_TYPE_SPHERE, PRIM_HOLE_CIRCLE, <0,1,0>, 0.0,<0,0,0>, night_dimple]); } }
  22. something kinda like.... string itemName = llGetInventoryName(INVENTORY_OBJECT, llFloor( llFrand( randomIndex ) ) );
  23. vector sun = llGetSunDirection(); if (sun.z < 0) {// night}
×
×
  • Create New...