Region & motion parts
Four parts of the Dragon Library let an agent look at the region, keep watch, move around and change how it looks. Each is one small script with its own 64 KB; add the ones you want next to dragon_api.lsl. The agent gets a part's tools only once that script has said hello. Mind plan and up.
| Part | Script | Gives the agent |
|---|---|---|
| Sense | dragon_sense.lsl | inspect: queries about the region, parcel, avatars and itself |
| Watch | dragon_watch.lsl | watch: watches you set up by chat |
| Motion | dragon_motion.lsl | move: follow, orbit, go to... |
| Shape | dragon_shape.lsl | shape: size, colour, glow, light... |
Like every Library part, they hold no logic: the server decides, the scripts look, report and act. A Dragon Installer that drops in the parts for you is planned.
Queries
The agent uses its inspect tool; you just ask. Each query runs the LSL functions below and returns compact JSON.
| Query | What it tells the agent | LSL used |
|---|---|---|
region | Name, avatars and agent limit, FPS, time dilation, estate, region type, max prims | llGetRegionAgentCount, llGetRegionFPS, llGetRegionTimeDilation, llGetEnv |
parcel | Name, description, owner, group, area, prims used / max, music URL | llGetParcelDetails, llGetParcelPrimCount, llGetParcelMaxPrims, llGetParcelMusicURL |
avatars | Everyone in the region (up to 25): name, distance, away / busy / sitting / flying / typing, same group, your friend, language | llGetAgentList, llGetAgentInfo, llSameGroup, llIsFriend, llGetAgentLanguage |
avatar | One avatar in detail: username, position, attachments count, plus the above | llGetObjectDetails, llGetAttachedList, llGetUsername |
search | The whole region, for objects by name or part of a name. A sensor only reaches 96 m and the 16 nearest, so it searches like a search party: a 3×3 grid over the region (extra points where a scan comes back full). A standard search covers its own height in a few seconds. If nothing turns up, it offers a deep search: layers every 150 m from each spot's ground up to a height you choose (for skyboxes), in the background, with an IM about every 450 m. It looks first where people are up in the sky (skyboxes usually have someone in them), stops at the first match and points the beam at it. Owner only. | a Dragon Scout node, or its own jumps (llSetRegionPos) + llSensor |
sense | A sweep around the object: avatars, objects or scripted things within a range (up to 96 m), optionally by name | llSensor |
environment | Time of day in the region, sun direction, wind, water and ground height | llGetTimeOfDay, llGetSunDirection, llWind, llWater, llGround |
self | The object's position, rotation, region corner, prim count | llGetPos, llGetRot, llGetRegionCorner |
Watches
Set them up by talking to your agent; they run in-world every 5 seconds and report only when they fire.
| Watch | Fires when | Example |
|---|---|---|
near | Someone comes within a range of the agent or of a position <x,y,z>. Filter: anyone, not you, not in its group, or a stranger (not you, not in its group, not your friend). Not again for the same person within a cooldown. | “If a stranger comes within 3 m of the door at <128,64,22>, IM me.” |
arrive | Someone (with the same filters) arrives in the region. The first look after a restart only takes note of who's already there. | “Whenever someone new arrives, follow them in slow circles and ask their favourite colour.” |
crowd | The region reaches a number of avatars (once, until it drops below again). | “Tell me when there are 20 people in the sim.” |
When a watch fires: notify (IM you), say (a fixed line), or ai: the agent gets the event with your instruction and decides (“welcome them by name and offer a landmark”). Ask “what are your watches?” or “delete watch 2” any time.
Movement
Only you (or a watch you set up) can move the agent. It moves smoothly with llSetKeyframedMotion when Second Life allows it: the scripts are in the root prim, the object is not Physical, and it uses Prim Equivalency (root physics shape Convex Hull, or mesh). Otherwise it moves in small direct steps (llSetRegionPos), which work for any non-physical object, and tells you once. Say “set yourself up for smooth motion” and it sets the root to Convex Hull and the other prims to None (check the land impact afterwards). /88 settings → Status says how it moves. It keeps to the region, stays above the ground and never goes faster than 10 m/s. Worn objects can't move.
| Move | What it does | Example |
|---|---|---|
follow | Stays a distance from someone (default 2 m), facing them | “Sarah, follow me.” |
orbit | Circles someone: radius, turns per minute, and a wobble (up and down) for different angles | “Follow me but make slow circles around me at different heights.” |
look_at | Turns to keep facing someone | “Watch me.” |
go_to | Goes to a position, or to a person: stops next to them, facing them | “Go to <120, 80, 23>.” “Come over to Hannah.” |
path | Visits points in order, any shape: triangle, square, pentagon, hexagon, circle, star, figure 8, line, or points the agent works out. Around a person (keeps up as they move), around several people in turn in one continuous move (a figure 8 around two people loops around one, then the other way around the other), or at region positions. Laps, speed, and an optional stop at each point until you say continue. You're told privately at each stop and when it's finished. | “Go around me once in a tight triangle, and stop at each corner.” “Do a figure eight around me twice.” |
teleport | Jumps at once to anywhere in the region: a position, or next to a person, facing them. Anyone sitting on it comes along. | “Teleport to the stage at <200, 40, 30>.” “Take me to whoever is highest up.” |
status | Where the current move really is (waiting at point 2 of 3, finished, lost sight of them), from the script's own reports | “Are you done?” |
wander | Drifts around within a radius of home | “Wander around the garden, 8 m.” |
come_back / stop | Return home (where it was last placed by hand) / stop where it is | “Come back.” “Stop.” |
Agent Nodes
Agent Nodes are small helper objects an agent rezzes for a job: the Dragon Scout searches the region and removes itself; the Dragon Block builds and stays (below).
- Make a tiny prim (transparent and phantom if you like), name it exactly
Dragon Scout, putdragon_scout.lslin it, and make it copyable. - Put the prim in your agent's contents, next to
dragon_sense.lsl.
When you ask for a search: if objects can be rezzed where the agent is, it rezzes a scout, which does the search and deletes itself. A deep search uses a crew of up to 4 scouts (fewer if the parcel is nearly full), each taking every 4th layer, so the whole sky takes well under a minute; the first match stops the whole crew. Each scout (when done, when the agent stops answering, or after 6 minutes at most). The agent stays put and keeps chatting, and it works when the agent is worn. If rezzing isn't allowed there: a worn agent asks you to put it down; a rezzed one jumps around itself and comes back. Either way it never goes within 2 m of the region's edge, below the ground, or onto land where objects can't enter, be built or run scripts, or where the parcel is full; and if the region restarts mid-search, the agent goes back home.
Dragon Block: building
The Dragon Block is the Node for building: houses, platforms, walls, game boards. Each block appears next to the agent (Second Life only rezzes within 10 m), flies to its spot and becomes what it's told: size up to 64 m a side, shape (box, cylinder, sphere, torus, prism, tube, ring), hollow, rotation, colour, texture, glow, full-bright, transparency, phantom, physics, light. It stays there listening, so you can say “make the roof red”, “move the house 5 m east” or “take down the wall”.
- Make a plain cube, name it exactly
Dragon Block, putdragon_block.lslin it, and make it copyable. - Textures (optional): drop full-permission textures into your agent (your inventory's Library › Textures folder has free ones). They're added to your texture library within seconds, for every agent you own, where you describe each one (“weathered beach sand”) and how many metres one copy covers. Agents pick textures by meaning, and blocks repeat them to fit their size instead of stretching them.
blank,plywoodandtransparentalways work. - Put the cube in your agent's contents, with
dragon_build.lslnext todragon_api.lsl.
Shapes beyond boxes. Blocks can be tapered (to a point: pyramids, cones), sheared, dimpled, twisted and rotated exactly, so skills get roofs (flat, shed, gable, hip, pyramid, cone, dome, barrel) and triangles: any flat triangle is one prim (a box tapered to a point and sheared), the way prim terrain mappers did it, and joined triangles make surfaces like hills or curved roofs.
Small builds the agent places directly; bigger ones (a house, a wall around the region, a checkers board) it learns as a skill that works out every block. Blocks can be one-prim doors: split opens from the middle, slide slides aside, triggered by touch, by someone coming near, or by bumping into it, and closing by themselves. Blocks can also report touches and bumps, so skills can run games. Limits: up to 250 blocks a build; only where objects may be built; every block counts toward the parcel's prims; parcels with auto-return will return them unless they're set to the land's group.
Changing how it looks
The shape tool changes the prim it's in: prim type (box, cylinder, prism, sphere, torus, tube, ring), hollow, phantom (people pass through, so you can stand inside it), size (0.01 to 64 m a side), colour, transparency, glow, full bright, light (colour and radius) and rotation. Only the parts you mention change. “Turn into a sphere.” “Hollow yourself out and go phantom so I can stand inside.” “Become a flat disc.” “Light up at night.”
Particle pointer (point_at, in dragon_effects.lsl): a glowing beam from the agent to a person or an object, which follows it, plus a private note of where it is, worked out in-world (“Blake is 23 m north-east of me, 2 m up”). “Where is Blake?” “Point to the nearest prim.” “Find the red sofa.” (searches nearby first, then the whole region). “Guide me to the landing point”: it walks there and keeps the beam on you so you can follow.
Particles (in dragon_effects.lsl): sparkles, bubbles, confetti, smoke, hearts, fire, embers, snow, rain, fireflies, fountain, vortex (a rising swirl), stars (twinkling), rainbow, mist, fireworks, halo (a spinning ring) and petals. Each takes a colour and a second colour to fade to, a size (small, medium, large) and an amount (few, normal, lots); it runs for a set time or until you say stop, and can fly to someone. “Teal hearts, lots, for two minutes.” “Snow until I say stop.” “Send Bob some sparkles.”
Land security
dragon_land.lsl does what a security orb does. It works only when the object and the land have the same owner (or the object is deeded to the land's group); /88 settings → Status says whether it has land rights. It never acts on you, and checks the person is really on your land.
| Action | What it does | Example |
|---|---|---|
home / eject | Teleport them home, or put them out of the parcel. Optionally warn first and act only if they're still there. | “Warn Bob, then send him home in 15 seconds.” |
ban / unban | The parcel ban list, for some hours or for good | “Ban him for a day.” |
pass_add / pass_remove | The parcel access (pass) list | “Give Hannah access for a week.” |
push | Push them away (where the parcel allows pushing) | “Push him back.” |
return | Return their objects on the parcel (asks you for permission once) | “Return Bob's junk.” |
Security watches: a parcel watch fires when someone (anyone, not you, not your group, or a stranger) is on your land, and the response can be a land action with a warning: “Strangers on my land: warn them, then send them home after 15 seconds.” People on your allowed list (“add Fred to my allowed list”) are never acted on. If something can't be done, you get an IM saying why.
Link messages
| Number | Direction | str | id |
|---|---|---|---|
9110 | API → toolkit | Actions {"do":"query","id","q",...}, {"do":"rules","rules":[...]}, {"do":"move","m","t","s","d","h","r","rpm","w","p"}, {"do":"shape","size","color","alpha","glow","bright","light","light_color","light_radius","rotation"} | ignored |
9117 | toolkit → API | {"id","result"}: a query's answer (sense) | NULL_KEY |
9118 | toolkit → API | {"type":"hello","part":"sense|watch|motion|shape"} on start (only watch gets rules back); {"type":"rule","rule","who"|"count"} when a watch fires | NULL_KEY |