# FreeWee Ling

Resident

10

1. ## Help with rezzing an object in the same position relative to its rezzer even if the rezzer is moved

Thank you Qie. Exactly right. Rollig misunderstood. Your solution seems to be exactly what was needed. My grasp of the use of * and / in rotations is marginal at best. In normal math, order matters in division, but not in multiplication. So the reason this example is non-commutative is because it was applying the rezzer's rotation first, and then the offset. Which results in a different rotation than if the rezzed object was givern the offset rotation first and then brought into alignment with the rezzer. Sheesh.. This also explains why some of the solutions above include " * llGetRot()" in the position vector. I've learned something important here. Thanks very much!
2. ## Help with rezzing an object in the same position relative to its rezzer even if the rezzer is moved

OK, I don't know why this is so difficult. I've been working with rotations for over 9 years and I still can't wrap my brain around them. I have a rezzer that simply needs to rez an object in the same orientation relative to the rezzer, no matter what direction the rezzer is pointed. In my case in needs to be <0,90,90> degrees relative to a ZERO_ROTATION rezzer. What I have is this: llRezObject(obj, llGetPos()+<0,0,0.8>*llGetRot(), ZERO_VECTOR,llGetRot()* llEuler2Rot(<0,90,90>* DEG_TO_RAD),0 ); It works fine with no rotation in the rezzer. When the rezzer is rotated 90 degrees on its Z axis the object rezzes with a rotation of <0,90,180> when it should read <270,0,180> as it does when I manually turn it left 90 degrees. It has rotated around its own local Z axis instead of the rezzer's Z. What am I doing wrong??
3. ## Permission to edit friend's objects breaks when moved across sim boundary

I work with a colleague on a multi-sim platform where we exhibit artworks. The objects are submitted to a dropbox and are takien into my colleague's inventory. He then rezzes the objects onto the floor of a gallery platform where I then arrange the things. We each have perms to edit the other's objects. This has all worked just fine for the last 5 years, but the problem comes when moving objects to a platform on an adjacent sim -- basically just dragging them from one side of the gallery to the other on the same level. When that happens, my perms to edit the objects that have been dragged disappear. It doesn't matter if he does the dragging or if I do. I can drag it to the next sim, but as soon as I stop moving the object freezes and I can no longer edit it. My colleague (as the owner) can still move it. but my abitity to edit his object is permanently broken. Some objects are full perm, some no perm, but that doesn't seem to matter. There is no issue with group perms on the land. I have full estate manager perms on both sims and they are set to the same group. It is generally preferable to drag-move the objects rather than having him take them back into inventory and re-rezzing them, as many of them are large and/or coalesced. Moving them is often a delicate operation in any case. This problem has not always been the case. We have many items on the adjacent sim that were dragged there, either by me or by him. But this problem has arisen at least a year or two ago. May coincide with the introduction of mesh, but that's speculation. Doesn't seem like it's been that long, but could be. So my question is: why do the edit-friend's-objects perms break when the object is moved? And do we just have to live with it? Thanks for any insight.
4. ## Stopping a while-loop within a run_time event

That fixed it. I think you're correct that it compares keys as strings, so there's no error, when using if (change & CHANGED_LINK) {if (avatar != "") even if avatar is defined as a key variable. But the CHANGED_LINK needs a key to know if it's no longer linked. So this works perfectly: if (change & CHANGED_LINK) {if (avatar != NULL_KEY) Thanks very much for your help. I learned something.
5. ## Stopping a while-loop within a run_time event

Rats. It's back to continuously looping again, even with the timer. Not sure what I did to break it. OK, here's the entire script. drop it into a prim with any pose animation, sit, then stand. Tell me why it isn't resetting the timer on stand. --- string animation; string avatar; vector camera_position; vector pos; rotation rot; float i; float circle; //Cam Params spin_cam() { llSetCameraParams([ CAMERA_ACTIVE, 1, CAMERA_BEHINDNESS_ANGLE, 180.0, CAMERA_BEHINDNESS_LAG, 0.5, CAMERA_DISTANCE, 8.0, CAMERA_FOCUS, pos, CAMERA_FOCUS_LAG, 0.5 , CAMERA_FOCUS_LOCKED, FALSE, CAMERA_FOCUS_THRESHOLD, 0.0, CAMERA_PITCH, 00.0, //CAMERA_POSITION, <0.0,0.0,0.0>, CAMERA_POSITION_LAG, 0.0, CAMERA_POSITION_LOCKED, FALSE, CAMERA_POSITION_THRESHOLD, 0.0, CAMERA_FOCUS_OFFSET, <0.0,0.0,0.0> ]); } //ANIM PARAMS //Offset Position vector offset = < 0.0, 0.0 ,1.0>; //Degrees Rotation vector deg = <0,0,0>; //Pie Option Text string text = "Sit"; default { state_entry(){ llSetTimerEvent(0);//Added this to stop timer on reset //Sit Params animation=llGetInventoryName(INVENTORY_ANIMATION,0); llSetSitText(text); deg *= DEG_TO_RAD; rotation quat = llEuler2Rot( deg ); llSitTarget(offset, quat); //Variables for Cam pos=llGetPos(); rot=ZERO_ROTATION; circle=TWO_PI; } //ON SIT changed(integer change) { if (change & CHANGED_LINK) {avatar=llAvatarOnSitTarget(); if (avatar) {// llOwnerSay((string)avatar);//DEBUG llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION | PERMISSION_CONTROL_CAMERA); } //THEORETICALLY THE FOLLOWING SHOULD STOP EVERYTHING AND RELEASE ALL PERMS WHEN YOU STAND: else{ //llOwnerSay("STOP");//DEBUG llSetTimerEvent(0); llResetScript(); } } } run_time_permissions(integer perm) { if (perm & (PERMISSION_TRIGGER_ANIMATION | PERMISSION_CONTROL_CAMERA)) { llStopAnimation("sit"); llStartAnimation(animation); spin_cam(); //Init Cam Params llSetTimerEvent(0.1); }//end if } //end run time timer(){ i+=.05; //Increments in the position if (i>circle){i=0;}//reset after one revolution llOwnerSay((string)i); //(DEBUG) camera_position = llGetPos() + <-12.0, 0.0, -0.0> * llEuler2Rot(<0.0, 0.0, i>); llSetCameraParams([CAMERA_POSITION, camera_position]); } }
6. ## Stopping a while-loop within a run_time event

Hah -- You are correct, of course. It is a for-loop. I'm not sure it matters in this case. I did try usomg a variation of your llAvatarOnSitTarget() test, but is didn't seem to make a difference. The current timer solution I'm using is pretty low lag considering how often it runs (llSetTimerEvent(0.05)). I'd prefer to avoid adding conditions to the loop. Anyway I think it's working well enough for my purposes. Thanks for your help.
7. ## Stopping a while-loop within a run_time event

That's kind of my point. I stand, permissions are revoked automatically, but the loop or timer event is still processing. The stand per se seems to not stop all script functions immediately, which is what I want. I had a llResetScript on the changed-link-else statement, but it didn't seem to stop the while-loop at all. I will try using the clear statements. Using the timer() event is much better than the While loop. Thanks much for the help
8. ## Stopping a while-loop within a run_time event

This is progress. I thought of that, but how to run a timer event with a function that requires run_time_permissions? I just made the timer change and it works, but still gives me an error when I stand: Script trying to set camera parameters but PERMISSION_CONTROL_CAMERA permission not set! The subroutine I'm running uses llSetCameraParams which requires the PERMISSION_CONTROL_CAMERA permission to run.It works under a timer event, but gives me the same error when I stand. It's better. Only gives me one error instead of 9 and the process does stop.And it doesn't ALWAYS give an error. Throttling the speed seems to help. I suspect I'm standing in the middle of a process when I get the error. Thanks for the suggestion.
9. ## Stopping a while-loop within a run_time event

I have a sit script that controls the camera position and rotation by relocating it incrementally using a while-loop. There are about 125 loops total, taking about 12 seconds to complete the full sequence. It works perfectly unless the avatar stands before the full number of loops is completed. Disregarding the camera control, the central issue is that a loop that is activated on sit continues to run when the avatar stands. With the cam control under run_time, this sends a bunch of runtime errors. (Removing the cam control and adding an OwnerSay debuger, it clearly demonstrates that the loop continues to run after the avatar stands and I don't see a way to stop it.) The only way for the script to know the avatar has stood is by CHANGED_LINK, but that's in a previous scope and isn't testing for it while the loop is happening in run_time. I would actually prefer to have an infinite loop as long as the avatar is sitting. But it needs to stop when they stand. There is probably a better way to do this. Any ideas? Here's the relevant run_time event: ---- run_time_permissions(integer perm) { if (perm & (PERMISSION_TRIGGER_ANIMATION | PERMISSION_CONTROL_CAMERA)) { llStopAnimation("sit"); llStartAnimation(animation); spin_cam(); //Set Cam Params float circle=1.0*TWO_PI; //Runs the cam 1.0 revolutions around subject float i=0; //Cam Loop -- How to escape? for (i=0; i< circle; i+=.05) //Sets the size of the increment, Smaller nunber=more/smoother loops and slower motion { // llOwnerSay((string)i); //(DEBUG) camera_position = llGetPos() + <-12.0, 0.0, -0.0> * llEuler2Rot(<0.0, 0.0, i>); //calculate next llSetCameraParams([CAMERA_POSITION, camera_position]); llSleep(0.1); //Delay to slow loop }//end loop }//end if }//end run_time
×
×
• Create New...