Jump to content

Xiija

Resident
  • Posts

    912
  • Joined

  • Last visited

Everything posted by Xiija

  1. a snippet that may help? float amt = 90;default{ state_entry() { } touch_start(integer total_number) { llSetLinkPrimitiveParamsFast(1,[PRIM_ROTATION,llGetLocalRot() * llEuler2Rot(<0,0,(amt*=-1)>*DEG_TO_RAD)]); }} this will rotate a linkset back and forth 90 degrees on the z axis, by changing the amt variable and multiplying by -1 you change the direction. ( for 180 ... it may spin it around?)
  2. for hill climbing, try something like this? ( check vehicle's rotation is more than a certain amt, if so , add power) if( level & CONTROL_FWD ) { vector vRot = llRot2Euler( llGetRot() ); float hill = -vRot.y * RAD_TO_DEG; if(hill > 15) llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <forward_power + 20,0,0> ); else llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <forward_power ,0,0> ); } ( not sure if you need to check rotation in a timer, or if you can do it in control)
  3. here is a snippet to rotate a link on the y axis, it looks for a link named "dw" and only rotates the first one found... you can change axis, rotate all drive wheels in a list etc, or you could use target omega, or rotate a texture on a mesh face... not sure which you are doing integer k;list drivewheels;string temp;integer link;default{ state_entry() { integer prims = llGetNumberOfPrims(); integer n= 1; for(;n <= prims; ++n) { if (llGetLinkName(n) == "dw") { drivewheels += [n] ; } } link = llList2Integer(drivewheels,0); } touch_start(integer total_number) { if(k = !k) llSetTimerEvent(0.0625); else llSetTimerEvent(0.0); } timer() { list params = llGetLinkPrimitiveParams(link ,[PRIM_ROT_LOCAL]); rotation wheelRot = llList2Rot(params,0); rotation r = wheelRot*llEuler2Rot(<0, 45, 0>*DEG_TO_RAD); llSetLinkPrimitiveParamsFast(link, [ PRIM_ROT_LOCAL,r ]); }}
  4. try something like this?.. not sure if it's what you want, but you can look at the script and see how it works, and mess with settings ? integer amt = 1;float x; integer k; default{ state_entry() { llSetLinkPrimitiveParamsFast(LINK_THIS, [ PRIM_GLOW, ALL_SIDES,1.0, PRIM_COLOR, ALL_SIDES, <1.0, 1.0, 1.0>, 1.0]); } touch_start(integer total_number) { if(k = !k) llSetTimerEvent(0.05); else llSetTimerEvent(0.0); } timer() { if( llGetAlpha(ALL_SIDES) >= 1.0 || llGetAlpha(ALL_SIDES) <= 0.0 ) { amt = -amt; } x += -0.01 * amt; llSetLinkPrimitiveParamsFast(LINK_THIS, [ PRIM_GLOW, ALL_SIDES,x, PRIM_COLOR, ALL_SIDES, <1.0, 1.0, 1.0>, x]); }}
  5. this will give the owner the lock option ... and display lock status in the dialog? list list_one = ["POP","Push","Rub","Glomp","Inflate"];list list_two = ["POP","Push","Rub","Glomp","Inflate"," ","lock","unlock"];string owner;integer lock = FALSE;integer listn;integer rand;integer chan; // moved to global float FloatValue; integer IntValue; string StringValue; string bubbleState = "Unlocked";default{ attach(key n) { llResetScript(); } on_rez(integer n) { llResetScript(); } state_entry() { llRequestPermissions(llGetOwner(),PERMISSION_ATTACH); chan = 100 + (integer)llFrand(20000); owner = llKey2Name(llGetOwner()); llListen(chan,"","",""); } touch_start(integer total_number) { key dk = llDetectedKey(0); if(dk == llGetOwner()) { llDialog(dk,"Owner Menu\n \nBubble is " + bubbleState,list_two,chan); } else { if(lock) llInstantMessage(dk,"This Bubble is locked >.>"); else llDialog(dk,"What u want to do with "+owner+"'s Bubble",list_one,chan); } } listen(integer c, string n, key i, string m){ if(m == "lock") { bubbleState = "Locked"; lock = TRUE; llOwnerSay("Locked"); } if(m == "unlock") { bubbleState = "Unlocked"; lock = FALSE; llOwnerSay("Unlocked"); } if(m == "POP") { FloatValue = llFrand(3); IntValue = llRound(FloatValue); StringValue = (string)IntValue; // { if(IntValue == 2) { llTriggerSound("84cb8b4f-29b4-4062-ba7c-d36598a96314",1); llDetachFromAvatar( ); llSay(0," "+n +" Managed to Pop your Bubble Q.Q "); } else { llSay(0," "+n + " did not manage to pop their Bubble "); } } // end pop here if(m == "Push") { llSay(0," "+n +" pushes your bubble out of their way!"); } if(m == "Rub") { llTriggerSound("a9da4612-5d4b-662a-050a-c821c394991f",1); llSay(0," "+n +" walks up and rubs your Bubble causing it to squeek."); } if(m == "Glomp") { FloatValue = llFrand(3); IntValue = llRound(FloatValue); StringValue = (string)IntValue; // { if(IntValue == 2) { llTriggerSound("84cb8b4f-29b4-4062-ba7c-d36598a96314",1); llDetachFromAvatar( ); llSay(0," "+n +" rushes in with a flying Glomp attack hug popping your Bubble and pinning you to the ground >///< "); } else { llTriggerSound("4f9ad2c7-9e23-8257-c017-a44dd7e95153",1); llSay(0," "+n + " fails to get up enough speed to Glomp you and bounces off your Bubble and face plants onto the ground."); } } // end glomp here if(m == "Inflate") { FloatValue = llFrand(3); IntValue = llRound(FloatValue); StringValue = (string)IntValue; // { if(IntValue == 2) { llTriggerSound("84cb8b4f-29b4-4062-ba7c-d36598a96314",1); llDetachFromAvatar( ); llSay(0," "+n +" sticks their mouth to your Bubble and starts to blow more air into your Bubble until it Pops "); } else { llTriggerSound("6c33db4b-7a59-9974-d07a-1f114c87bbd4",1); llSay(0," "+n + " Blows deep breaths into your Bubble but soon becomes light headed and blacks out"); } } // end inflate here }}
  6. try this and compare to your code ... ( changed a few things) this will still only work with owner, you have to change the code if(dk == llGetOwner() ) to give the locking option to only the owner, and all others to use only if unlocked ... list list_one = ["POP","Push","Rub","Glomp","Inflate"];string owner;integer lock = FALSE;integer listn;integer rand;integer chan; // moved to global float FloatValue; integer IntValue; string StringValue; default{ attach(key n) { llResetScript(); } on_rez(integer n) { llResetScript(); } state_entry() { llRequestPermissions(llGetOwner(),PERMISSION_ATTACH); chan = 100 + (integer)llFrand(20000); owner = llKey2Name(llGetOwner()); llListen(chan,"","",""); } touch_start(integer total_number) { key dk = llDetectedKey(0); if(dk == llGetOwner()) { if(lock) llDialog(dk,"Change Bubble option,",["lock","unlock"],chan); else llDialog(dk,"What u want to do with "+owner+"'s Bubble",list_one,chan); } else { llInstantMessage(dk,"This Bubble is locked >.>"); } } listen(integer c, string n, key i, string m){ if(m == "lock") { lock = TRUE; llOwnerSay("Locked"); } if(m == "unlock") { lock = FALSE; llOwnerSay("Unlocked"); } if(m == "POP") { FloatValue = llFrand(3); IntValue = llRound(FloatValue); StringValue = (string)IntValue; // { if(IntValue == 2) { llTriggerSound("84cb8b4f-29b4-4062-ba7c-d36598a96314",1); llDetachFromAvatar( ); llSay(0," "+n +" Managed to Pop your Bubble Q.Q "); } else { llSay(0," "+n + " did not manage to pop their Bubble "); } } // end pop here if(m == "Push") { llSay(0," "+n +" pushes your bubble out of their way!"); } if(m == "Rub") { llTriggerSound("a9da4612-5d4b-662a-050a-c821c394991f",1); llSay(0," "+n +" walks up and rubs your Bubble causing it to squeek."); } if(m == "Glomp") { FloatValue = llFrand(3); IntValue = llRound(FloatValue); StringValue = (string)IntValue; // { if(IntValue == 2) { llTriggerSound("84cb8b4f-29b4-4062-ba7c-d36598a96314",1); llDetachFromAvatar( ); llSay(0," "+n +" rushes in with a flying Glomp attack hug popping your Bubble and pinning you to the ground >///< "); } else { llTriggerSound("4f9ad2c7-9e23-8257-c017-a44dd7e95153",1); llSay(0," "+n + " fails to get up enough speed to Glomp you and bounces off your Bubble and face plants onto the ground."); } } // end glomp here if(m == "Inflate") { FloatValue = llFrand(3); IntValue = llRound(FloatValue); StringValue = (string)IntValue; // { if(IntValue == 2) { llTriggerSound("84cb8b4f-29b4-4062-ba7c-d36598a96314",1); llDetachFromAvatar( ); llSay(0," "+n +" sticks their mouth to your Bubble and starts to blow more air into your Bubble until it Pops "); } else { llTriggerSound("6c33db4b-7a59-9974-d07a-1f114c87bbd4",1); llSay(0," "+n + " Blows deep breaths into your Bubble but soon becomes light headed and blacks out"); } } // end inflate here }}
  7. depending on what text you want to see, ( numbers, bar, etc) you would need a list. Ex: list Charsetz = [" ","▏","▎","▍","▌","▋","▊","▉","█","█"]; list Charsetx = [" ","█","█","█","█","█","█","█","█","█ - Max!"]; then you would need to increment an integer and change the text something like ... loading = loading + num; place = llFloor(loading / 2); zList = llList2List(Charsetx,0,place); pList = llDumpList2String(zList,"" ); llSetText("Progress: " + pList, <1.0, 1.0, 1.0>, 1.0); mebbe in a timer event?
  8. for this particlular movie you would do something like this ( assumes the face is 2) ** youtube and other sites would require a different llScaleTexture size. _________________________________________ integer face = 2; string url = "https://www.youtube-nocookie.com/embed/fSQp67o_HG8?rel=0&controls=0&showinfo=0&autoplay=1"; default { state_entry() { llScaleTexture(1.0, 0.4, face); llSetPrimMediaParams(face,[ PRIM_MEDIA_AUTO_PLAY,TRUE, PRIM_MEDIA_CURRENT_URL,url ] ); } } _____________________________________________ you could use a linked prim to control the on / off (owner only with lGetOwner() & llDetectedKey(0) ) and use linked messages instead of just starting it in state entry. for a linked prim you would use.. llSetLinkMedia( linkNum,face,[ PRIM_MEDIA_AUTO_PLAY,TRUE, PRIM_MEDIA_CURRENT_URL,url ] ); .depending on which prim is root etc..
  9. Some Burners put their heads together and came up with this fun, first-ever racing event on the virtual playa! Visit the playa and see what they've been up to! Join in the fun - build an artcar to race, or rez one and practice a few laps round the track. Get ready for the big race on Saturday the 9th of May.12 NOON SLT and get in the spirit of it all. Race is at 12PM noon, but the Center Camp ArtCar show goes on all day, and building can be done in the sandbox . http://maps.secondlife.com/secondlife/Burning%20Man-%20Deep%20Hole/169/125/24 ( ArtCars Only please) This event is a creation of the Artcar Preservation Association (APA) in conjunction with BURN2.
  10. Some Burners put their heads together and came up with this fun, first-ever racing event on the virtual playa! Visit the playa and see what they've been up to! Join in the fun - build an artcar to race, or rez one and practice a few laps round the track. Get ready for the big race on Saturday the 9th of May.12 NOON SLT and get in the spirit of it all. Race is at 12PM noon, but the Center Camp ArtCar show goes on all day, and building can be done in the sandbox . http://maps.secondlife.com/secondlife/Burning%20Man-%20Deep%20Hole/169/125/24 ( ArtCars Only please) This event is a creation of the Artcar Preservation Association (APA) in conjunction with BURN2.
  11. some ideas... try RegionSay on a negative channel instead of Say on Local? http://wiki.secondlife.com/wiki/LlRegionSay if the HUD and sail both know the channel, it's unlikely any other obj or avi will. llRegionSay(-25431,"texture mainsail," + (string)llGetowner() ); and in the obj listen, filter for that channel & parse the message?
  12. If your first sound is 9.9 seconds, and you want to play the whole thing, you will also need a counter variable , and increment it for 10 seconds before you switch to the looped sound?
  13. try something like this in a hud in the control event....? if(level & CONTROL_FWD) { if(llGetAgentInfo(llGetOwner()) & AGENT_WALKING) {llApplyImpulse(<-1, 0, 0>,TRUE);} }
  14. Practical: pay rent on a 512 for 7 years for fun: Buy hair, mesh clothes and tip DJ's! ( and donate to worthy causes)
  15. link_message( integer sibling, integer num, string mesg, key target_key ) { if ( mesg != CONTROLLER_ID ) { // this message isn't for me. Bail out. return; } else if ( num == 0 ) { // Message says to turn particles OFF: llParticleSystem( [ ] ); llSetTimerEvent(0.0); } else if ( num == 1 ) { // Message says to turn particles ON: llParticleSystem( particle_parameters + target_parameters ); llSetTimerEvent(5.0); } else if ( num == 2 ) { // Turn on, and remember and use the key sent us as a target: target_parameters = [ PSYS_SRC_TARGET_KEY, target_key ]; llParticleSystem( particle_parameters + target_parameters ); } else { // bad instruction number // do nothing. } } ETA Rolig is Fast
  16. to change them over time you need, a timer.. and a list of texture keys or a number of textures in the prim's inventory. here is an example using a list of keys... list particle_parameters=[]; doParticles() { particle_parameters = [ PSYS_PART_FLAGS,( 0 |PSYS_PART_INTERP_SCALE_MASK |PSYS_PART_BOUNCE_MASK |PSYS_PART_EMISSIVE_MASK ), PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE , PSYS_PART_START_ALPHA,1, PSYS_PART_END_ALPHA,1, PSYS_PART_START_COLOR,<1,1,1> , PSYS_PART_END_COLOR,<1,1,1> , PSYS_PART_START_SCALE,<0.28125,0.28125,0>, PSYS_PART_END_SCALE,<4,4,0>, PSYS_PART_MAX_AGE,5, PSYS_SRC_MAX_AGE,0, PSYS_SRC_ACCEL,<0,0,0>, PSYS_SRC_BURST_PART_COUNT,1, PSYS_SRC_BURST_RADIUS,9.89844, PSYS_SRC_BURST_RATE,1.09766, PSYS_SRC_BURST_SPEED_MIN,0, PSYS_SRC_BURST_SPEED_MAX,0, PSYS_SRC_ANGLE_BEGIN,1, PSYS_SRC_ANGLE_END,0, PSYS_SRC_OMEGA,<0,1,1>, PSYS_SRC_TEXTURE, (key) txtr ]; llParticleSystem( particle_parameters ); } list textures = [ "18cfbfd6-ad39-11d5-9d21-00d0b7c730a8", "0444bf21-f77e-7f63-89e9-b839ec66bc15", "22aca67a-946a-fae7-448c-8da90265b34a", "fd459ac9-536b-a563-a12d-d0e9053f9e84"]; integer length; integer index; key txtr; default { state_entry() { llSetTimerEvent(5.0); length = llGetListLength(textures); llParticleSystem( [] ); } timer() { llParticleSystem( [] ); txtr = llList2Key( textures,index ); doParticles(); index = ++index%length; } }
  17. not sure if this helps, but... this will give a kinda smooth child rotation in a 0.02 second timer... ( rotating child prim ....#3, root is #1) timer() { vector rotationAngle = <0, 0.03, 0> ; list params = llGetLinkPrimitiveParams(3,[PRIM_ROT_LOCAL]); rotation childRot = llList2Rot(params,0); llSetLinkPrimitiveParamsFast(3, [ PRIM_ROT_LOCAL, childRot * llEuler2Rot(rotationAngle) ]); }
  18. if the anim script does target omega or texture anim, ... those are prim properties , and will continue to work if the script is removed?
  19. personally i think states are best avoided use flags? i.e. your sensor detects an Avatar.... integer inRange; // used as a boolean flag state_entry() { llSensorRepeat("", "", AGENT_BY_LEGACY_NAME, 10.0, PI, 30.0); } sensor(integer num_detected) { inRange = TRUE; } no_sensor() { inRange = FALSE; } timer() { if( inRange) // if the flag is TRUE { // start slideshow } } __________________________ if you need multiple timers, have the timer set to 1 second, and use counters for each event you need. ex: one timer needs to fire every 30 seconds, one needs to fire every 5 seconds integer 30SecTimer; integer 5SecTimer; ++30SecTimer; // will add 1 to this counter every second, when it hits 30, do your 30 second event and reset it to zero
  20. few changes mebbe? key owner; string data; string info; integer i; integer LH; integer Core; DoStuff(string page) { if(page == "_Main_") { llSay(0, "This is the main"); llMessageLinked(LINK_SET,123,"♠ExampleSelected♠",llGetOwner()); } if(page == "_LeftPage_") { llSay(0, "This is the Left Page"); llMessageLinked(LINK_SET,123,"♠LeftSelected♠",llGetOwner()); } if(page == "_RightPage_") { llSay(0, "This is the Right Page"); llMessageLinked(LINK_SET,123,"♠RightSelected♠",llGetOwner()); } } default { state_entry() { owner = llGetOwner(); Core = llRound(llFrand(10000000)) + 10; LH = llListen(Core, "",owner,""); llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS); llSetTimerEvent(.01); } run_time_permissions(integer perms) { llTakeControls(CONTROL_FWD,TRUE,TRUE); } attach(key attached){ if(attached == llGetOwner()) { llResetScript(); }} changed(integer ch) { if(ch & CHANGED_INVENTORY) { llResetScript(); }} touch_start(integer b) { integer num = llDetectedLinkNumber(0); string comp = llGetLinkName(num); DoStuff(comp); } timer() { if(llGetFreeMemory() < 100){ llInstantMessage(llGetOwner(), "/me is running low on available memory, script is resetting in 5 seconds."); llSleep(5); llResetScript(); }}}
  21. in your hud: list Testing = ["Material1","Material2","Material3"]; string Material; init() { llListen(-333,"","",""); // dialog channel } default { state_entry() { init(); } on_rez(integer param) { init(); } touch_start(integer num) { llDialog(llGetOwner(), "\nChose a Material", Testing , -333); } listen(integer channel, string name, key id, string message) { if( Material = llList2String( Testing, llListFindList(Testing,[message]) ) ) { llRegionSay(-222,Material); } } } in your object that is going to be textured: init() { llListen(-222,"","",""); // listen to incomming regionsay channel } default { state_entry() { init(); } on_rez(integer param) { init(); } listen(integer channel, string name, key id, string message) { llMessageLinked(LINK_SET,123, message, llGetOwner()); } link_message(integer sender_num, integer num, string msg, key id) { llSetLinkTexture(LINK_SET,msg, ALL_SIDES); } }
  22. you can do a regionsay and have your listen obj... listen on a seperate channel? not exactly sure what you mean
  23. you can assign a string to it like so.... list Testing = ["Material1","Material2","Material3"]; string Material;init(){ llListen(0,"","",""); }default{ state_entry() { init(); } on_rez(integer param) { init(); } listen(integer channel, string name, key id, string message) { if( Material = llList2String( Testing, llListFindList(Testing,[message]) ) ) { //Material is now set to the message } }}
  24. Rolig's link is broken for me? think she was trying to post this one? https://community.secondlife.com/t5/LSL-Library/For-Parcel-Owners-Display-Parcel-Prim-Ownership/m-p/827525/highlight/true#M153
  25. you could try keyframes, as the target omega is a viewer-side effect and may act funny.. http://wiki.secondlife.com/wiki/LlSetKeyframedMotion
×
×
  • Create New...