Jump to content
Sign in to follow this  
Rolig Loon

Make your own Megaprims

Recommended Posts

This little script will have a short shelf life, because it's a matter of time before all viewers have built-in capability to rez prims with dimensions up to 64m.  Until then, though, don't worry if you viewer doesn't offer the feature.  The servers know how to make 64m prims.  You just need a script to do it.

Drop this script in a single prim.  You may update any of the prim's X, Y, Z dimensions by typing them in chat on channel 34 in the format X = 12.3 or Y = 55.63 or Z = 42.1 . Touch the prim to apply the new dimensions.  The script deletes itself in 5 minutes if there has been no further activity.

vector gSize;
default
{
    state_entry()
    {
        gSize = llGetScale();
        llListen(34,"",llGetOwner(),"");
    }
    
    on_rez(integer startup)
    {
        llResetScript();
    }

    listen(integer channel, string name, key id, string msg)
    {
        integer idx = llSubStringIndex(msg,"=");
        if (~idx)
        {
            string Axis = llToLower(llStringTrim(llGetSubString(msg,0,idx-1),STRING_TRIM));
            float Dim = (float)llStringTrim(llGetSubString(msg,idx+1,-1),STRING_TRIM);
            if (Dim <= 64.0)
            {
                if(~channel = llListFindList(["x","y","z"],[Axis]))
                {
                    gSize = (vector)llList2String(["<"+(string)Dim+","+(string)gSize.y+","
                    +(string)gSize.z+">","<"+(string)gSize.x+","+(string)Dim+","+(string)gSize.z+">"
                    ,"<"+(string)gSize.x+","+(string)gSize.y+","+(string)Dim+">"],channel);
                }
                else
                {
                    llOwnerSay("Error: Axis not recognized. Your message must be in the format \"X = 50.0\".");
                }
            }
            else
            {
                llOwnerSay("Prim dimensions can not exceed 64.0m in any direction.");
            }
        }
        else
        {
            llOwnerSay("Error: There must be a \"=\" sign between the axis label and the dimension.");
        }
    }
    
    touch_start(integer total_number)
    {
        llSetScale(gSize);
        llOwnerSay("The prim's size has been reset to " + (string) gSize);
        llSetTimerEvent(300.0);
    }
    
    timer()
    {
        llOwnerSay("Resizing is complete. Cleaning up now.");
        llRemoveInventory(llGetScriptName());
    }
    
    changed (integer change)
    {
        if(change & CHANGED_OWNER)
        {
            llResetScript();
        }
    }
}

 

 

  • Like 3

Share this post


Link to post
Share on other sites

one problem please ,. 

   it change x size only and keep y and z without changes .... so i can only change x 

any kindly advice ?

 can i just change x y and z  all in same time ?

thanks

Share this post


Link to post
Share on other sites

Yes, it changes one axis at a time, as written. If you want to change more than one axis, simply do it in more than one step.  Or, if you wish, change the script.  :smileywink:

Share this post


Link to post
Share on other sites

Hi Rolig! Thank you so much for creating this! It works like a dream. Quick question for you - if using it to replace regular megaprims, is there any difference in lag created? for instance, I was redoing a roof that was 4 megaprims (32x16.025) with one of these "created" megas...will it change lag for better or worse at all?

Again, thank you!

Share this post


Link to post
Share on other sites

Megaprims do not create lag.  I have no idea where that myth started, but it's incredibly hard to kill.  They have never created lag, and there's no reason why they should.  Megaprims do have other disadvantages (not visible to people with short draw distances, hard to sit on sometimes, not useful for physical objects .... ), but lag isn't one of their drawbacks.

Share this post


Link to post
Share on other sites

Oh, megas can be fun as physical objects.  Rez one, sit on it, change the altitude to 1000 meters, wait for everything to redraw you in the sky, then make it physical, and close the edit box, while quickly getting your mouse over to the chat window to see if you can type "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!!!!" before crashing into the ground :womanvery-happy:

 

I'd recommend only doing this on one's own land.

 

And yes, I have an odd sense of humor.

Share this post


Link to post
Share on other sites

And hope that the Lindens don't catch you at it if it's not on your own land.  There's no rule against using megaprims for anything else, but you can really make a sim lag BIG time by making a megaprim physical. That does not make Lindens happy.

Share this post


Link to post
Share on other sites

note that this would not seem to apply to the new expand prim sizes... we're allowed to use them in vehicles too.

(athough dropping volumes of physical objects on anyone is considered griefing and can get you AR'd)

Share this post


Link to post
Share on other sites

lol 64 meters and under isnt what i consider mega prims, now 64 and above i would, to me the script is useless. I can scale and prim to 64 meter inworls without a script. Fact still remain if an object has a script in it its will cause some lag somewhat giving the time span it is in the object.

Share this post


Link to post
Share on other sites

That's OK.  He's a newbie.  He wasn't around during the time when it was possible to make prims larger than the old 10m limit, but the viewers didn't know how yet, and he just hasn't figured out how to read dates.  :smileywink:

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...