Deal with other prims. 🔼

Some things you need other prims to do, and can't be done by the root prim.  So we need to get a script into that other prim.  So send a copy of MultiPrimDoItAll, and use the start_param to tell it what it's function is.  The prim will use a state for that function.

[url=http://wiki.secondlife.com/wiki/LlRemoteLoadScriptPin] llRemoteLoadScriptPin( key target, string name, integer pin, integer running, integer start_param );[/url]


HELPER SCRIPTS NEEDED

Tracking controls is a "one avatar per script" thing.

Sounds cannot be attached to some other prim.

Can't find out what is in the inventory of a child prim.

....Nor can I give inventory from other prims.

Different faces can't have different lights.

....Also note the OpenGL limit on light sources.

Particles might be best as LSL scripts.

[s]Alas llAvatarOnLinkSitTarget() was implemented in OpenSim 0.9.1, we are 0.8.2.

....Will have to use llAvatarOnSitTarget() in a helper.[/s]

[s]llDetectedLink() doesn't work in the collision events, though it should.  OpenSim bug?[/s]


reported=2021-03-07 10:30:23

reporter=onefang

priority=immediate

category=Feature

severity=feature

resolution=open


2021-03-07 11:29:07 onefang: Need to bootstrap the PIN by copying the script into the other prim, which the above script does then deletes itself.

If the script already exists, it is deleted and replaced by llRemoteLoadScriptPin().  So cannot be used to create multiple numbered scripts.

Note that llGiveInventory(link, itemName); WILL create a numbered copy if that name exists already, but for scripts they end up being uncompiled, so need to manually compile them.  So still not useful for this.


2021-03-07 11:55:51 onefang: [list=1]

[*]avatar sits on prim

[*]master MultiPrimDoItAll detects seated avatar and sit command

[*]checks if the sat on prim is already a slave, skips sending itself if so.

[*]sends itself to that prim with random number as startParam

[*]..If the slave doesn't respond after a timeout, complain that it needs to be bootstrapped.

[*]slave message "yo it's me " + startParam

[*]master message "you are sitting " + avatar + sit command

[*]slave uses "you are sitting" message to switch to sit state.

[*]slave checks if it's got the anims, as well as checking for .POSITIONS and such

[*]If slave already has someone sitting on it, and it can deal with multiple sitters, ask master to find a new key tracking prim.

[*]..Otherwise become the key tracking prim for avatar.

[/list]

Master will keep track of any prims without sits, and use those for extra key tracking scripts.

For prims with a bunch of poses, it can either keep the anims and related cards in itself, or point to a prim that has them.  So a multiprim bed could have one copy in it's main prim, but avatars can sit on other parts of the bed.  Multiple barstools can just point to the one that has the anims.  The link scriptlet command might work for this, or may need some tweaking so it knows to do the thing on the original prim.

On slave reset, it'll have a 0 startParam, but it'll know it's not in root, so cleans up after itself, but first asks master for the PIN.

On master reset, check for existing seated avatars.  Also sends a "Oy slaves, clean up yourselves, BTW here's your next PIN" message.


2021-03-07 12:16:37 onefang: May need to have multiple functions on a non root prim.  So check if it already is running as a slave.  That's not gonna work using LSL states for functions.

Same issue if it's already handling a seated avatar.

So maybe just a single slave state, then use a mode variable.


2021-03-08 06:05:32 onefang: NOTE - we don't get an event when a prim description is changed.  So we need to either reset MultiPrimDoItAll, or have a specific "check all descriptions, find out what changed" function.  Also - Click on prim, select "update prim" from menu.


2021-04-27 18:54:54 onefang: For multiprim furniture, sit .POSITIONS should be relative to what would normally be the root prim if it wasn't attached to the boat.  Put the .POSITIONS card in that "root" prim.  Put the animations in that "root" prim.  Probably put the menus (.theme) in there to.  Then tell the other prims of that furniture to refer to the "root" prim.

The "root" prim copy of the 1AOorMore script controls all animation playing for all avatars, but the others get their own script for tracking keys / adjustments.