Jump to content
AeriannaTenkaze

Looking for a physical conveyor script

Recommended Posts

The idea I have is to make a labyrinth of moving objects, platforms and conveyors. I think i know how to move platforms but dont know how to set anything on a repeating timer to move them up and down, back and forth and what not. But the key part is a script to make a prim move people along it. [like making a cylinderprim, stretching it out and getting that to move anyone that moves onto it] Is this even possible?  

Share this post


Link to post
Share on other sites

Kind of. Assuming you want it to work without the rider having to sit on anything, you'll need to use something that interacts with the avatar's physics, which means either physical motion of the conveying object or (better) Key Framed Motion.

There are many examples of KFM doing this, but one I can find on the map is a simple raft I made to cross the river at DJ's Landing in Eagan. If you just walk onto it, it will transport your avatar between sides of the river. The same works for elevators, etc.

Some limitations, though:

  1. You can't make the avatar turn and face a different direction. (That's actually possible by teleporting them, and teleports can be done through Experience scripts, but teleporting is never entirely seamless even within a region.)
  2. The avatar is apt to "dance" in inappropriate ways, depending how it's moved. This is familiar from physical elevators where the avatar's legs appear to be trying to walk when the elevator goes up and down. In my experience the effect seems less pronounced with KFM, but I'm pretty sure it can still happen.
  3. Crossing region borders is a whole separate project. Let's hope that's not in scope for what you have in mind.

Share this post


Link to post
Share on other sites

no,

 

     just something localized and for short durations (such as less then a minute ride inside my own lot) which may lead you to something positive [or negative] such as a proper exit or a trap. Though i did this once by means of teleporters but thats alitle stale so want something more spicy that one can use w/o clicking.

Share this post


Link to post
Share on other sites

There are a series of moving sidewalks on OSGrid's Lani mall.  I've never looked at the scripts, but it does what you describe here.

Share this post


Link to post
Share on other sites

I am a lazy coconut , so i'll post the basic slidewalk thing, and you can try and

figure out how to make it work for your needs? ... this is set to push an avi in the positive X regional direction...

key avi;
integer inUse = 0;
default
{
    state_entry()
    {       
    }
    collision_start(integer num_detected)
    {  if( inUse == 0)
       {  avi =  llDetectedKey(0);        
          llPushObject( avi, <50,0,0> , <0,0,0>, FALSE);  //  
          llSetTimerEvent(0.2);
          inUse = 1;
       }
    }   
    collision_end(integer num_detected)
    {  llSetTimerEvent(0.0);
       inUse = 0;
    }     
    timer()
    {  llPushObject( avi, <50,0,0> , <0,0,0>, FALSE); 
    }
} 

 

Share this post


Link to post
Share on other sites
Posted (edited)
37 minutes ago, Xiija said:

figure out how to make it work for your needs? ... this is set to push an avi in the positive X regional direction...

Since OP wants to move (nonphysical) objects instead of avatars, that script is probably not going to do much since it uses llPushObject. 

KeyFramedMotion is definitely the way to go for moving platforms with avatars on it, though understandably it can be a bit confusing to set up at first. 

Edited by Wulfie Reanimator

Share this post


Link to post
Share on other sites
Posted (edited)

crateconveyor.thumb.jpg.854bc86d4906f222ba3630d8796f99fd.jpg

VT Power Division - #1 in material handling.

Janet's Viking sim has a very well done conveyor system at the power plant.

Also visit the other end of the track, where an automated crane puts the crates on the railroad cars.

Has anyone ever built a working escalator in SL? There are many animated escalators, but they don't carry the passengers.

Edited by animats
Escalator

Share this post


Link to post
Share on other sites
23 minutes ago, animats said:

Has anyone ever built a working escalator in SL? There are many animated escalators, but they don't carry the passengers.

I haven't seen one, but it would be easy enough to build one.  The basic script for an escalator step going UP looks like this

list lMove = [<1.0, 0.0,0.5>,2.0];
integer iON;

default
{
    touch_start(integer total_number)
    {
        iON = !iON;
        if (iON)
        {
            llSetKeyframedMotion(lMove,[KFM_DATA,KFM_TRANSLATION,KFM_MODE,KFM_LOOP]);
        }
        else
        {
            llSetKeyframedMotion([],[]);
        }            
    }
}

To make it go down, just set the X and Z parameters in lMove negative.  Put the script in a flat step-sized convex hull prim.  Step on it and click to start.  Your av will follow the moving step either up or down, depending on how you scripted it.  Unless you use llSetAnimationOverride or some other subterfuge to override your walk animation, you will be walking as the step moves, but that should be easy to overcome.  To make this thing into an escalator, you'd need to do a little magic with a set of steps that move together.  Each step would have to stop its KFM at the top and use llSetRegionPos to reposition at the bottom again.   At least in theory, it ought to make a decent escalator.
    
 

Share this post


Link to post
Share on other sites
9 hours ago, Rolig Loon said:

I haven't seen one, but it would be easy enough to build one.  The basic script for an escalator step going UP looks like this


list lMove = [<1.0, 0.0,0.5>,2.0];
integer iON;

default
{
    touch_start(integer total_number)
    {
        iON = !iON;
        if (iON)
        {
            llSetKeyframedMotion(lMove,[KFM_DATA,KFM_TRANSLATION,KFM_MODE,KFM_LOOP]);
        }
        else
        {
            llSetKeyframedMotion([],[]);
        }            
    }
}

To make it go down, just set the X and Z parameters in lMove negative.  Put the script in a flat step-sized convex hull prim.  Step on it and click to start.  Your av will follow the moving step either up or down, depending on how you scripted it.  Unless you use llSetAnimationOverride or some other subterfuge to override your walk animation, you will be walking as the step moves, but that should be easy to overcome.  To make this thing into an escalator, you'd need to do a little magic with a set of steps that move together.  Each step would have to stop its KFM at the top and use llSetRegionPos to reposition at the bottom again.   At least in theory, it ought to make a decent escalator.
    
 

I have seen one, at someone's gadget showroom, I thought it was your's?? Maybe I'm mistaken, lol. Been a couple years though since i was at whatever place that was. Seems like it would be kinda prim heavy to have individual moving steps, but i suppose in a place you would want/need an escalator, it wouldn't be that much of an impact on the limit

Share this post


Link to post
Share on other sites

When KFM was new, I spent hours trying to get a step-on/step-off escalator to work and was never satisfied with the results. Try as I might I never found a configuration that reliably moved the avatar up the escalator in a controlled motion.

One thing I did learn in my trials: don't make each visible step do KFM. After the first few, the network traffic of object updates will lag the viewer terribly (at least with my poor network connection) and if the cam looks away and back again, the steps will have drifted all over, far from the specified KFM trajectory. The only way I had any luck at all was to rez an invisible KFM "step" when the avatar collided with the escalator's start platform and use that one step to do all the real work. (Making the visible mesh stairs move, then, is mere cosmetics. Might use an efficient face-by-face texture animation "escalator" for that.)

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

I wondered about that, Qie. I've never tried to build an escalator, but have used this moving step concept separately several times with great success, so it seemed like a logical extension.  I imagine that rezzing a single step when the av arrives would be a better solution than what I had in mind.  Certainly less complicated. Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×