Dragon Library

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.

PartScriptGives the agent
Sensedragon_sense.lslinspect: queries about the region, parcel, avatars and itself
Watchdragon_watch.lslwatch: watches you set up by chat
Motiondragon_motion.lslmove: follow, orbit, go to...
Shapedragon_shape.lslshape: 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.

QueryWhat it tells the agentLSL used
regionName, avatars and agent limit, FPS, time dilation, estate, region type, max primsllGetRegionAgentCount, llGetRegionFPS, llGetRegionTimeDilation, llGetEnv
parcelName, description, owner, group, area, prims used / max, music URLllGetParcelDetails, llGetParcelPrimCount, llGetParcelMaxPrims, llGetParcelMusicURL
avatarsEveryone in the region (up to 25): name, distance, away / busy / sitting / flying / typing, same group, your friend, languagellGetAgentList, llGetAgentInfo, llSameGroup, llIsFriend, llGetAgentLanguage
avatarOne avatar in detail: username, position, attachments count, plus the abovellGetObjectDetails, llGetAttachedList, llGetUsername
searchThe 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
senseA sweep around the object: avatars, objects or scripted things within a range (up to 96 m), optionally by namellSensor
environmentTime of day in the region, sun direction, wind, water and ground heightllGetTimeOfDay, llGetSunDirection, llWind, llWater, llGround
selfThe object's position, rotation, region corner, prim countllGetPos, llGetRot, llGetRegionCorner

Watches

Set them up by talking to your agent; they run in-world every 5 seconds and report only when they fire.

WatchFires whenExample
nearSomeone 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.”
arriveSomeone (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.”
crowdThe 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.

MoveWhat it doesExample
followStays a distance from someone (default 2 m), facing them“Sarah, follow me.”
orbitCircles 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_atTurns to keep facing someone“Watch me.”
go_toGoes to a position, or to a person: stops next to them, facing them“Go to <120, 80, 23>.” “Come over to Hannah.”
pathVisits 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.”
teleportJumps 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.”
statusWhere 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?”
wanderDrifts around within a radius of home“Wander around the garden, 8 m.”
come_back / stopReturn 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).

  1. Make a tiny prim (transparent and phantom if you like), name it exactly Dragon Scout, put dragon_scout.lsl in it, and make it copyable.
  2. 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”.

  1. Make a plain cube, name it exactly Dragon Block, put dragon_block.lsl in it, and make it copyable.
  2. 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, plywood and transparent always work.
  3. Put the cube in your agent's contents, with dragon_build.lsl next to dragon_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.

ActionWhat it doesExample
home / ejectTeleport 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 / unbanThe parcel ban list, for some hours or for good“Ban him for a day.”
pass_add / pass_removeThe parcel access (pass) list“Give Hannah access for a week.”
pushPush them away (where the parcel allows pushing)“Push him back.”
returnReturn 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

NumberDirectionstrid
9110API → toolkitActions {"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
9117toolkit → API{"id","result"}: a query's answer (sense)NULL_KEY
9118toolkit → API{"type":"hello","part":"sense|watch|motion|shape"} on start (only watch gets rules back); {"type":"rule","rule","who"|"count"} when a watch firesNULL_KEY