Jump to content

Emma SecretSpy

Resident
  • Posts

    24
  • Joined

  • Last visited

Everything posted by Emma SecretSpy

  1. Ok, I understand the difference (I ignored it). Thank you very much for your answer, Rolig Edit: and thank you Qwalyphi, for all your precisions!!!!
  2. Hello all, I'm trying to use this example script from the Wiki, with llOverMyLand. // This script will email you a daily count of new visitors and repeat visitors. // Visitors are counted once per email update cycle. // ----------------------------------- // Configuration: customize this script here. // Change this to your email address. string MyEmail = "you@example.com"; // This is a number 0 to 96 meters, anything farther away than that will not be noticed. float SensorRange = 96.0; // How often to send email updates. integer UpdateFrequency = 86400; // Number of seconds in 1 day. // ----------------------------------- // Internal Variables -- Do not change. list todayVisitors = []; list allVisitors = []; list repeatVisitors = []; list firstTimers = []; integer newVisitors = 0; integer returnVisitors = 0; string ParcelName; default { state_entry() { list parcelDetails = llGetParcelDetails(llGetPos(), [PARCEL_DETAILS_NAME]); ParcelName = llList2String(parcelDetails, 0); llSensorRepeat( "", "", AGENT, SensorRange, PI, 20); llSetTimerEvent(UpdateFrequency); // Email me a regular report. llOwnerSay("Visitor Log Started."); } sensor(integer avsFound) { key avKey; integer avNum; for(avNum=0; avNum<avsFound; avNum++) { avKey = llDetectedKey(avNum); if (llOverMyLand(avKey)) { string whom = llDetectedName(avNum); if (!~llListFindList(todayVisitors, [whom])) { // This person hasn't been seen yet today. todayVisitors += [whom]; if (~llListFindList(allVisitors, [whom])) { // This is a returning visitor. returnVisitors++; repeatVisitors += [whom]; } else { // This is a first-time visitor. newVisitors++; allVisitors = [whom] + allVisitors; firstTimers += [whom]; } } } } } timer() { list parcelDetails = llGetParcelDetails(llGetPos(), [PARCEL_DETAILS_NAME]); ParcelName = llList2String(parcelDetails, 0); string subj = "Visitor Log for " + ParcelName; string body = "Number of Visitors Total: " + (string)(newVisitors + returnVisitors) + "\nReturning Visitors: " + (string)returnVisitors + "\nNew Visitors: " + (string)newVisitors + "\n\nList of New Visitors:\n\t" + llDumpList2String(firstTimers, "\n\t") + "\n\nList of Returning Visitors:\n\t" + llDumpList2String(repeatVisitors, "\n\t"); newVisitors = 0; returnVisitors = 0; todayVisitors = []; repeatVisitors = []; firstTimers = []; if (llGetListLength(allVisitors)>500) { allVisitors = llList2List(allVisitors, 0, 499); } llEmail(MyEmail, subj, body); } } It works well when the parcel belongs to an avatar but when it is deeded to a group, i reveive an almost empty message: Object-Name: Object Region: xxxxx Local-Position: (182, 43, 32) Number of visitors total: 0 Returning visitors: 0 New visitors: 0 List of new visitors: List of returning visitors: In the wiki notice, it is said: "On group deeded land the object containing the script must be deeded to the same group. (It is not enough to set the script to the group.)". But I shared my object with the group (= the land's group). Did I miss something (i can't find where I can "set the script to the group" as the wiki says) or is there a bug? Thank you for your answers.
  3. Not so easy to be a beginner in scripting... The script is very simple. It's quite the same as the default script Script with notecard (you have to insert your notecard, with the script, inside the object): default{ state_entry() { llSetText("Click for Info", <1,1,1>, 1.5); } touch_start(integer total_number) {if (llGetInventoryNumber(INVENTORY_NOTECARD) > 0){llGiveInventory(llDetectedKey(0), llGetInventoryName(INVENTORY_NOTECARD, 0));}}} Script saying the link in the local chat: default{ state_entry() { llSetText("Click for Info", <1,1,1>, 1.5); } touch_start(integer total_number) { llSay(0, "Link of my website: http://mysite.com");// Write your website address }}
  4. Wow, thank you very much irihapeti! Because of my real world (+ my little family), I'll be able to make these experimental test and play with your new script only this week-end. But then I tell you all about it, I promise Ok, I was ignoring this question of buffering. PS: I like railway workers, but lifegards and woodcutters too
  5. "think about how to change dir from integer to vector. So that: dir = <1.0,1.0.1.0> .. <-1.0,-1.0,-1.0> where can be any combination of 1 | -1. Example: <1.0, -1.0, 1.0> <1.0, -1.0, -1.0>. turn.x *= dir.x; turn.y *= dir.y; turn.z *= dir.z. You now into a more data-driven approach to the codes rather than a procedural coding approach" Anyway, it's sure I will make experimentations this week-end, playing with your (+ credited ancient Sumerians/Egyptians Greeks^^) code. I need, first, to understand totally your initial script and my head is is a bit flat and limited I am not an Einstein like you^^. For example, your suggestion about changing dir to vector, with positive and negative values, seems very complex for me:/ For now, my train detects, with a sensor, the name of the different tracks and its behaviour will depend on this name. It's ok for the right tracks but with the curved tracks, I'll need to pre-code every trajectory. I would like the script could detect automatically the rotation datas of the root-prim of the track (llDetectedRot), datas that I must write for now "manually" in the script. About reading positions/rotations in a notecard: I tried first to save the datas with a SetKeyFramedMotion script adapted from an old physical "tour" script. My "train" was first moving with the sensor script detecting the tracks, and a second script was memorizing every detected points (with a timer). But since the positions were calculated relatively from a first point, I had always gap issues. And I noticed that the second script, the "reading saved positions" script was as laggy as the first with a "live" detection by sensor. The notecard solution is more stable. The inconvenient with a notecard: if you want to modificate a part of your tour, you have to copy/paste again all the values. And don't you think a decoding notecard script is not laggy?
  6. Dear irihapeti, Many thanks for the script: I've just tested it and it works wonderfully. You are a genious I am very glad because the effect is perfect. Yes, I will reedit my older post and will add the missing information credits. I am an amateur and I ignored the usage. Thank you again for your great help. Take care and good evening
  7. Description: I put the red triangle-root called "right" at the beginning of the curved track. I inclinate it on X=20 (instead of 0). The locomotive (my blue prim) detects the red triangle, reaches it and takes its rotation (X=20, Y=0, Z=0) then follows the curved track (child). Issue: if the rotation of the locomotive is correct (X=20), the locomotive doesn't go up. You can create my curved track with a Cylinder, Size X=10, Y=10, Z=0.5, Path Cut Begin=0, End= 0.250, hollow= 75 This my adaptation of the script for my curve movement: //Based on uuMakeCurve by Kaluura Boa, Miranda Umino integer SensorTargetName;list SensorTargetNames = ["left", "right"];list FrameList;TurningRight(){llSleep(2.0) uuMakeCurve(llGetRot(), -1, 90.0, 3.90, 20.0, 12.0); llSetKeyframedMotion(FrameList, [KFM_MODE, KFM_FORWARD]); llResetScript(); } TurningLeft()llSleep(2.0); uuMakeCurve(llGetRot(), 1, 90.0, 4.350, 20.0, 12.0); llSetKeyframedMotion(FrameList, [KFM_MODE, KFM_FORWARD]); llResetScript(); } uuMakeCurve(rotation rot, integer dir, float angle, float radius, float steps, float time){ // dir: 1 = left, -1 = right // angle: in degrees // time = total time // vector offset = <-radius, 0.0, 0.0> * (llEuler2Rot(<0.0, 0.0, dir * PI_BY_TWO>) * rot); // Offset from relative center of the arc of circle // time = 5.0/45.0; // Time for each step time = 6.0 / llGetRegionFPS(); //angle = (angle * DEG_TO_RAD * dir) / steps; // Arc of circle for each step angle = (angle * DEG_TO_RAD ) * (float)dir / steps; // Arc of circle for each step rot = llEuler2Rot(<0.0, 0.0, angle>); // Relative rotation for each step FrameList = []; integer i = 1; // Don't re-do step 0! for (; i <= (integer)steps; ++i) { // the offset is now defined as the precedent rotated vector vector move = offset ; offset = offset * llEuler2Rot(<0.0, 0.0, angle >) ; move = offset - move; FrameList += [move, rot, time]; } } ObjectDetected(integer index) {vector pos = llDetectedPos(0); rotation rot =llDetectedRot(0); vector offset =<0,0,0>;offset = offset*llDetectedRot(0); pos+=offset; llSetKeyframedMotion( [ pos- llGetPos(), rot / llGetRot(),2], []); if(index == 0) { TurningLeft(); } else if (index ==1) { TurningRight(); } }default{ state_entry() { vector pos = llGetPos(); llSleep(0.1); llSetTimerEvent(0.5); }sensor(integer total_number) { ObjectDetected(SensorTargetName); } timer() { llSensor(llList2String(SensorTargetNames, SensorTargetName = !SensorTargetName), "", ACTIVE | PASSIVE, 10, PI/8); }}
  8. Dear revochen, Thank you very much for your answer. I already use invisible prims for the path. I have one at the very beginning of the curved track, which is detected. In fact, the locomotive is already inclinated by it (but i didn't see it before) but not enough: i mean the locomotive takes the rotation of this prim when it detects it and goes to it but doesn't continue to go upper, following the whole inclinated track. I'll send you pictures later (since I am at the end of my holiday , I need to take a... real train to go back home). Good Dreams^^
  9. Hello all, I hope you will understand my strange english... Well I am using a script, published few years ago in this forum, to make a locomotive turn a 90° corner. Link of he original thread : uuMakeCurve(rotation rot, integer dir, float angle, float radius, float steps, float time) { // dir: 1 = left, -1 = right // angle: in degrees // time = total time // vector offset = <-radius, 0.0, 0.0> * (llEuler2Rot(<0.0, 0.0, dir * PI_BY_TWO>) * rot); // Offset from relative center of the arc of circle time = 10.0/45.0; // Time for each step //angle = (angle * DEG_TO_RAD * dir) / steps; // Arc of circle for each step angle = (angle * DEG_TO_RAD ) * (float)dir / steps; // Arc of circle for each step rot = llEuler2Rot(<0.0, 0.0, angle>); // Relative rotation for each step FrameList = []; integer i = 1; // Don't re-do step 0! for (; i <= (integer)steps; ++i) { // the offset is now defined as the precedent rotated vector vector move = offset ; offset = offset * llEuler2Rot(<0.0, 0.0, angle >) ; move = offset - move; FrameList += [move, rot, time]; } } default { state_entry() { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); } touch_end(integer num) { uuMakeCurve(llGetRot(), 1, 90.0, 10.0, 24.0, 12.0); llSetKeyframedMotion(FrameList, [KFM_MODE, KFM_FORWARD]); } } The script works wonderfully. But it will work well only on a perfectly flat land and the rotation x and y must be = 0. I would like to be able to inclinate the rotation X and Y of my curved track but I don't know what are the datas I must change. Thank you very much for your help. Emma
  10. Thank you Tiffy. Yes, next time, I will copy these datas. I believed it existed a "secret" function in the advanced or developper menu, allowing to see these upload informations. I hope TPV developpers will have this idea. Thanks again for your help Tiffy and Anselm.
  11. It is a good idea, Anselm. Unfortunately, I didn't write it and I made so many uploads, trying all possibilities that, anyway, it would have been very boring. And xml exports are impossible for meshes... Too bad...
  12. Hello all! I'll try to explain my problem with my bad english. Several monthes ago i uploaded several meshes parts in the test grid. I tried to optimize (as I could, trying lots of possibilities) the settings of the Level of details (high - medium, etc.). But now, i would like to upload these meshes in the normal grid. But I can't remember the settings I used. Is there a way to refind these informations with the viewer (sl or tpv)? Indeed I'm loosing many hours because of it... Thank you for your help.
  13. I'm so sad. The mythic Club 6 will end... I went in this club first in 2011. Rock and Tru, the owners, were the most generous people I met in SL.Go there for the last moments, there = the best music club I knew in SL. So many thanks, Tru and Rock. Thank you to all their DJs and dancers who helped me so much Sorry for my bad english... Kisses
  14. Hello Lucinda, Thank you for your suggestions. Anyway I'll test several possibilities, including physical state. I haven't a scientific formation and I 'm just a beginner in scripting. But I learn lots of things here, reading messages like Rolig's ones and trying things. It is not so easy to find LSL documentation or experts in my native language, that is why I came here. "but you are asking them to do a bit more than they normally do here.": I am very conscious of that and grateful for the time they spend here. What Rolig found about rotation normalisation in this discussion is very important and I'm sure it will be useful for everyone. About the dissociation translation/rotation we discussed yesterday: I could make it work using the SensorRepeat for the translation and, independently, a timer, where I put the rotation command.
  15. Lucinda and Rolig, Thanks for the suggestion: it was a good idea, but translation and rotation don't work together ("Cannot use a script to move a linkset while it is playing an animation. Stop the animation first."). Anyway, the following movement (with translation only) is very jerky, this way...
  16. Well, even when the 2 values are identical, translation doesn't work... or I missed something.
  17. Hello Rolig, Thank you for your very fast answer. Well, if the follower reproduces exactly the rotation (with the delay), it doesn't move anymore: translation seems to be broken.
  18. Thank you Rufus (and Rolig again, of course), Yes, the server of the region where I was has been updated and I have had to make the modification. If I hadn't read your message before, I would have understood nothing. May I have another question? Is there a way to dissociate the position and the rotation in the llSetKeyframedMotion command? I mean when the car or engine turns, the caravan turns immediately too and the effect doesn't look so natural. Would it be possible to add a delay of 1 or 2 seconds before the follower rotates, keeping the same value for the position and the offset? 0.111112 for the timer is perfect for the position+offset because of the possible variations of the speed: if I increase the timer and the offset values to obtain a delay for the rotation, I lose precision. Using the Rolig's code, we would have something like (obviously I know it doesn't work this way) : llSetKeyframedMotion([(llDetectedPos(0) - llGetPos()) + <-1.0,0.0,0.2>*llDetectedRot(0), 0.11112],[]);// ANDllSetKeyframedMotion([NormRot(llDetectedRot(0)/llGetRot()),2],[]);
  19. It works perfectly! Thank you so much, Rolig, you are a great scripter. I earned so many things reading your messages on the forum, I have admiration for you.
  20. Dear Rolig, Thank you very much for your suggestion. I tried with 0.10 for the timer and the llSetKeyframedMotion and other values. The error message seems to appear less frequently, but still appears. It seems to appear when there is a rotation of the car (when it turns or goes up/down on the road). Do you think using llSetKeyframedMotion is a good choice? What would be your suggestion to obtain the most acceptable movement for a following object like a caravan? Would you set it as physical? Would you use a sensor instead of a llGetObjectDetails? TY
  21. Hello, Please, excuse my strange english...I'm a beginner in scripting and I use to modify already written scripts, hoping I will be able to learn things this way. Well, I'm trying to make a caravan following a car (this car uses a basic physical car script). I tested several possibilities, adapting the classical "AV follower" script: llSensor, llListen, llGetObjectDetails, physical with llMoveToTarget, "fast" functions, etc. But I couldn't obtain really satisfying results. I tried to adapt the new function llSetKeyframedMotion and I obtained this script: vector offset = < -1.50, 0, 0>; //1.5 meter behind my car center. default { state_entry() { llSleep(0.1); llSetTimerEvent(0.04); } timer() { list det = llGetObjectDetails("my UUID car",[OBJECT_POS,OBJECT_ROT]) //Get position and rotation vector pos = llList2Vector(det,0); rotation rot = (rotation)llList2String(det,1); // Offset relative to the car. vector carOffset = offset * rot; pos +=carOffset; llSetKeyframedMotion([pos - llGetPos(), rot / llGetRot(), 0.1], []); } } It works not so badly. But I obtain this error message: "Error: delta rotation at frame 0 contains a NaN, Inf, or is not a normalized rotation". 1. Is there a way to avoid this script error? 2. The movement of the caravan is nearly correct but it is a bit jerky. Could I add a buffer or something else, and how? Thank you very much for your answers. I learned many things reading your messages in this forum.
  22. Thank you very much Darkie, this is exactly what I didn't know how to write. And I ignored I could use several sensors in several scripts. Many thanks
  23. Hello Darkie, Thank you very much for your message and your script. I had to simplifly my question and the result I would like to obtain is not exactly what I can do with your script (which works perfectly for saying "Hello B or A"). I'm confused because my formulation was not enough precise. I need to be more precise. I 'd like to have 2 different comportments, depending on the 2 detected objects, something like: First Comportment: ObjectDetectedIsA() { llSay(0,"Hello Objet A"); } Second Comportement: ObjectDetectedIsB() { llSay(0,"Hello Objet B"); llSetColor(<0.5, 0.0, 0.0>, ALL_SIDES); }
  24. Sorry for my bad english and I hope my message will be understood. I'm working on a already written script including a sensor. This is the current (and simplified) code: string SensorTargetName = "Object A"; ObjectADetected() { llSay(0,"Hello Objet A"); } default { state_entry() { llSensorRepeat(SensorTargetName, "", ACTIVE | PASSIVE, 10, PI,2); } sensor(integer total_number) { ObjectAdetected(); } } I would like my sensor could detect another object, Object B, having a different reaction (saying "Hello Object B"). I mean, if Object A is in the range, it says "Hello Object A", if Object B is in the range it says: "Hello Object B". How could I rewrite my script? Someone could help me? Many thanks.
×
×
  • Create New...