Change font size
It is currently Sat Dec 15, 2018 12:57 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 2   [ 16 posts ]
Go to page 1, 2  Next
Author Message
 Post subject: !! Vehicles in OS - Resource /Reference information
PostPosted: Thu May 14, 2009 3:35 pm 
OSG Elite
User avatar

Joined: Wed Mar 11, 2009 3:57 pm
Posts: 444
Hello there everyone.

There has been a great deal of discussion on vehicle Scripts in OpenSim environments. This is not the LL Environment and so their scripts DO NOT WORK !!! This is an ongoing project and people are working on it to try and develop something that does indeed with with OpenSim Physics and the scripting systems here.

ckrinke of OSG is quite knowledgeable on the subject and Nebadon has submitted a VERY ROUGH moving vehicle. (CAUTION IT"S NASTY) !!! You have been warned. It has the potential of gnarling up a region, so best to not play with Vehicle Physics unless you own an Isolated region and are in control of the server. Nebadons Script is here: http://osgrid.org/forums/viewtopic.php?f=5&t=1223

[SECTION DELETED]


VERY IMPORTANT NOTE
If you want to play with Vehicles and these Scripts for testing, I URGE YOU to Build a Test Platform! (The Big Box)
Why ? Because these things fly off in Wild Directions and do the darndest things. They can make the Physics Engine go NUTS on the server.
They have crashed my server more than once... U do NOT want to do that !
A Good Build Platform is Minimum 100mX100m square. Make Walls surrounding it completely up to 50m High (Leave a little doorway to get in & out) ;)
Put a ROOF ON IT !!!! Ive had errant vehicle go 74,000m UP ! Guess what, U can't get there from here ! so it will make you & the server NUTS!
After Several Crashes, I have a Test Region setup with a 200x200x50 Box as a safety net to catch the things!

Resources on Vehicle Scripts:
http://rpgstats.com/wiki/index.php?title=TutorialVehicle#Tutorials:_Vehicles Very Good Tutorial & explanations of everything related to Vehicle Scripts


Non-Physical "Mover Script" below.
This is ugly and won't make a vehicle but for reference for moving without vehicle physics, it's a good experiment.
Note the date of it.... 2003/2004 SL, so you know it's old by current standards.
{L_CODE}:
//Redesign of the Moving Ship Script (also by Derek Jones)
//Script to move non-physical objects via control inputs
//Original Script created by Derek Jones on 08/05/03
//Variations by Jericho Powers, Christopher Omega and Nick Fairlight
//Newly Modified Version created 6/24/04
//Say "Engage" to start the script, "Disengage" to stop, and click the object for control. Say "stop" to stop all movement.
//Some code has been edited out for the open source release, including speed, which was controlled by other objects in my custom ship
//To use, drop on any object, preferably one with no rotation for best effect.

rotation grot; //The current Rot
rotation gtarrot; //Destination rot (steps)
vector gcurpos; //Current position
vector gtopos; //Target position
vector increment = <1, 0, 0>; //Forward steps per interval
vector increment2 = <0, 0, 1>; //Steps for vertical movement per interval
float interval = 0.1; //Time between steps
key gowner; //Key of pilot (used for recodnizing the owner from another)
string copilot; //Name of co-pilot
vector currentpos; //Vector currently located
vector setposz; //Vertical increment going up
vector setposaz; //Vertical increment going down
string speed; //The Speed Setting
integer LEVELS = 0; //Levels (duh lol)
default
{
    state_entry()
    {

        gowner=llGetOwner();//gowner is default as the owner.
        copilot = ""; //Fill the name of the co-pilot
        //llMessageLinked(LINK_SET, 0, speed, "a");
        state enginesoff;
    }
}
state enginesoff
{
    state_entry()
    {
        llReleaseControls();
        llSay(0, "Engines offline.");
        llListen(0, "", gowner, "");
        llListen(0, copilot, "", "");
    }
    listen(integer channel, string name, key id, string message)
    {
        if(message=="Engage")
        {
            llSay(0, "Script engaging...");
            state engineson;
        }
    }
}
state engineson
{
    state_entry()
    {
        LEVELS = CONTROL_FWD | CONTROL_BACK   | CONTROL_UP | CONTROL_DOWN | CONTROL_LEFT | CONTROL_RIGHT;
        speed = "Default Speed: No Control";
        llSay(0, "Script on and idle");
        //llSay(0, "Speed set to "+speed);
        llListen(0, "", gowner, "");
        llListen(0, copilot, "", "");

    }

    touch_start(integer total)
    {
        if((llDetectedKey(0)==gowner))
        {

            integer Perm = llGetPermissions();
            if (Perm)
            {
                llReleaseControls();
            }
            else
            {
                llRequestPermissions(llDetectedKey(0), PERMISSION_TAKE_CONTROLS);
            }
            if((llKey2Name(llDetectedKey(0))==copilot))
            {

                Perm = llGetPermissions();
                if (Perm)
                {
                    llReleaseControls();
                }
                else
                {
                    llRequestPermissions(llDetectedKey(0), PERMISSION_TAKE_CONTROLS);
                }
            }
        }
    }
    run_time_permissions(integer perm)
    {
        if (perm == PERMISSION_TAKE_CONTROLS)
        {
            llSay(0, "Permissions granted.");
            //speed = "Default Speed";
            //llMessageLinked(LINK_SET, 0, "Speed: "+speed, "a");
            llTakeControls(LEVELS, TRUE, FALSE);
        }
        else
        {
            state engineson;
        }
    }

    listen(integer channel, string name, key id, string message)
    {
        if(message == "stop")
        {
            llSay(0, "Halting movement...");
            llSetTimerEvent(0);
        }
        if(message == "Disengage")
        {
            llSay(0, "Script Shutdown Beginning");
            llSleep(3);
            llResetScript();
        }

        //if(message=="Default Speed"){
        // llSay(0, "Switching to default speed of ship");
        //speed = "Default Speed";
        //llMessageLinked(LINK_SET, 0, "Speed: "+speed, "a");
        //increment = <1,0,0>;
        //increment2 = <0, 0,1>;
        //interval = .10;
        //}

        //if(message=="Low Speed"){
        // llSay(0, "Switching to lowest speed of ship");
        //speed = "Low Speed";
        //llMessageLinked(LINK_SET, 0, "Speed: "+speed, "a");
        //increment = <.1,0,0>;
        //increment2  = <0, 0,.1>;
        //interval = .20;
        //}
        //if(message=="High Speed"){
        // llSay(0,"Switching to highest speed of ship");
        //speed = "High Speed";
        //llMessageLinked(LINK_SET, 0, "Speed: "+speed, "a");
        //increment = <3,0,0>;
        //increment2  = <0, 0,3>;
        //interval = .10;
        //}
        //if(message=="Ludicrus Speed"){
        //  llSay(0, "Sir, we've never gone that fast before. I'm not sure if the ship can take it! Ah hell I'll do it anyways :-p");
        //speed = "Ludicrus Speed";
        //llMessageLinked(LINK_SET, 0, "Speed: "+speed, "a");
        //increment = <10,0,0>;
        //increment2  = <0, 0,10>;
        //interval = .1;
        //}
        //if(message=="superup")
        //{
        //  currentpos=llGetPos();
        //llSay(0,"The ship will now go to the set height of 477 Meters. Please sit down and remained seated until notified to get up.");
        //llSleep(2);
        //state superup;
        //}
        //if(message=="Default Level")
        //{
        // currentpos=llGetPos();
        //setposaz=<currentpos.x, currentpos.y, llGround(llGetPos())>+<0, 0, 50>;
        //llSay(0, "The ship will now go to the height of "+(string)setposaz.z+" Meters. ");
        //llSleep(2);
        // state defaultlevel;
        //}
        //if(message=="Water Level")
        //{
        //currentpos=llGetPos();
        //setposz=<currentpos.x, currentpos.y, llWater(llGetPos())>+<0, 0, 9.018>;
        //llSay(0, "The ship will now go to the height of "+(string)setposz.z+" Meters. Please sit down and remained seated until notified to get up.");
        //llSleep(2);
        //state waterlevel;
        //}


    }
    control(key id, integer level, integer edge)
    {
        if(level & CONTROL_FWD)
        {
            llSetTimerEvent(0);
            llSay(0, "Cruising Forward");
            increment.x = llFabs(increment.x);
            llSetTimerEvent(interval);
        }
        if(level & CONTROL_BACK)
        {
            llSetTimerEvent(0);
            llSay(0, "Cruising Backward");
            increment.x = -1*llFabs(increment.x);
            llSetTimerEvent(interval);
        }
        if(level & CONTROL_UP)
        {
            llSetTimerEvent(0);
            llSay(0, "Increasing Altitude");
            state goingup;

        }
        if(level & CONTROL_DOWN)
        {
            llSetTimerEvent(0);
            llSay(0, "Decreasing Altitude");
            state goingdown;
        }
        if(level & CONTROL_LEFT)
        {
            llSetTimerEvent(0);
            llSay(0, "Shifting Left");
            integer i = 0;
            while(i<9)
            {
                grot = llGetRot();
                gtarrot = grot*<0.00000, 0.00000, 0.08716, 0.99619>;
                llSetRot(gtarrot);
                i++;
            }
        }
        if(level & CONTROL_RIGHT)
        {
            llSetTimerEvent(0);
            llSay(0,  "Shifting Right");
            integer i = 0;
            while(i<9)
            {
                grot = llGetRot();
                gtarrot = grot*<0.00000, 0.00000, -0.08716, 0.99619>;
                llSetRot(gtarrot);
                i++;
            }
        }
    }
    timer()
    {
        grot = llGetRot();
        gcurpos = llGetPos();
        gtopos = increment*grot + gcurpos;
        llSetPos(gtopos);
    }


}
//state superup
//{
// state_entry()
//{
//  llSetTimerEvent(.1);
// }
//timer()
//{
//  if(llGetPos()!=<currentpos.x, currentpos.y, 477>)
//{
//llSetPos(<currentpos.x, currentpos.y, 477>);
// }
//else if(llGetPos()==<currentpos.x, currentpos.y, 477>)
//  {
//llSay(0, "It is now safe to stand up.");
//    llSetTimerEvent(0);
// state engineson;
//}
//}
//}
//state defaultlevel
//{
//  state_entry()
// {
//    llSetTimerEvent(.1);
// }
//timer()
//{
//  if(llGetPos()!=setposaz)
// {
// llSetPos(setposaz);
//}
//else if(llGetPos()==setposaz)
//  {
//llSay(0, "Reached height");
//llSetTimerEvent(0);
// state engineson;
//}
//}
//}
//state goingup
//{
// state_entry()
//{
//  increment2.z = llFabs(increment2.z);
// llSetTimerEvent(interval);
// llListen(0, "", gowner, "");
// llListen(0, copilot, "", "");
//}
//listen(integer channel, string name, key id, string message)
//{
//   if(message=="status")
// {
//   vector currentpos=llGetPos();
//llSay(1431, "We are currently located at "+(string)currentpos.x+" -- "+(string)currentpos.y+" -- "+(string)currentpos.z+".");
//llSleep(1);
//}
//if(message=="stop"){
//     llShout(1431, "Stopping altitude increasment");
//   llSetTimerEvent(0.0);
// state engineson;
//}
//}
// timer()
//{
//   grot = llGetRot();
//gcurpos = llGetPos();
//gtopos = increment2*grot + gcurpos;
//llSetPos(gtopos);
//}
//}

//state goingdown
//{
// state_entry()
//{
//  llListen(0, "", gowner, "");
//llListen(0, copilot, "", "");
// increment2.z = -1*llFabs(increment2.z);
//llSetTimerEvent(interval);
//}
//listen(integer channel, string name, key id, string message)
//{

//  if(message=="status")
// {
//  vector currentpos=llGetPos();
//llSay(1431, "We are currently located at "+(string)currentpos.x+" -- "+(string)currentpos.y+" -- "+(string)currentpos.z+".");
//llSleep(1);
//}
//else if(message=="stop")
//{
//     llShout(1431, "Stopping altitude decreasment");
//  llSetTimerEvent(0.0);
// state engineson;
//}
//}

//timer()
//{
//   grot = llGetRot();
// gcurpos = llGetPos();
//gtopos = increment2*grot + gcurpos;
//llSetPos(gtopos);
//}
//}
//state waterlevel
//{
//  state_entry()
//{
//  llSetTimerEvent(.1);
// }
// timer()
//{
//  if(llGetPos()!=setposz)
// {
//llSetPos(setposz);
//}
// else if(llGetPos()==setposz)
//    {
//llSay(0, "It is now safe to stand up.");
//    llSetTimerEvent(0);
// state engineson;
//}
//}
//}
// Retrieved from "http://secondlife.wikia.com/wiki/Non-Physics_Vehicle_Script"



{L_CODE}:
//XEngine:LSL
// Above line is to tell OpenSim to use XEngine
// NOTE FROM POSTER
// This will NOT move you in Opensim.   
// I posted this here as it was teh one which ckrinke in the IRC channel was discussing for using as a template.
// I suggest STRONGLY you compare it with that of Nebadon's ODE car / hoverscript
//======================================
// From the book:
//
// Scripting Recipes for Second Life
// by Jeff Heaton (Encog Dod in SL)
// ISBN: 160439000X
// Copyright 2007 by Heaton Research, Inc.
//
// This script may be freely copied and modified so long as this header
// remains unmodified.
//
// For more information about this book visit the following web site:
//
// http://www.heatonresearch.com/articles/series/22/
//=================================================
float forward_power = 15;   //Power used to go forward (1 to 30)
float reverse_power = -15; //Power ued to go reverse (-1 to -30)
float turning_ratio = 2.0;   //How sharply the vehicle turns. Less is more sharply. (.1 to 10)
string sit_message = "Ride"; //Sit message
string not_owner_message = "You are not the owner of this vehicle ..."; //Not owner message

default
{
    state_entry()
    {
        llSetSitText(sit_message);
        // forward-back,left-right,updown
        llSitTarget(<0.2,0,0.45>, ZERO_ROTATION );
       
        llSetCameraEyeOffset(<-8, 0.0, 5.0>);
        llSetCameraAtOffset(<1.0, 0.0, 2.0>);
       
        // llPreloadSound("car_start");      //not operational
        // llPreloadSound("car_run");        //deprecated functions & not supported in OS
       
        //car
        // OPENSIM NOTE This section is Tricky & Hazzardous!
        //
        llSetVehicleType(VEHICLE_TYPE_CAR);                                                           // !! Varied Results & Issues
        llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY, 0.2);
        llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_EFFICIENCY, 0.80);
        llSetVehicleFloatParam(VEHICLE_ANGULAR_DEFLECTION_TIMESCALE, 0.10);
        llSetVehicleFloatParam(VEHICLE_LINEAR_DEFLECTION_TIMESCALE, 0.10);
        llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_TIMESCALE, 1.0);
        llSetVehicleFloatParam(VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE, 0.2);
        llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_TIMESCALE, 0.1);
        llSetVehicleFloatParam(VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE, 0.5);
        llSetVehicleVectorParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, <1000.0, 2.0, 1000.0>);
        llSetVehicleVectorParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, <10.0, 10.0, 1000.0>);
        llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY, 0.50);  //1.0
        llSetVehicleFloatParam(VEHICLE_VERTICAL_ATTRACTION_TIMESCALE, 0.50);  //1.0
    }
   
    changed(integer change)
    {
        if (change & CHANGED_LINK)
        {
            key agent = llAvatarOnSitTarget();
            // OS NOTES !!  Unsitting the avatar off this will cause it to fly off out of control
            // and the Physics engine will go nuts !!!!!!! CAUTION !!!!!
            if (agent)
            {               
                if (agent != llGetOwner())
                {
                     llSay(0, not_owner_message);
                     llUnSit(agent);
                     llPushObject(agent, <0,0,01>, ZERO_VECTOR, FALSE);
                }
                else
                {
                     llTriggerSound("car_start",1);
                     llMessageLinked(LINK_ALL_CHILDREN , 0, "WHEEL_DRIVING", NULL_KEY);
                    llSleep(.4);
                    llSetStatus(STATUS_PHYSICS, TRUE);
                    llSleep(.1);
                    llRequestPermissions(agent, PERMISSION_TRIGGER_ANIMATION | PERMISSION_TAKE_CONTROLS);

                     llLoopSound("car_run",1);
                }
            }
            else
            {
                 llStopSound();
               
                llSetStatus(STATUS_PHYSICS, FALSE);
                llSleep(.4);
                llReleaseControls();
                llTargetOmega(<0,0,0>,PI,0);
                // !!!!!!!!!!!  I ADDED THIS AS A SAFETY !!!!!!!!!!!!!!!!!
                llSleep(0.3);
                llResetScript();  // IF THIS RUNS, it WILL Explode Physics !
            }
        }
       
    }
   
    run_time_permissions(integer perm)
    {
        if (perm)
        {
            llTakeControls(CONTROL_FWD | CONTROL_BACK | CONTROL_DOWN | CONTROL_UP | CONTROL_RIGHT |
                            CONTROL_LEFT | CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT, TRUE, FALSE);
        }
    }
   
    control(key id, integer level, integer edge)
    {
        integer reverse=1;
        vector angular_motor;
       
        //get current speed
        vector vel = llGetVel();
        float speed = llVecMag(vel);

        //car controls
        if(level & CONTROL_FWD)
        {
            llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <forward_power,0,0>);
            reverse=1;
        }
        if(level & CONTROL_BACK)
        {
            llSetVehicleVectorParam(VEHICLE_LINEAR_MOTOR_DIRECTION, <reverse_power,0,0>);
            reverse = -1;
        }

        if(level & (CONTROL_RIGHT|CONTROL_ROT_RIGHT))
        {
            angular_motor.z -= speed / turning_ratio * reverse;
        }
       
        if(level & (CONTROL_LEFT|CONTROL_ROT_LEFT))
        {
            angular_motor.z += speed / turning_ratio * reverse;
        }

        llSetVehicleVectorParam(VEHICLE_ANGULAR_MOTOR_DIRECTION, angular_motor);

    } //end control   
} //end default

_________________
No further support of any kind, for any of my materials. Use as/is whereis.
PLEASE UNSTICKY Any Stickied Posting by myself.


Last edited by WhiteStar Magic on Sat May 16, 2009 1:24 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: !! Vehicles in OS - Resource /Reference information
PostPosted: Thu May 14, 2009 11:18 pm 

Joined: Thu May 14, 2009 11:03 pm
Posts: 3
I drifted away somewhat from what is happening in vehicles on OSG so I may be out of date with what you folks are doing. Some items above are probably worth correcting.

I built (with Hiro Protagonist's substantial help) the sailboat some may have seen here and there on OSG. It uses no llSetVehicle this or that functions. They are not needed to have a "vehicle". There is some considerable confusion about this. A "vehicle" on SL is defined by using their llSetVehicle type function which declares the object to be a "vehicle".

That's not required. llSetForce works just fine on OSG. And correcting an item above, llSetForce will work just fine with SL defined vehicles if you are well versed in physics. I build a semi popular racing AC yacht in SL. Myself and seonaid McLean arranged an off world tidal current simulation that communicates to the boat with tidal current values that are generated for the recorded terrain of SL sailing race courses. The race course's sea floor terrain map/model affects the water pixel current specified by the off world finite element analysis based tidal current model.

That current value is transmitted via httprequest to the boat at the racer's locale and llSetForce pushes the yacht in the direction that the tide simulation says it should. This is being done despite the fact the yacht also uses the SL llSetVehicle motor this and that functions (which may or may not be done as well as your own 2nd order llSetForce friction model might be, if you are well versed in physics).

The point of all this being . . . you don't need llSetVehicle this or that for vehicles, and if you do create them and use them, they do not preclude use of llSetForce.

My intent was to do tidal current in OSG too, but absent the ability of sat upon objects to traverse sim border crossings and retain their scripts and position/velocity attributes, there is no point.


Top
 Profile  
 
 Post subject: Re: !! Vehicles in OS - Resource /Reference information
PostPosted: Fri May 15, 2009 1:52 am 
OSG Elite
User avatar

Joined: Wed Mar 11, 2009 3:57 pm
Posts: 444
Thanks for the information Owen !

Excellent !! We need all the help we can get and Physics is not my thing and I don;t think too many of us are into it. We just want to get some basics sorted out and reference points so the the dev teams can work some of this out. Any input you would have would absolutely invaluable and VERY MUCH APPRECIATED.

_________________
No further support of any kind, for any of my materials. Use as/is whereis.
PLEASE UNSTICKY Any Stickied Posting by myself.


Last edited by WhiteStar Magic on Sat May 16, 2009 1:25 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: !! Vehicles in OS - Resource /Reference information
PostPosted: Fri May 15, 2009 11:31 am 

Joined: Thu May 14, 2009 11:03 pm
Posts: 3
I suppose another elaboration may be valuable.

The "vehicles" I am talking about are fully physical. You do not need or want to llSetStatus (PHYSICS, FALSE). You want them TRUE. You can make objects very easily move about with an avatar sitting on them just by using something like:
llSetStatus (PHYSICS, TRUE); or whatever the syntax is
float gmass = llGetMass();

llSetForce (<0,0, gmass * 9.8, TRUE (or FALSE, forgot convention))

Be sure the GetMass measure is done after you sit on the object and then the llSetForce will counter gravity. The X and Y direction of force can be set as you wish (be sure to add a countering friction term like . . . thrust.x = thrust.x - thrust.x * (velocity.x / desiredvelocity.x) and . . . presto. Done. It's trivial. You then have a sittable physical vehicle without the 0.2 sec delays in llSetPos. Steer it with conventional keyboard reading code.

If you haven't seen the sailboat in OSG, ask Bri at Baya. There are 1L vendors all over the sailing sims around Baya and DeltaZone.


Top
 Profile  
 
 Post subject: Re: !! Vehicles in OS - Resource /Reference information
PostPosted: Fri May 15, 2009 8:21 pm 
OSG Elite
User avatar

Joined: Fri Oct 17, 2008 11:30 am
Posts: 300
Location: Yorkshire, England
Just some notes on my own (self-guided, in-the-dark) experience with non-vehicle scripts, especially sittable ones.

With no prior experience in SL or OS, I've developed a functional "swimmer" in OpenSim, which I'll be releasing sometime soon as a freebie package. The purpose is to emulate similar, paid-for products in SL, in particular the popular SLwim and the even more highly-regarded Siggy's Swimmer. My partner and I love swimming in SL, and it was too much to stomach having all that open water in our own regions but be unable to swim in it, so I messed about and came up with this. If you've never used one of those swimmers, they're HUDs which, when you wear them, allow you to move around in water with dynamics very similar to swimming in RL - you tend to float to the surface, but can dive under, movement is greatly damped, and of course you've got swimming animations while you're moving (treading water while you're not) and appropriate sounds.

1. It was not possible to solely use a HUD. Using any kind of physics capabilty other than llPushObject() had no effect on an avatar using an attachment, and it was impossible to get the kind of sustained, fine control needed with series of pushes. So a sittable prim was used instead, despite the disadvantages of that approach - it's not possible just to walk into water to active it, you need to rez it in-world and sit, and so on.

2. None of the physical rotational forces seemd to work - llApplyRotationalImpulse(), llSetTorque(), llSetForceAndTorque(), etc, so to turn the avatar (ie, turn the prim) involved llSetRot(), giving very jerky turns that are difficult to control. This is a shame, because smoothness of operation is crucial to the experience.

3. Control using the arrow keys, etc, ended up having to be calibrated - when my partner used it, I found that holding a key generated far fewer control() events. So, to simulate gradual acceleration, the amount of force incremented per event had to be different in her situation than in mine. Her access was from a Mac G5 on OSX, using the SL viewer over the internet; mine was using an Intel Quad client running WinXP, using Hippo over a LAN. I'm not sure what the significant factor was, but the solution was to get the user to hold a key for a few seconds, count the number of events fired per second (20-30 on mine, 3-6 on hers) and adjust the increment amount accordingly.

Anyway, we're now swimming, although jerkily when we turn, although I've not yet implemented any underwater swimming, so we can only swim at the surface. I thought a rough tech description of what I've found might be of interest here - hope it helps someone. As I say, once I've tidied the code somewhat, and got animations and sounds finished, I'll stick this one out on the grid as a rough-and-ready freebie.

_________________
John
UK resident; OSGrid & Second Life: "Barrington John"; code monkey in RL
OSGrid region server: P4/3.6GHz/2GB, Ubuntu Karmic/Mono 2.6/MySQL 14.14v5.1.37, home ADSL (~8.5Mbps/0.85Mbps), 8-14 regions, 2 users


Top
 Profile  
 
 Post subject: Re: !! Vehicles in OS - Resource /Reference information
PostPosted: Sat May 16, 2009 1:13 pm 
OSG Elite
User avatar

Joined: Wed Mar 11, 2009 3:57 pm
Posts: 444
Just a final note from me on this topic/subject.

Seems like some want to argue things and that is all fine. We all grow from healthy discussion. As I stated in my first post here. I am Passing Along Information that was discussed in the #OSGRID irc with Nebadon/ Ckrinke and others. Was is accurate / correct ? I'm not sure and so I am removing all related data as I do not want to confuse anyone and it is apparent that some of the posted info is erroneous. Hopefully someone with knowledge of OPENSIM Vehicles, vehicle issues and what does indeed work or not, can post detailed "Known Good & Known Not Good" material.

Sorry if this cause any confusion or angst amongst people....

_________________
No further support of any kind, for any of my materials. Use as/is whereis.
PLEASE UNSTICKY Any Stickied Posting by myself.


Top
 Profile  
 
 Post subject: Re: !! Vehicles in OS - Resource /Reference information
PostPosted: Sun May 17, 2009 7:42 pm 

Joined: Sat Feb 02, 2008 5:08 pm
Posts: 16
Well, there are three different vehicle notions with LSL and I'll refer to them as:

1) "Non-physical Vehicles" which use llSetPos() in a loop.
2) "Physical Vehicles" which use llSetForce() and related functions.
3) "LL Vehicles" which use llSetVehicleType() to engage software angular and linear motors. The secondlife wiki indicates that llSetForce() should *not* be used with these types of vehicles.

Our mission is to wring out example scripts of all vehicle types, have folks on different sims and different operating systems test them and find the limitations.

At that point, we start pushing the envelope with diagnosis of the issues and Mantis to try to make progress in completing the missing parts, of which there are a few.

Personally, I find Jeff Heaton's two books "Introduction to Linden Scripting Language" and "Scripting Recipes for Second Life" which contain a number of interesting scripts as examples. My suggestion is that we use the source of the scripts in Jeff Heaton's books and test, diagnose, Mantis the issues to make progress. That way, we have a common set of scripts to work from.

Along the way, I am hoping a few folks get together and start building a monorail, train, boat line on a river and perhaps airship line between various regions so that we can be prepared to extend these three different vehicle notions in region crossings, build a transportation system (or several) and improve OpenSim along the way.

Charles


Top
 Profile  
 
 Post subject: Re: !! Vehicles in OS - Resource /Reference information
PostPosted: Tue Jun 23, 2009 12:36 am 
Furious Typer
User avatar

Joined: Fri Feb 06, 2009 12:32 am
Posts: 232
Location: Australia
jfhopkin {L_WROTE}:
I've developed a functional "swimmer" in OpenSim, which I'll be releasing sometime soon as a freebie package.


Just what I am looking for - is it available yet?

charlesk {L_WROTE}:
Along the way, I am hoping a few folks get together and start building a monorail, train, boat line on a river and perhaps airship line between various regions so that we can be prepared to extend these three different vehicle notions in region crossings, build a transportation system (or several) and improve OpenSim along the way.


I'm also looking for a boat script - anyone?

Yours in parasitica - Tarak

(English is a wonderful language - it you don't know a word - make one up :) )


Top
 Profile  
 
 Post subject: Re: !! Vehicles in OS - Resource /Reference information
PostPosted: Tue Jun 23, 2009 5:08 am 
OSG Elite
User avatar

Joined: Fri Oct 17, 2008 11:30 am
Posts: 300
Location: Yorkshire, England
Tarak {L_WROTE}:
jfhopkin {L_WROTE}:
I've developed a functional "swimmer" in OpenSim, which I'll be releasing sometime soon as a freebie package.

Just what I am looking for - is it available yet?

No, I've not released it yet, but I will. It needs some tidying up, that's all - I've just not got round to it yet. Now I know someone's interested, I'll do it.

So far, it's pretty crude, and only has one stroke, with no underwater swimming, diving, etc. Worst of all, it's jerky when you're turning to change direction - as far as I know, that's a limitation due to the partial implementation of physics in OS. Also, you can't cross borders (again, an OpenSim limitation), and it could do with some way of preventing you from trying, since the thing goes off-world and stays there. Nevertheless, it's basically working.

_________________
John
UK resident; OSGrid & Second Life: "Barrington John"; code monkey in RL
OSGrid region server: P4/3.6GHz/2GB, Ubuntu Karmic/Mono 2.6/MySQL 14.14v5.1.37, home ADSL (~8.5Mbps/0.85Mbps), 8-14 regions, 2 users


Top
 Profile  
 
 Post subject: Re: !! Vehicles in OS - Resource /Reference information
PostPosted: Tue Jun 23, 2009 5:27 am 
Furious Typer
User avatar

Joined: Fri Feb 06, 2009 12:32 am
Posts: 232
Location: Australia
Sounds like a VW I once had in New Guinea - great car! only the engine broke and we had to replace it - the body rusted (we had to replace it) etc. - still stuck out in the jungle somewhere - I'll get back and get it one day (only been there for 25 years) - Thanks for the heads up - love to see it when it is finished - thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 2   [ 16 posts ]
Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net