Join us in Outworldz at www.outworldz.com:9000 or follow us:

How to free Lucy the Angel, and allow her to live in a dragon-egg house

Lucy is an angel that wants to fly and live in a dragon egg. She has been stuck in the Stanford 3D Scanning Repository as very large 116 million triangle angel, but she really wants to be a 2-prim angel and to be able to fly. She wants to live in a 5-prim dragon egg.

So she needs your help! Once you have brought Lucy into your virtual world, just click her dragon egg home. It will open like a flower and let her roam around. Clicking her home again calls her back, and she will wait for you to summon her again.

Lucy can fly in Second Life and OpenSim grids, or any other virtual world that supports mesh objects.

How to Free Lucy

The first step is to upload the mesh pieces. Right click and save this as "egg.dae"

Download my Lucy model

Go to The Uploader menu in your viewer. This picture below is the one in Phoenix.

You can use the defaults for the Level of Detail. But if you want to keep the number of prims it uses to a minimum, set the numbers next to Medium, Low and Lowest to 0 as shown below. The downside to changing these to 0 is that when you step away from the egg, it will go invisible instead of degrading in quality.

Give your egg a name:

Select the physics tab next. Set the level of detail to Lowest. We are not using physics so this will save prims.

Now select the Upload options tab and select 'Include Textures' and change the scale to "0.100".

Press Calculate Weights and fees, and then upload the model.

The model will be rather "primmy" due to the eggs being made of mesh. For those of you in Second Life, you can replace them in a later step with prim egg shells.

It should rez and look like this:

Taking apart the egg

The first step is to extract the angel.

Edit the egg and press CTRL-SHIFT-L to unlink it.

Move one of the egg sides away from the egg so you can see inside it. Edit the angel, her wings and the lamp flame, and pull them out and to one side as shown below:

OpenSim users can use the egg as-is as they are not penalized by mesh weights. Second Life users will want to change the egg into a prim-based egg to save on prims.

If your Lucy textures did not load, here is the texture for her body, and the flame:

OpenSim users can skip these next steps and go directly to Linking Your Egg. Second Life users will want to replace the egg with prims as shown next.

Lowering the Prim Count with prims

The mesh egg shells are very primmy. But you can replace them with prim egg shells rather easily.

Make a cube and set it to type "sphere".

Set the Path cut "B" to 0.5 and the Hollow to 0.95 and place it where the bottom of the mesh egg cup is. My dimensions were <0.70, 0.795, 1.00>,

Path cut sphere

I chose to add this texture, but you can leave yours white, or add a touch of color to it. Right click the texture, save it, upload it and apply it to your egg shape.

Now make another sphere and set it to a hollow of 0.95 and a path cut 'B" of 0.75. The size of mine was set to <0.75, 0.75, 2.1000>:

egg top

Copy and rotate the egg top and place them on top of the base:

copies

I made this texture by combining a background from my Free Seamless Texture collection with a dragon:

Egg top

Right click and download the texture, upload it to Second Life, and apply it to the egg halves as shown below.

I also repeated the texture 4 times vertically and set a vertical offset of -0.4 to center it:

Now we need a replacement ring band around the middle.

Make another prim, and set it to type "torus".

torus

Flip the torus upright, and change the Hole Size Y to 0.11, and the size to <0.12, 0.9, 0.9>

TOrus edited

I textured mine with this gold texture, just right click it, save it, and upload and put it on the torus.

Gild

I also set the texture repeat vertical to 5.4 to make it look smoother:

textured

Now position it over the center of the egg

Center the ring

Linking Your Egg

Now that you have extracted the angel, her wings and the flame tip, select the pieces of the egg in this order:

Top Left
Top Right
Egg Base
Egg Ring
Claw

Now press CTRL-L to link them. The dragon claw base should turn yellow.

Let Lucy Fly Free

Okay, lets take a break and get Lucy flying around. We'll finish up the egg after she is free.

Go into edit mode, select the glowing tip of the flame, and set it to a glow of 0.1 to 0.3 or so.

Now edit just the wings, add a new script, and change the script to this piece of code:

default {
    state_entry() {
        llSetTextureAnim(ANIM_ON | LOOP, ALL_SIDES, 1, 2, 0.0, 0.0, 10.0);        // 2 fps
    }
}

As soon as you do this, the wings should start flapping. Position the wings low on her back and close to her body.

Select the flame, the wings, then lastly, the body, and link them together with CTRL-L. The angel body should turn yellow.

Now give her the name "Lucy". This needs to be done just this way or the egg will not work.

Now edit the angel and add one more script.

float distance = 4;        // how far to roam
float mintime = 0.5; // minimum time in one spot
float maxtime = 2; // max time in one spot

vector startPos;        // Egg position
rotation startRot;      // and rotation
integer channel;        // a random channel for privacy


// Init is called when rezzed or Lucy is reset for debug
Init()
{
    startPos= llGetPos();
    startPos.z+= 1;
    startRot = llGetRot();  // save initial pos and rot

    llSetPos(startPos);
    llSetTimerEvent(1);     // fly every second
    channel  = llListen(channel,"","","");   // listen for command
}


// This is an OpenSim compatible llLookAt()!
face_target(vector lookat)
{
    rotation rot = llGetRot() * llRotBetween(<0.0 ,0.0 ,1.0 > * llGetRot(), lookat - llGetPos());
    llSetRot(rot);
}

/// returns random number between min and max
float random_float( float min, float max )
{
    return min + ( llFrand( max - min ) );
}

// get a new position
GetNewPos()
{

    float randX = random_float(1,distance) - distance/2;   // +/- distance meters in  X
    float randY = random_float(1,distance) - distance/2;   // and Y

    vector newPos = startPos + <randX,randY,0>;
    face_target(newPos);
    llSleep(0.5);
    llSetPos(newPos);
}

default
{
    state_entry()
    {
        Init();
    }


    on_rez(integer p)
    {
        channel = p;
        Init();
    }

    timer()
    {
        GetNewPos();
        llSetTimerEvent(random_float(mintime,maxtime));
    }

    listen( integer channel, string name, key id, string message )
    {
        if (message == "close")
        {
            face_target(startPos);
            llSleep(1);
            llSetPos(startPos);
            llSleep(1);
            startPos.z = startPos.z - 1;
            llSetPos(startPos);
            llSleep(1);
            llDie();
        }
    }


}

As soon as you save this script, the angel should flit around and flee like a fly thru the flue. Don't worry, she will only go 4 meters, anywhere from 1/2 to 2 seconds. These times and distances are controlled by the first three lines of code.

Now take a copy of Lucy for your inventory and let her roam around a bit while we go back the her egg home.

Animating the Egg

We are going to animate the egg to open and close with my One script Prim Animator. The first thing you need is a blank note card named "Movement". I right clicked my inventory, and created a new note card, and renamed it to "Movement". Then drag the note card into the egg Contents as shown below:

Now download the animator script:


Download

This will give you a text file. Open it with Wordpad, not the default Write text editor. If its all one mashed together line, it's still okay. Highlight all the text and copy it with Ctrl-C. Put the script inside Lucy's Object tab along with the note card and compile it. Then click the egg and you should get this menu:

Click the Menu item "Name". Instructions will appear in chat.

Your next step is to go to the main chat window and type "/600 closed" and press Enter. If the channel number it chatted to you is different, use that number.

The Menu will re-appear with a new button and chat will appear like this:

Here is the new button that appears. For now, ignore it.

Edi the egg and base and select "Edit Linked Parts". Now press the shift key and unselect the base.

Move the egg slightly, and click RECORD

Now click the menu Item "NAME"

Go to chat and type in "/600 opened".

A new menu item will appear:Again, ignore it.

Position the two egg halves to the open position. I chose a -45 degree angle for mine:

One the prims are positioned, click "Record".

You can now click "opened" and "closed" menu items and the egg should swing open and closed. If you goofed up, just click "reset" and start over.

Dumping the data

Click the "Notecard" button in the menu and you will see some chat being typed that looks like this:

You need to use your mouse and select everything in chat from the line that contains |start| to the end of the chat, and press CTRL-C to get a copy.

Edit the notecard "Movement" that is inside your Lucy, and paste the text in. Save the noteccard.

Now edit the Animator script and find the line that says "integer runtime = FALSE;" and change it to TRUE as shown below.

When you save the script, the egg should snap shut and snap open again.

Add Lucy

Now put a copy of Lucy inside the egg:

Add the Egg script

Now add one more script to your egg:

integer channel;

integer opened = FALSE;
float height = 0.5;	// how high to appear
default
{
    state_entry()
    {
        channel = llCeil(llFrand(1384657) + 23985); // get a secrt channel
        llMessageLinked(LINK_SET,1,"closed","");
    }

    touch_start(integer p)
    {
        if (opened)
        {
            llShout(channel,"close");   // recall Lucy
            llSetTimerEvent(2);         // and close in 2 seconds
        }
        else {
            llMessageLinked(LINK_SET,1,"opened","");    // open the egg
            opened = TRUE;
            llRezObject("Lucy",llGetPos() + <0,0,height >,<0,0,0>,llGetRot(),channel);  // rez Lucy
        }
    }

    on_rez(integer start_param)
    {
        llResetScript();
    }

    timer()
    {
        llMessageLinked(LINK_SET,1,"closed","");
        opened = FALSE;
        llSetTimerEvent(0);
    }


}

Once you have compiled this script, the egg should snap shut, trapping Lucy inside.

Now click the egg and free Lucy. Click it again and she should return.

Congratulation! You have freed Lucy and let her fly!

Back to the Best Free Tools in Second Life and OpenSim.