|
Leo Mission
Registered User
Join date: 6 Jan 2006
Posts: 189
|
10-03-2007 18:21
I am trying to get one prim to send a stream of particles to another prim (Ama Jopsy script) and hitherto have been using target = UUID of the target prim to guide the beam.
However of course when you take the objects into inventory and re-rez, the prims have different keys and the targetting ability is lost.
I am wondering if there is a way to retain this memory of targetting one prim to another with particles, or if they can be targetted with some other way than keys?
Many thanks for you help!
|
|
Malachi Petunia
Gentle Miscreant
Join date: 21 Sep 2003
Posts: 3,414
|
10-03-2007 20:07
Use a sensor to find the object by name which will give you the key which you can then target with particles.
Post if you'd like more detail.
|
|
Leo Mission
Registered User
Join date: 6 Jan 2006
Posts: 189
|
10-03-2007 20:53
From: Malachi Petunia Use a sensor to find the object by name which will give you the key which you can then target with particles.
Post if you'd like more detail. I'm not very experienced in scripting so full details would be muchly appreciated....thanks!
|
|
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
|
10-03-2007 23:15
Options you have:
*) Sensors. Use those to look for specifically named prims.
*) Have the "target" announce its UUID on a specific *negative* chat channel. Also have the particle source listen for it and then readjust its particlestream accordingly.
|
|
Malachi Petunia
Gentle Miscreant
Join date: 21 Sep 2003
Posts: 3,414
|
10-04-2007 05:19
poorly formated (not my fault) untested (my laziness) psuedo-code follows: string tName ="the target"; integer tType = ACTIVE | PASSIVE; float tRaduis = 30 /* distance to look for target in m */ float tArc = PI; /* +/- scan angle in radians PI = full sphere */ key target; state hunt { state_entry() { llSensor(tName, NULL_KEY, tType, tRadius, tArc); } sensor(integer nFound) { /* only use the first detected object (#0) for simplicity */ target = llDetectedKey(0); state point; } no_sensor() { /* didn't find tName within tRadius */ /* weep bitterly or look up llSensorRepeat */ } } state point { state_entry() { /* set up a particle emitter targeting "target" */ } } default { state_entry() { /* set up code here */ state hunt; } }
|
|
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
|
10-04-2007 05:55
I seem to remember that the particle lab had an announce/listen script just for this purpose in its freebie scripts area.
|
|
Leo Mission
Registered User
Join date: 6 Jan 2006
Posts: 189
|
10-04-2007 14:57
Thanks for your replies, I shall certainly be trying out these methods!
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
10-04-2007 15:36
Even easier: Target script: default { state_entry() { llSay(-3498734,"target me!"); } }
Particle script (simplified): default { state_entry() { llListen(-3498734,"",llGetOwner(),"target me!"); } listen(integer iChannel, string sName, key kID, string sMessage) { llParticleSystem([...,PSYS_SRC_TARGET_KEY,kID]); } }
Obviously, the application must be tuned to your specific needs, but that's an easy way to do it.
|