In the let’s make a breedable series, the scripts were tuned for single prim meshes. The most noticable issue will be the colour is not set on the whole linkset, but rather just the root prim.
Fixing the Colour To fix this, you’ll need to replace the single llSetColor instance in the brain script (look for the following snippet, it’s towards the end…)
link_message(integer sender, integer number, string message, key id) { if (number == 100) { if (llGetOwnerKey(id) == llGetOwner()) { list data = llParseString2List(message, ["^"], []); if (llList2String(data, 0) == "PET_DATA") { llAllowInventoryDrop(FALSE); my_colour_trait = (vector)llList2String(data, 1); llLinksetDataWrite("colour-trait", (string)my_colour_trait); sex = (integer)llList2String(data, 2); llLinksetDataWrite("sex", (string)sex); llLinksetDataWrite("age", "0"); llLinksetDataWrite("home-position", (string)llGetPos()); llLinksetDataWrite("range", "3.
Read more
If you’ve tried using the XTEA encryption code I referenced in the “Let’s Make a Breedable” blog series on OpenSim, you may have noticed it failing inconsistently.
The reason it fails is due to difference in the llBase64ToString in opensim and Second Life, and the fact that the XTEA code pads zeros to the Base64 string it is to decode.
Sometimes, there will be extra junk characters at the end of the decoded string, which may throw off your breedable.
Read more
I’ve been working on setting up Xundra’s Little Grid - this time, locked down with no hypergrid.
Why?
Well, one of my main goals in Second Life is to make breedables affordable. They should be fun for everyone - but not everyone can afford land to put them on. A region in SL costs quiet a lot, and is out of reach for many (including myself).
So, I thought I’d make an opensim grid that people could rent regions from me much cheaper, and could transfer breedables between them.
Read more
Update Cubes As time goes by, you will likely find bugs or make improvements to your breedable, so you need a way to update your pets to the latest version. To keep things simple, we’re just going to update live pets. Eggs can be updated when they are hatched.
The basic flow of updating with an update cube is:
Breeder clicks update on pet. Pet broadcasts looking for update cube, includes it’s version.
Read more
The Starter Egg The starter egg is similar to the ordinary egg script, except it doesn’t need to be birthed, so we can remove some code. We do need to decide how we will choose the starter trait, be it random or set. Often colour based breedables start with primary colours (Red, Green or Blue) however in this tutorial it will just be random.
We will need to make two versions of this script, one for male and one for female.
Read more
In this part we are going to extend our brain script to support interaction with the owner of the pet to do things like freeze, set home, range, name and so on. These changes will be done in the running state.
First we will need some additional global variables.
integer dialog_channel; integer dialog_listener; integer range_channel; integer range_listener; integer name_channel; integer name_listener; integer is_frozen = TRUE; integer interbreed = FALSE; Now for our modified running state, which I will break up and add comments in between
Read more
The Egg The egg object will only have one script in it with four states, a default state, a full state, a hatching state and a dead state. We will also need some variables from our other scripts, namley the “EGG_CHANNEL”, the “SUPER_SECRET_KEY” from Part 1 and the SECRET_REZ_NUMBER from part 4. We will also need the XTEA encryption code from part 1 and your avatar’s UUID. (You could use llGetCreator(), but only if you are actually the creator of the object).
Read more
Breeding First, each pet must have a trait, or a series of traits. For our pet, to keep it simple will have one trait - it’s colour. We will assume this colour vector is set in linkset data as “colour-trait”, later on when we birth an egg we will actually assign the colour trait.
The method for deciding which trait your baby will have is entirely up to you, but for this example using colours, we will make it a mixture of the two colours, with a small random deviation.
Read more
Movement Movement can vary, for example a pet that flies or hops would have different movement code than one that crawls along the ground. In this tutorial we are going to go with crawling along the ground as it is the simplest.
We start the script the same as the ager and hunger script with a default state that waits for a signal to begin. The SPEED vairiable is how fast to walk in metres per second.
Read more
Aging In this part we will be working on three scripts, one for aging, one for eating and a food bowl. The first thing we need to do is create the default state, this default state will do nothing but wait for a signal from the main script that it’s time to start. The reason for this is that we don’t want the age or hunger timers to start before the pet is born.
Read more