Jump to content

Physical object tilts to the side when sat on.


You are about to reply to a thread that has been inactive for 4654 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I recently put together a stretcher/gurney for use in rescue-related RP, but when I sit on it, it immediately lists to the side (not on any particular axis, but rather towards one of the two longer sides.)  I checked to make sure there weren't any invisible prims in the way, and there weren't any.  Forgive me if the answer is obvious, as this is my first major build project.

 

Thanks in advance for your advice.

Link to comment
Share on other sites

I imagine it's physical so that other avs can push it along.  To keep it from tilting to the side, you should include

llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y, FALSE);

in your script, right after you llSetStatus(STATUS_PHYSICS,TRUE) .  Depending on the way the script is written, you may also need to temporarily turn physics off, point the gurney's Z axis straight up, and then turn physics back on again when someone sits (lies) on the gurney.  A user-defined function something like this would work:

level(){    rot = llRot2Euler(llGetRot()) * RAD_TO_DEG;    x = (rot.x < -0.1 || rot.x > 0.1);    y = (rot.y < -0.1 || rot.y > 0.1);    if(x || y)    {        rot.x = 0.0;        rot.y = 0.0;        rot *= DEG_TO_RAD;        llSetStatus(STATUS_PHYSICS, FALSE);        llSetRot(llEuler2Rot(rot));        llSetStatus(STATUS_PHYSICS, TRUE);    }}

 If the gurney becomes very unruly, you could even call that level function from a timer event every few seconds, to keep punching it back to its neutral rotation again.

Link to comment
Share on other sites

That did keep it from rolling, thank you.  But now it does not fall all the way to the groung, rather it hangs just short of what I estimate to be a meter (relative to my avi) off the ground.  I think it may have something to do with the sit script (again, I used the GnF easy sitter) but I havent a clue how do diagnose the specific nature of the problem or how to fix it.

Heres my not-so-educated guess:

When I loaded the pose into the stretcher using the GnF easy sit system, I was told to load the scripts into the stretcher and then rez out an included box.  Once I loaded the pose into said box and sat on it, My avi was seen to be lying down per the pose I inserted, and floating just about the same distance above said box as the stretcher floats above the ground.  Im not sure how that could have affected the process, but I doubt its pure coincidence.  On that note, does anyone know of a sit target tool that would allow me to insert the pose without sending my object skyward?

Thanks very much for the scripting advice, it worked perfectly to keep the stretcher from rolling.

Link to comment
Share on other sites

I'm afraid I am not familiar with the GnF easy sit system.  I always script devices directly with llSitTarget, which is generally a fairly easy thing to do once you know what you're doing.  Start by putting

llSitTarget(<0.0,0.0,0.1>,ZERO_ROTATION);

in your state_entry event.  I assume that your script has a changed event that requests permission to trigger your animation and a run_time_permissions event in which the animation is started with llStartAnimation.  If so, then when you sit on the gurney, you should get a first look at where your av is positioned.  With extraordinary luck, it's exactly the right spot.  It's probably not, though, so you replace the llSitTarget command with

llSitTarget(<x,y,z>, llEuler2Rot(<xrot, yrot, zrot>*DEG_TO_RAD));

where x, y, and z are experimental values of small distances to move your av along the X, Y, and Z axes and xrot, yrot, and zrot are angular rotations (in degrees) around each of the axes.  I suggest experimenting with the angular adjustments, if any, first, and trying 90.0 increments in one of them at a time to get a feel for which way your av moves when you sit on the gurney after each change.  Once you have the rotations down, then do the same thing with the x, y, z offsets.

If you have never done this before, it can be frustrating.  That's what makes those "easy sit" systems popular. Once you have done it a few times, though, you'll get a feel for what needs to be changed and you'll wonder what all the fuss was.

Afterthought: If you are really lucky, the GnF easy sit system has already created a llSitTarget command in your script like the second one I wrote.  If so, that would be a great piece of luck.  Then you won't need to mess with rotations at all.  Just adjust the z parameter to change your height above the gurney.

Link to comment
Share on other sites

I was able to script it, but I think I found the true source of the problem.  When the stretcher is in the up position, it tops out just above my avi's waist height, but when I try to drop it down, it hovers *exactly* at my avi's waist height.  Is it possible that some part of some script or something is under the impression that my legs are still where they would be if I had been standing?

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4654 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...