Sitting and Standing

Corrade can be made to sit on an object found in a 5 meter range:

default {
    state_entry() {
        llInstantMessage(CORRADE, 
            wasKeyValueEncode(
                [
                    "command", "sit",
                    "group", GROUP,
                    "password", PASSWORD,
                    "range", 5,
                    "item", "poseball"
                ]
            )
        );
    }
}

and accept any animation that the object wants to trigger on Corrade. Note that Corrade still uses names to identify assets and that poseball has to be the name of an object in Corrade's proximity. The way sitting is programmed is that Corrade will scan all the objects on the simulator and look for a named primitive. It will then sort the objects from nearest to farthest and attempt to sit on the closest primitive that matches the given name (in this example, poseball).

Corrade can also be made to stand-up again:

default {
    state_entry() {
        llInstantMessage(CORRADE, 
            wasKeyValueEncode(
                [
                    "command", "stand",
                    "group", GROUP,
                    "password", PASSWORD
                ]
            )
        );
    }
}

by using the stand command.

Note that Corrade will honour sit targets, such that it will only be able to sit on a primitive if that primitive has a sit target set. For example, this script will set a sit target for the primitive that it is in:

default
{
    state_entry()
    {
        llSitTarget(<0, 0, 1>, ZERO_ROTATION);
    }
}

and Corrade will be able to sit on it. In Second Life avatars can only sit on primitives with a sit target set - anything other than that is non-compliant behaviour which Corrade does not accept (note that this is different from sitting down, which is possible).

Index


secondlife/scripted_agents/corrade/tutorials/sitting_and_standing.txt ยท Last modified: 2022/11/24 07:45 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.