Jump to content

Off SIM scripting?


Nichiren Dinzeo
 Share

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

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

Recommended Posts

Regarding the title and "so that it can go off my private region," I don't think what you're asking is particularly possible, if it is what I think it is.

Objects can't leave the boundaries of a region, with some caveats. The root of an object must be inside of region boundaries, but individual links can go beyond. A vehicle could theoretically get about 64 meters outside the region boundaries if it was scripted in a very specific way, but I don't think that kind of technique is something that would be even remotely easy (or brief) to explain to a beginner.

Link to comment
Share on other sites

14 minutes ago, Wulfie Reanimator said:

Regarding the title and "so that it can go off my private region," I don't think what you're asking is particularly possible, if it is what I think it is.

Objects can't leave the boundaries of a region, with some caveats. The root of an object must be inside of region boundaries, but individual links can go beyond. A vehicle could theoretically get about 64 meters outside the region boundaries if it was scripted in a very specific way, but I don't think that kind of technique is something that would be even remotely easy (or brief) to explain to a beginner.

It is a private region and they actually can go off of them. I was surprise also.  This is the jet ski I bought that does it

https://marketplace.secondlife.com/p/OFF-SIM-RIDEABLE-Jetski-up-to-700m-from-shore/16448136

 

Link to comment
Share on other sites

20 minutes ago, Nichiren Dinzeo said:

It is a private region and they actually can go off of them. I was surprise also.  This is the jet ski I bought that does it

https://marketplace.secondlife.com/p/OFF-SIM-RIDEABLE-Jetski-up-to-700m-from-shore/16448136

I went to try the demo in-world and okay, this is actual black magic until proven otherwise.

I'm completely baffled as to how this jet ski is built, and I'm staring right at it, at <934, 99, 20>
7d569c840b.png

Edited by Wulfie Reanimator
Link to comment
Share on other sites

Hmm... I had assumed the mention "off-sim" was perhaps a quirk of translation from a different language but apparently not. Very interesting effect according to the marketplace entry. I'll have to check it out in person when I can get to my PC. Wonder what happens if you stand up while out in the void...?

Edit: I'm less inclined to believe this effect is using the linden vehicle functionality, so those links i posted earlier probably won't be of much help in this regard.

Edited by Fenix Eldritch
Link to comment
Share on other sites

19 minutes ago, Fenix Eldritch said:

Wonder what happens if you stand up while out in the void...?

You warp onto the sim border, as expected.

Inspecting how the object is built, I don't see anything out of the ordinary. It's 5 prims, 4 of them are tiny and hidden away (particle emitters/sound), and the main mesh. It doesn't have an offset root like I would've guessed, either. The object is set to temporary and phantom (not physical).

It doesn't use physics as it says on MP and shown in the video, it's purely scripted movement. That's why the camera movement is so janky.

It can't use llSetRegionPos, llSetPos, or PRIM_POSITION since those don't let you go far outside of sim bounds (tested)...

Edited by Wulfie Reanimator
Link to comment
Share on other sites

I had heard of this too and scratched my head. Best I could think of would be some form of root prim magic where the root is still on the region, but the object is hanging out on the end as a linked prim. Might be megaprims + finding some sneeky way around linking distance limits.

Link to comment
Share on other sites

Don't let "vehicle" fool you.

You need to wear it and sit on the "anchor" object rezzed in sim. Avatars can be moved a few 100m around as part of a linkset - unlike prims which are limited to the link rules.

I didn't try the demo though, it's just theory based on things I tried in the past.

  • Like 2
Link to comment
Share on other sites

7 minutes ago, Nova Convair said:

Don't let "vehicle" fool you.

You need to wear it and sit on the "anchor" object rezzed in sim. Avatars can be moved a few 100m around as part of a linkset - unlike prims which are limited to the link rules.

I didn't try the demo though, it's just theory based on things I tried in the past.

Oh, that solves that mystery.

It wooshed over my head that the vehicle asks permission to attach something to your avatar when you sit on it. Then the vehicle you sit on hides itself and you're left with the one attached to you. Then it moves your avatar as you described. Kinda ingenious. If you right-click the vehicle you're "sitting" on, it has the detach option, which I didn't even check.

Here's a simple demo that you can sit on and click-and-hold to move yourself far off-sim. It reaches about 900 meters.

vector pos;

default
{
    state_entry()
    {
        llSitTarget(<0,0,1>, ZERO_ROTATION);
        pos = llGetPos();
    }

    touch(integer n)
    {
        llSetLinkPrimitiveParamsFast(2, [PRIM_POSITION, (pos += <1,0,0>) - llGetPos()]);
    }
}

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Ah, so that's how it's done. Cute.

By the way, how do you make giant off-sim terrain sculpts? I am looking at trying something experimental involving impostors of neighboring sims.

(Also, I think there was some tool to make a miniature sculpt of an entire sim, like a relief map, but can't find that on Marketplace.)

Link to comment
Share on other sites

The only thing special about the giant sim surround sculpts is that the sculpt map is applied to a large megaprim. Changing the type to sculpt map doesn't alter the scale of the prim, so it doesn't dispel the mega prim's size.

Edited by Fenix Eldritch
Link to comment
Share on other sites

Wow, didn't know the avatar could be moved so far away.

Could make some really great aircraft with that!

https://gyazo.com/365ec98c7c35a3b0cfb0e95ad93caf07

^ and yes, that's a off-sim terrain sculpt I made for example in there. It's a few megaprims sized 1024x1024x256 with a sculpt applied. I call them voidscapes, as in putting a landscape in the void. I'd made some pretty awesome voidscapes in the past, such as one which was a giant underground cavern! Was working on a whole city even, but alas lost the work in progress of that.

 

Might be fun to go back to making voidscapes with this technique and coupling it with the fast heightmap collision algorithms I had, hm.

Edited by Nexii Malthus
Link to comment
Share on other sites

4 hours ago, Nexii Malthus said:

Could make some really great aircraft with that!

I'm already working on it.

Edit: Well, this has been the most fun I've ever had with vehicles. @Nexii Malthus
269170b3cd.png

Below is some code for a very basic plane with pitch and yaw. Put the code into a prim and sit on it. It has a sit target 1 meter above the prim and you'll start flying right away. Hold E (jump) to go faster and C (crouch) to slow down. Regular movement keys to turn. Mouselook is strongly encouraged at high speeds.

It doesn't limit how much you can pitch, so turning your camera in mouselook might get weird if you go straight up/down or upside-down.

It'll fly through any objects, but it'll always stay 5 meters above ground. I don't know what happens if you enter a neighboring sim.

If you don't wear your own vehicle of choice, you'll just fly around in your normal sitting animation.

You'll also need to use the LSL Preprocessor (Firestorm feature) to compile the code. Sorry. 🤷

#define TIMER       0.05

#define MIN_SPEED   1.0
#define INC_SPEED   0.5
#define MAX_SPEED   85.0

#define VTURN_SPEED 2 * DEG_TO_RAD
#define HTURN_SPEED 2 * DEG_TO_RAD

#define MIN_HEIGHT  5

integer     driver_link;
key         driver;

vector      position;
rotation    direction;
float       speed;

start()
{
    llTakeControls(831, TRUE, FALSE); // All WASD controls + up/down
    driver_link = llGetNumberOfPrims();
    position = ZERO_VECTOR;
    direction = ZERO_ROTATION;
    speed = MIN_SPEED;
    llSetTimerEvent(TIMER);
    llOwnerSay((string)["Start"]);
}

end()
{
    llReleaseControls();
    llSetTimerEvent(0);
    llOwnerSay((string)["End"]);
}

default
{
    timer()
    {
        position += <speed * llGetAndResetTime(),0,0> * direction;
        float ground_height = llGround(ZERO_VECTOR) + MIN_HEIGHT;
        if (position.z < (ground_height))
        {
            position.z = (ground_height);
        }
        llSetLinkPrimitiveParamsFast(driver_link, [PRIM_POS_LOCAL, position, PRIM_ROTATION, direction]);
    }

    control(key id, integer held, integer click)
    {
        if (CONTROL_UP & held)
        {
            if ((speed += INC_SPEED) > MAX_SPEED)
            {
                speed = MAX_SPEED;
            }
        }
        else if (CONTROL_DOWN & held)
        {
            if ((speed -= INC_SPEED) < MIN_SPEED)
            {
                speed = MIN_SPEED;
            }
        }

        if (CONTROL_FWD & held)
        {
            direction *= llAxisAngle2Rot(llRot2Left(direction), VTURN_SPEED);
        }
        if (CONTROL_BACK & held)
        {
            direction *= llAxisAngle2Rot(llRot2Left(direction), -VTURN_SPEED);
        }
        if (CONTROL_LEFT & held)
        {
            direction *= llAxisAngle2Rot(<0,0,1>, HTURN_SPEED);
        }
        if (CONTROL_RIGHT & held)
        {
            direction *= llAxisAngle2Rot(<0,0,1>, -HTURN_SPEED);
        }
        if (CONTROL_ROT_LEFT & held)
        {
            direction *= llAxisAngle2Rot(<0,0,1>, HTURN_SPEED);
            // Roll:
            // direction *= llAxisAngle2Rot(llRot2Fwd(direction), VTURN_SPEED);
        }
        if (CONTROL_ROT_RIGHT & held)
        {
            direction *= llAxisAngle2Rot(<0,0,1>, -HTURN_SPEED);
            // Roll:
            // direction *= llAxisAngle2Rot(llRot2Fwd(direction), -VTURN_SPEED);
        }
    }

    run_time_permissions(integer perm)
    {
        if (perm)
        {
            start();
        }
    }

    changed(integer change)
    {
        if (change & CHANGED_LINK)
        {
            if (driver = llAvatarOnSitTarget())
            {
                llRequestPermissions(driver, 3092); // All auto-perms
            }
            else
            {
                end();
            }
        }
    }

    state_entry()
    {
        llSitTarget(<0,0,1>, ZERO_ROTATION);
        llForceMouselook(TRUE);
    }
}
Edited by Wulfie Reanimator
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Hmmm, I should be able to adapt my flight script to it. If i have time and mood I'll do I think.
I wonder what happens when I press the fire button.

However here is Wulfies script again in LSL format:

float		TIMER;
float		MIN_SPEED;
float		INC_SPEED;
float		MAX_SPEED;
float		VTURN_SPEED;
float		HTURN_SPEED;
float		MIN_HEIGHT;

integer     driver_link;
key         driver;

vector      position;
rotation    direction;
float       speed;

start()
{
    llTakeControls(831, TRUE, FALSE); // All WASD controls + up/down
    driver_link = llGetNumberOfPrims();
    position = ZERO_VECTOR;
    direction = ZERO_ROTATION;
    speed = MIN_SPEED;
    llSetTimerEvent(TIMER);
    llOwnerSay((string)["Start"]);
}

end()
{
    llReleaseControls();
    llSetTimerEvent(0);
    llOwnerSay((string)["End"]);
}

default
{
    state_entry()
    {
		TIMER		= 0.05;
		MIN_SPEED	= 1.0;
		INC_SPEED	= 0.5;
		MAX_SPEED	= 85.0;
		VTURN_SPEED	= 2 * DEG_TO_RAD;
		HTURN_SPEED	= 2 * DEG_TO_RAD;
		MIN_HEIGHT	= 5;
    	
        llSitTarget(<0,0,1>, ZERO_ROTATION);
        llForceMouselook(TRUE);
    }


    timer()
    {
        position += <speed * llGetAndResetTime(),0,0> * direction;
        float ground_height = llGround(ZERO_VECTOR) + MIN_HEIGHT;
        if (position.z < (ground_height))
        {
            position.z = (ground_height);
        }
        llSetLinkPrimitiveParamsFast(driver_link, [PRIM_POS_LOCAL, position, PRIM_ROTATION, direction]);
    }

    control(key id, integer held, integer click)
    {
        if (CONTROL_UP & held)
        {
            if ((speed += INC_SPEED) > MAX_SPEED)
            {
                speed = MAX_SPEED;
            }
        }
        else if (CONTROL_DOWN & held)
        {
            if ((speed -= INC_SPEED) < MIN_SPEED)
            {
                speed = MIN_SPEED;
            }
        }

        if (CONTROL_FWD & held)
        {
            direction *= llAxisAngle2Rot(llRot2Left(direction), VTURN_SPEED);
        }
        if (CONTROL_BACK & held)
        {
            direction *= llAxisAngle2Rot(llRot2Left(direction), -VTURN_SPEED);
        }
        if (CONTROL_LEFT & held)
        {
            direction *= llAxisAngle2Rot(<0,0,1>, HTURN_SPEED);
        }
        if (CONTROL_RIGHT & held)
        {
            direction *= llAxisAngle2Rot(<0,0,1>, -HTURN_SPEED);
        }
        if (CONTROL_ROT_LEFT & held)
        {
            direction *= llAxisAngle2Rot(<0,0,1>, HTURN_SPEED);
            // Roll:
            // direction *= llAxisAngle2Rot(llRot2Fwd(direction), VTURN_SPEED);
        }
        if (CONTROL_ROT_RIGHT & held)
        {
            direction *= llAxisAngle2Rot(<0,0,1>, -HTURN_SPEED);
            // Roll:
            // direction *= llAxisAngle2Rot(llRot2Fwd(direction), -VTURN_SPEED);
        }
    }

    run_time_permissions(integer perm)
    {
        if (perm)
        {
            start();
        }
    }

    changed(integer change)
    {
        if (change & CHANGED_LINK)
        {
            if (driver = llAvatarOnSitTarget())
            {
                llRequestPermissions(driver, 3092); // All auto-perms
            }
            else
            {
                end();
            }
        }
    }
}

 

  • Like 2
Link to comment
Share on other sites

6 minutes ago, Nova Convair said:

I wonder what happens when I press the fire button.

All the usual errors or non-happenings will happen. Objects can't exist independently outside of a region, so you cannot rez things off-sim. It'll just fail silently, since I don't think there's an error associated with "rezzing out of bounds."

Personally I would create some kind of HUD that gives feedback like "weapons disabled" or "about to re-enter the region." The movement is way too extreme for any kind of in-world cockpit to be usable.

Edited by Wulfie Reanimator
Link to comment
Share on other sites

I've played with Nova's version of Wulfie's script.  It's very tricky to navigate, but the basic idea works.  It does not stay at 5 meters above ground level, however.  By the time I ended my last test flight, I was more than 100 m above the ground.  This is going to be a fun idea to play with.

Link to comment
Share on other sites

5 minutes ago, Rolig Loon said:

I've played with Nova's version of Wulfie's script.  It's very tricky to navigate, but the basic idea works.  It does not stay at 5 meters above ground level, however.  By the time I ended my last test flight, I was more than 100 m above the ground.  This is going to be a fun idea to play with.

Bad wording on my part, it'll stay at least 5 meters above ground, as in you can't fly into the ground (which it would normally do, and dislocate your camera in a weird way).

Link to comment
Share on other sites

1 minute ago, Wulfie Reanimator said:

Bad wording on my part, it'll stay at least 5 meters above ground

Yeah, that's what the coding says, so it's working as expected (though still tricky as hell to navigate).  I didn't mean to imply that I had found an error in the scripting. That was just my own clumsy clarification, in case anyone else took your first notes literally.  This really is a nice concept.  Well done.  ;)

  • Like 1
Link to comment
Share on other sites

On 5/6/2020 at 10:49 PM, Wulfie Reanimator said:

I went to try the demo in-world and okay, this is actual black magic until proven otherwise.

I'm completely baffled as to how this jet ski is built, and I'm staring right at it, at <934, 99, 20>
7d569c840b.png

That's a pretty innovative feature if it is doing what I think it is :)

  • Confused 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1537 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...