Building in a box

Building using prims, sculpties and meshes. Texture creation techniques.
User avatar
Your Teacher
Posts: 55
Joined: Fri Jan 04, 2013 8:52 am
Has thanked: 23 times
Been thanked: 17 times
Contact:

Building in a box

Post by Your Teacher »

My (probably silly) question is, how do I package a house in a rez box? I've been looking for a rez script for Open Sim, but so far can't find one anywhere. Any ideas?

Thanks.
User avatar
Marstol Nitely
Posts: 480
Joined: Mon Dec 24, 2012 1:42 am
Has thanked: 1019 times
Been thanked: 432 times

Re: Building in a box

Post by Marstol Nitely »

Hey Teach -
Here's a link to scripts for the OpenSim Builders Buddy.
http://forums.osgrid.org/viewtopic.php? ... 4&start=10
These users thanked the author Marstol Nitely for the post (total 2):
Your TeacherBladyblue Bommerang
User avatar
Your Teacher
Posts: 55
Joined: Fri Jan 04, 2013 8:52 am
Has thanked: 23 times
Been thanked: 17 times
Contact:

Re: Building in a box

Post by Your Teacher »

Thanks Marstel,

I did wonder about Builders Buddy, but am still not sure about the compatability of LS language in OS, I have had problems with crash detector for a door script, it just doesn't work so I'm having to teach everyone to open doors. :)
User avatar
Marstol Nitely
Posts: 480
Joined: Mon Dec 24, 2012 1:42 am
Has thanked: 1019 times
Been thanked: 432 times

Re: Building in a box

Post by Marstol Nitely »

The link is for the second page of a thread on OSGrid with the subject line "Builders Buddy 1.10 for Opensim". I linked to the second page because they had further modified the script. I haven't used it, so I can't actually vouch for it.
These users thanked the author Marstol Nitely for the post:
Your Teacher
User avatar
Constance Peregrine
Posts: 2348
Joined: Sun Dec 23, 2012 11:35 am
Has thanked: 2778 times
Been thanked: 1479 times

Re: Building in a box

Post by Constance Peregrine »

Your Teacher wrote:Thanks Marstel,

I did wonder about Builders Buddy, but am still not sure about the compatability of LS language in OS, I have had problems with crash detector for a door script, it just doesn't work so I'm having to teach everyone to open doors. :)
maybe one of these will be helpful-))

Code: Select all

// deluxe door script by Ezhar Fairlight
// features: one prim, no building skills required, automatic closing, workaround for rotation drift,
// doesn't mess up when moved, adjustable direction (inwards/outwards) and sound volume, HHGG quotes!
// updated for SL 1.5

// just rez a cube primitive and put this script inside - it will shape and texture itself into a door

// ********** SETTINGS HERE ************
float       TIMER       = 30.0;      // automatically close the door after this many seconds,
                                    // set to 0 to disable automatic closing

integer     DIRECTION   = 1;       // direction door opens in. Either 1 (outwards) or -1 (inwards);

float       VOLUME      = 0.8;      // sound volume, 1.0 loudest, 0.0 to disable sound
// ********** END OF SETTINGS **********


key         SOUND_OPEN  = "cb340647-9680-dd5e-49c0-86edfa01b3ac";
key         SOUND_CLOSE = "e7ff1054-003d-d134-66be-207573f2b535";

vector      gPos;      // door position (objects move a tiny amount
                        // away from their position each time they are rotated,
                        // thus we need to workaround this by resetting
                        // the position after rotating)
                       
door(integer open) {
    if (open) {
        llTriggerSound(SOUND_OPEN, VOLUME);
        llSetRot(llEuler2Rot(<0, 0, -DIRECTION * PI_BY_TWO>) * llGetRot());
    } else { // close
        llSetRot(llEuler2Rot(<0, 0, DIRECTION * PI_BY_TWO>) * llGetRot());
        llTriggerSound(SOUND_CLOSE, VOLUME);
    }
}
       

default {   // first time startup
    state_entry() {
        if (llGetTexture(0) == "89556747-24cb-43ed-920b-47caed15465f") { // is default texture, set it up
            llSetPos(llGetPos() + <0, 0, 3.325 / 2 - 0.25>);
            llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, PRIM_HOLE_DEFAULT, <0.375, 0.875, 0>, 0.0, ZERO_VECTOR, <1, 1, 0>, ZERO_VECTOR,
                PRIM_SIZE, <0.2, 4, 3.325>,
                PRIM_TEXTURE, 0, "086c7e6b-bdd6-7388-f146-f3d1b353ed15", <2.000000, 0.060000, 0.000000>, <0.500015, 0.469985, 0.000000>, 1.570840,
                PRIM_TEXTURE, 1, "086c7e6b-bdd6-7388-f146-f3d1b353ed15", <-2.000000, 1.000000, 0.000000>, <0.500015, 0.000000, 0.000000>, 0.000000,
                PRIM_TEXTURE, 2, "086c7e6b-bdd6-7388-f146-f3d1b353ed15", <0.100000, 1.000000, 0.000000>, <0.599994, 0.000000, 0.000000>, 0.000000,
                PRIM_TEXTURE, 3, "086c7e6b-bdd6-7388-f146-f3d1b353ed15", <2.000000, 1.000000, 0.000000>, <0.500015, 0.000000, 0.000000>, 0.000000,
                PRIM_TEXTURE, 4, "086c7e6b-bdd6-7388-f146-f3d1b353ed15", <2.000000, 0.080000, 0.000000>, <0.500015, 0.550005, 0.000000>, 1.570840,
                PRIM_TEXTURE, 5, "086c7e6b-bdd6-7388-f146-f3d1b353ed15", <0.100000, 1.000000, 0.000000>, <0.449995, 0.000000, 0.000000>, 0.000000,
                PRIM_TEXTURE, 6, "086c7e6b-bdd6-7388-f146-f3d1b353ed15", <0.100000, 1.000000, 0.000000>, <0.449995, 0.000000, 0.000000>, 0.000000]
            );
            llSetObjectName("Door");
        }
        gPos = llGetPos();  // remember where we're supposed to be
        door(TRUE);
        state closed;
    }
}
   
state closed {  // door is closed
    on_rez(integer start_param) {
        gPos = llGetPos();
    }

    state_entry() {
        door(FALSE);
    }

    touch_start(integer total_number) {
        state open;
    }

    moving_end() {  // done moving me around, store new position
        gPos = llGetPos();
    }
}

state open {    // door is open
    on_rez(integer start_param) {
        gPos = llGetPos();
        state closed;
    }

    state_entry() {
        llSetTimerEvent(TIMER);
        llSetPos(gPos); // rotation drift workaround
        door(TRUE);
    }
   
    touch_start(integer num) {
        state closed;
    }
   
    timer() { // auto-close
        state closed;
    }
   
    moving_start() { // close when being moved
        state closed;
    }
   
    state_exit() {
        llSetTimerEvent(0);
    }
}

Code: Select all

// Smooth Door Script - Version 1.1
// by Toy Wylie
// swing on z axis changes by Clarke Kondor
// Distributed under the following licence:
// - You can use it in your own works
// - You can sell it with your work
// - This script must remain full permissions
// - This header notice must remain intact
// - You may modify this script as needed
 
float openingTime=2.0;      // in seconds
float openingAngle=-90.0;    // in degrees
float autocloseTime=5.0;    // in seconds
integer steps=4;            // number of internal rotation steps
integer useOmega=TRUE; 
float omega=0.0;
 
vector axis;
rotation closedRot;
rotation openRot;
 
integer swinging;
integer open;
 
openDoor(integer yes)
{
    vector useAxis=axis;
    open=yes;
 
    if(!yes)
        useAxis=-axis;
 
    llSetTimerEvent(openingTime/(float) steps);
    if (useOmega) llTargetOmega(useAxis,omega,1.0);
}
 
go()
{
    if(swinging==0)
    {
        if(!open)
        {
            axis=llRot2Up(llGetLocalRot());
            closedRot=llGetLocalRot();
            openRot=llEuler2Rot(<0.0,0.0,openingAngle>*DEG_TO_RAD)*closedRot;
        }
        swinging=steps;
        openDoor(!open);
    }
}
 
rotation  slerp(rotation source,rotation target,float amount)
{
    float startAngle = llRot2Angle(source);
    float endAngle = llRot2Angle(target);
    
    //llOwnerSay((string)startAngle+ " " + (string)(startAngle*RAD_TO_DEG));
    //llOwnerSay((string)(endAngle*RAD_TO_DEG));
   // llOwnerSay(llRot2Axis(source*target));
    float thisAngle = (endAngle-startAngle) * amount + startAngle;
    //llOwnerSay((string)(thisAngle*RAD_TO_DEG));
    //if (thisAngle > PI) thisAngle -= TWO_PI;
    //llOwnerSay((string)(thisAngle*RAD_TO_DEG));
    
    rotation newRot;
    newRot = llAxisAngle2Rot(llRot2Axis(source*target),thisAngle);
    //newRot = llAxisAngle2Rot(<0.0,0.0,1.0>,thisAngle);
    //newRot = llAxisAngle2Rot(xaxis,thisAngle);
    return newRot;
}
 
default
{
    state_entry()
    {
        swinging=0;
        open=FALSE;
        omega=DEG_TO_RAD*openingAngle/openingTime;
        //omega=TWO_PI/360*openingAngle/openingTime;
        if (useOmega) llTargetOmega(ZERO_VECTOR,1.0,1.0);
    }
 
    touch_start(integer dummy)
    {
        go();
    }
 
    collision_start(integer dummy)
    {
        go();
    }
 
    timer()
    {
        if(swinging>0)
        {
            swinging--;
            if(swinging!=0)
            {
                float amount=(float) swinging/(float) steps;
                if(open)
                    amount=1.0-amount;
                llSetLocalRot(slerp(closedRot,openRot,amount));
                return;
            }
 
            if (useOmega) llTargetOmega(axis,0.0,0.0);
            if(open)
            {
                llSetLocalRot(openRot);
                llSetTimerEvent(autocloseTime);
            }
            else
            {
                llSetLocalRot(closedRot);
                llSetTimerEvent(0.0);
            }
        }
        else // autoclose time reached
        {
            llSetTimerEvent(0.0);
            openDoor(!open);
            swinging=steps;
        }
    }
}
These users thanked the author Constance Peregrine for the post (total 4):
Bladyblue BommerangRuby O'DegeeYour TeacherMichael Timeless
Laissez faire et laissez passer, le monde va de lui même!
My little sounds store https://www.kitely.com/market?store=2040306

Ephemeral wanderer...
Dameon Nightfyre
Posts: 1
Joined: Tue Aug 06, 2013 11:23 pm
Has thanked: 0
Been thanked: 0

Re: Building in a box

Post by Dameon Nightfyre »

Hey guys, Just joined into Kitely and am importing all my builds from SL. 2 questions and an observation... 1) The first of the two door scripts below is great but how do you change it so that it doesn't auto-build the door so I can throw it into the existing doors I have? 2) I am also in need of a rezbox script for my builds. I checked out Builder Buddy but it seems to throw off some script errors when trying to use it...

(0): OSSL Runtime Error: osMakeNotecard permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.

That comes from the piece using the component script. Anyone else run into this and found a work around? Or has anyone found another system that works good? A rezzer system is critical for the business that I plan to set up.
User avatar
Constance Peregrine
Posts: 2348
Joined: Sun Dec 23, 2012 11:35 am
Has thanked: 2778 times
Been thanked: 1479 times

Re: Building in a box

Post by Constance Peregrine »

Welcome Dameon-))

others will, I am sure, answer your specific script questions, I know very little on them.
Laissez faire et laissez passer, le monde va de lui même!
My little sounds store https://www.kitely.com/market?store=2040306

Ephemeral wanderer...
User avatar
Sarge Misfit
Posts: 254
Joined: Thu Mar 14, 2013 4:10 pm
Has thanked: 5 times
Been thanked: 223 times

Re: Building in a box

Post by Sarge Misfit »

In the interests of keeping things organized, I posted two door scripts in the Scripting forum http://www.kitely.com/forums/viewtopic.php?f=26&t=603

I recetnly used the Door Hinge script without error.
I can't remember the last time I used the sliding door script. I definitely don't recall any errors with it, though.
Living life on the wrong side of a one-track mind.

National Security Threat Level: Gnat

My site: Excelsior Station
My Kitely World: Misfit's Folly
User avatar
beverly Zauberflote
Posts: 76
Joined: Sat Nov 22, 2014 6:53 pm
Has thanked: 68 times
Been thanked: 35 times

Re: Building in a box

Post by beverly Zauberflote »

Dameon Nightfyre wrote:(0): OSSL Runtime Error: osMakeNotecard permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.
i am having the exact same error....wondering if anyone has a fix?

i figured it out! i was in the sandbox and apparently it has something to do with permissions there. on my own sim all worked perfectly! :)
Last edited by beverly Zauberflote on Wed Nov 26, 2014 4:15 pm, edited 1 time in total.
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1141 times

Re: Building in a box

Post by Graham Mills »

I suspect you need to be the owner of the world?
beverly Zauberflote wrote:
Dameon Nightfyre wrote:(0): OSSL Runtime Error: osMakeNotecard permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.
i am having the exact same error....wondering if anyone has a fix?
Post Reply