Moving Sidewalk Script Help

Creating scripts
Post Reply
User avatar
Koshari Mahana
Posts: 359
Joined: Fri Feb 06, 2015 8:14 am
Has thanked: 280 times
Been thanked: 500 times
Contact:

Moving Sidewalk Script Help

Post by Koshari Mahana »

.
Kimm Starr and I are looking for a moving sidewalk script that will work in bulletsim. It's the sort of sidewalk that you stand on and it moves your avatar forward (without using a 'sit' pose). She has one that was scripted for ODE but not for bulletsim. Any help would be greatly appreciated!

Here is the ODE version:

Code: Select all

// Moving Sidewalk Escalator  
// Pushes avatar when stepped on or detected within area of prim.
//
// v0.1 vegaslon plutonian (2013) working concept.
// v0.2 Lani Global (2013) added sim restart reset. 
// v0.3 Lani Global (2013) added description setting of push force. 
// v0.4 Lani Global (2013) changed to collide only instead of volume detect.

default

{
        state_entry()
    {
        float OBJECTDESC = 10; // set the default push to 10.
        llSetTextureAnim(ANIM_ON | SMOOTH | LOOP , ALL_SIDES, 1, 1, 1, 1, -0.07); // animate sliding texture.
    }
    collision(integer num_detected)
    {
        float OBJECTDESC = llGetObjectDesc(); // gets description of prim and use it as push force in z axis.
        llPushObject(llDetectedKey(0),<OBJECTDESC,0,0>, <0,0,0>, TRUE); // push on the avatar a little.
    }
     changed(integer EVENT) 
    {         
        if (EVENT & CHANGED_REGION_START) // detect if region has been restarted.
        { 
            llResetScript(); // reset the script
        }
    }
}
These users thanked the author Koshari Mahana for the post (total 3):
Ilan TochnerKimm StarrChristine Nyn
Image
VISIT FOUR WINDS ON THE MARKET
VISIT FOUR WINDS INWORLD: hop://grid.kitely.com:8002/Coopersville/909/907/21
User avatar
Christine Nyn
Posts: 75
Joined: Sat Mar 07, 2020 10:20 pm
Has thanked: 245 times
Been thanked: 143 times

Re: Moving Sidewalk Script Help

Post by Christine Nyn »

The Moving sidewalk uses a very simple method of moving - it simply pushes the avatar while they are "in collision" (touching) the walkway. Unfortunately the way that "push" works is it uses a calculated energy budget allocated to the script and that diminishes with each push. Then a pause ensues while the energy budget is topped up again. Thus you tend to get a rather jerky response.

As the collision event which is driving the "push" is continuous while the avatar is on the sidewalk it also places quite heavy demands on the region's script timings so having several such objects working simultaneously would probably not be a good idea.
The script as posted has a default value of 10.0 for the "push" but this can be overridden by putting a value in Object Description of the sidewalk prim. If the push seems a bit too heavy in Bullet sim then going to a lower number, perhaps 4.0, might allow the script to be usable.

I've passed you an alternative solution inworld that uses llKeyframedMotion() to move the avatar and is thus kinder on the region resources but requires the avatar to click on the sidewalk to initiate the transport.
These users thanked the author Christine Nyn for the post (total 2):
Ilan TochnerKoshari Mahana
User avatar
Koshari Mahana
Posts: 359
Joined: Fri Feb 06, 2015 8:14 am
Has thanked: 280 times
Been thanked: 500 times
Contact:

Re: Moving Sidewalk Script Help

Post by Koshari Mahana »

Thank you so much for your help.
Christine Nyn wrote:
Wed Jan 24, 2024 1:05 pm
The Moving sidewalk uses a very simple method of moving - it simply pushes the avatar while they are "in collision" (touching) the walkway. Unfortunately the way that "push" works is it uses a calculated energy budget allocated to the script and that diminishes with each push. Then a pause ensues while the energy budget is topped up again. Thus you tend to get a rather jerky response.

As the collision event which is driving the "push" is continuous while the avatar is on the sidewalk it also places quite heavy demands on the region's script timings so having several such objects working simultaneously would probably not be a good idea.
The script as posted has a default value of 10.0 for the "push" but this can be overridden by putting a value in Object Description of the sidewalk prim. If the push seems a bit too heavy in Bullet sim then going to a lower number, perhaps 4.0, might allow the script to be usable.

I've passed you an alternative solution inworld that uses llKeyframedMotion() to move the avatar and is thus kinder on the region resources but requires the avatar to click on the sidewalk to initiate the transport.
These users thanked the author Koshari Mahana for the post:
Christine Nyn
Image
VISIT FOUR WINDS ON THE MARKET
VISIT FOUR WINDS INWORLD: hop://grid.kitely.com:8002/Coopersville/909/907/21
Post Reply