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

Make a Breedable Pet Bird for Second Life

This is Part 3 - Making a breedable pet bird for Second Life

Previous:Making a homing bird feeder for a breedable pet in Second Life.

XS Quail This photo is the original XS pet Quail. It is happy and well fed as it is shiny and glowing. In this article, you will assemble a similar quail.

Quail are similar to other breedable animals on the grid. They can be bred for colours. They have two colours, body and tail/wings, with the initial generation quail sporting colours of red, green and blue to start off with.

Since the original XS Quail is no longer available, I puzzled over how to make one without any instructions or guides on dimensions. Luckily, Xundra Snowpaw, the author of the original XS Pet, left behind some code that grows the birds in size. This code must be modified if you plan on making another animal. Personally. I would not do it this way. I would use an algorithm to resize and re-position the animal as it grows such as is used in my Single Script Prim Animator instead of tables of numbers as Xundra did here. Its is not an easy thing to do as it involves rotations and repositioning along with resizing, but it would be a much cleaner and more portable solution for other pets.

I have modified this code into a new script that makes it simple to make a new pet bird.

First, you need to rez 10 prims on the ground.Once you have them in place, link them all together with Ctrl-L.

It should look something like this and you can use any size or position.

10 prims

Now edit the linked set and add this script to it. The script will automatically size and position your prims into a XS quail shape.

Download the bird assembly script

10 prim assy

Once the script runs, you will end up with a small, cubical pet bird.

You can now delete the bird assembly script.

Isn't it cute!There, you just made a bird for Minecraft!So my job is done. Oh wait, this is a Second Life lesson. Dang. I like Minecraft, even though I have never played it.

The bird as it first appears: I have colored the prims so you can see them:
Cube bird after

You should not resize, or move any prims.The bird grows from these sizes and positions and becomes larger and larger. If you wish to use this for another bird, you will have to correct all the size and positions.

But you can change the colors, shapes and rotation of any prim. The breeding process will change the body, head, tail, and wing colors, so you can leave them all white for now.

The parameters I used for each piece is as follows, with the entire bird set to rotation of <0,0,0>.To do this, edit the bird, and go to the Object Tab, and change the Rotation X,Y and Z to 0

rotation

Now edit each part and set the shapes and rotations for each part. Do not move the prims or resize them, but you are allowed to rotate them and change their properties.

Head: Sphere texture: none (white)

Beak : Cylinder, Taper X= 1.0 Y=1.0, rotation: <0, 90, 0> texture: none (white) Color RGB(255,128,0) “Orange”, shine = Low

Wings : Sphere: L rotation <310, 0, 90>, R rotation <57, 0, 90> texture: none (white)

Tail : Cylinder: X taper = -1, Y taper = -1, rotation &lt0, 320, 0>, texture: none (white)

Legs : Cylinder, texture: none (white) Color RGB(255,128,0) “Orange”, shine: low

Body : Sphere, texture: none (white), and I stretched mine out to make an oval

Eyes : Sphere, texture: none (white), color black, shine: low

I colored mine orange and red and black for you to see, though the actual colors are determined by the breeding process:

Now your pet bird should look like this:

After reshaping

Put a copy of the Homing Post inside the bird, too. One of the menu options when people click their bird is to get a copy of the Homing post.

Scripting Your bird

Note: This bird must be named 'Quail'.

You will need a bird sound. It must be named 'bird_sound'. I used this 'wark' sound. You can get great free sounds at http://www.freesound.org.

Download the bird sound

Upload the sound and add it to the bird's root prim.

Now add the following scripts into the bird:

Important: all of these scripts must be named correctly!

Be sure to change the string SECRET_PASSWORD = "top secret"; to something else!

If you are using the original code, be sure to change the key YOUR_UUID = "00000000-0000-0000-0000-000000000000"; to your avatar key. If you are using my modified scripts, you can skip this step.

xs_ager
xs_breeding
xs_eater
xs_infomatic
xs_movement
xs_special

Update 10-24-2011 You must put the scripts in the bird in the correct order

Put all the scripts EXCEPT xs_brain inside the bird and compile them. They MUST be named correctly, or the bird will die and delete all your scripts when xs_brain is loaded!

Add the brain

Add the xs_brain script and compile it.

Update 11-15-2011 - The modified xs_breeding v 0.24 had a script mistake in it that I made. It is now at V0.25.

The error is in state male, the constant is LINK_CALL_MALE, should be LINK_CALL_MALE_INFO

I have resaved the zip file on the web site, and am including a copy of the entire script here after this detailed spot where the problem is.


if (num == LINK_RQST_BREED) {
	if (mother != NULL_KEY) {
		llMessageLinked(LINK_SET, LINK_CALL_MALE_INFO, "", mother);          // error by Ferd, was LINK_CALL_MALE, should be LINK_CALL_MALE_INFO
	}
}
			

If you rez the bird, it will die. Birds must be born from an egg, or they must be reborn from a Ccryo-crate.

There are several reasons the bird can die: The bird was rezzed without a start param, which comes from an egg or crate. Someone, not the creator, reset the script. There must be a RUNNING xs_ager, xs_infomatic, xs_breeding, xs_eater, xs_movement script There must be a sound file named bird_sound. There must be a XS Home Object, XS Egg, and Quail Objects. There must be an xs_special script

If you have done this step correctly, all your scripts will still be in the bird. They MUST be named correctly, or the bird will die and delete all your scripts when xs_brain is loaded. If you are missing a script, then the bird will switch to state 'dead' and remove the scripts.

If you rename any scripts, you must also change the code in xs-Brain that checks for the correct scripts. This was apparently done as a security measure, so that anyone who added a script or tampered with the pets would end up with a dead bird with no scripts.

The line of code that does this is Line 292 in the xs_brain. You can add a // comment to the front of this if you wish to disable the security feature.

bird contents

Add a copy of the homing post from your inventory to the bird.

Permissions

Set the permissions on the scripts in your bird to no modify. You should also set the outer-most permissions of the bird to no mod so that people cannot put scripts inside your birds to feed them.

How to Use

Now that you have assembled the bird, take it into inventory. In the next section, you will put it into an egg.

Each bird must be stored in an Egg or a crate. Birds must be rezzed from a Egg or a Crate.The next lesson will teach you how to make an egg and from it, give birth to your first baby bird!

Next - Part 4 - Making an Egg

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