Lets Make a Breedable - Update 1

Posted on

Part 5 - The Egg

There is a problem in part 5, where if the owner attaches the egg, instead of rezzing it, it will not die after hatching. As far as I can tell, this shouldn’t be a huge issue, as the egg will be useless, but people might try and pass off a broken egg as a working one and scam people.

To work around this, we need to add a check to see if the egg is attached on hatching. If it is attached, do not hatch, but inform the owner to rez the egg instead of attaching it.

This would be the new touch_start function in the full state:

        touch_start(integer detected) {
            if (llDetectedKey(0) == llGetOwner() && llGetAttached() == 0) {
                dialog_listener = llListen(dialog_channel, "", llGetOwner(), "");
                llSetTimerEvent(60);

                llDialog(llGetOwner(), "Hatch this Egg?", ["YES", "NO"], dialog_channel);
            } else if (llGetAttached() != 0) {
                llOwnerSay("Please rez me on the ground to hatch.");
            }
        }

Part 5 has been updated with this fix.