Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Pass keys of selected objects to a script?

Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
11-28-2005 22:10
I'm trying to write a UI-enhancement to help people align prims. I generally see how it can be done with llSetPrimitiveParams. The problem is, how do you get the keys of the objects to be aligned sent into the script?

I'm looking for something really simple for the end-user. The user just clicks on or points to the prims to be edited and the script gets the prims' keys, like this:

Script says: Click on the parent prim, which will not be moved.
* user clicks on prim, script gets the key of that object

Script says: Click on the child prim, to be moved into alignment.
* user clicks on prim, script gets the key of that object
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
11-29-2005 03:02
The only thing you can do to tell when an object has been clicked is to have a script in that object with a touch (touch_start) event. The script doesn't have to be in the prim you clicked on, it can be in the root prim, but it has to be in the same object. You can tell which prim was touched with llDetectedLink().
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
11-29-2005 18:21
It doesn't look like what you're lookin' to do can be done very easily Scalar. If you're looking to align multiple objects relative to a "parent" object...you're probably going to have to drop a mini-script into each object and have a parent "governor" over the whole process before there's any "click" for prim to respond capability.
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Willow McGettigan
Registered User
Join date: 30 Nov 2005
Posts: 7
11-30-2005 01:33
unless, i would guess, the prims you're looking to align have unique names known to the parent script, in which case you could use sensors.
Scalar Tardis
SL Scientist/Engineer
Join date: 5 Nov 2005
Posts: 249
12-01-2005 21:38
Hmm, can you "shoot" a sensor, attach it to a projectile?
Can projectiles get the key of what they've collided with?


"Please select first prim to align..."

* user points selection-GUN at prim and fires.
* sensor collides with hit prim and gets its key
Issarlk Chatnoir
Cross L. apologist.
Join date: 3 Oct 2004
Posts: 424
12-02-2005 07:02
From: Scalar Tardis
Hmm, can you "shoot" a sensor, attach it to a projectile?
Can projectiles get the key of what they've collided with?


"Please select first prim to align..."

* user points selection-GUN at prim and fires.
* sensor collides with hit prim and gets its key


It can do that with a llDetectedKey in the collision event.
_____________________
Vincit omnia Chaos
From: Flugelhorn McHenry
Anyway, ignore me, just listen to the cow