speaking to only an object that touched it
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
09-01-2009 10:18
i am curious is it possible to create an object that can communicate in a public channel - not to the owner - to anyone that if touched can tell that object to carry out a task but not affect those around it a perfect example would be puddle if you drive through it on a bicycle or any vehicle for that matter the puddle say splash - which make the script on the bicycle splash (trigger its particle script) but the other bicycles in listening distance do not trigger even though they heard the command is it possible to make a collision script talk to everyone but on alter what collides with it the problem i have is i collide with it but it also makes the sprays on the other bicycles trigger their sprays too at the same time  this has to be open and not owner or group - openly speak on a channel that all the open free bikes can use
|
Ee Maculate
Owner of Fourmile Castle
Join date: 11 Jan 2007
Posts: 919
|
09-01-2009 10:24
You could at lease llWhisper instead of llSay to reduce the noise....
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
09-01-2009 10:39
llInstantMessage?
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
09-01-2009 10:42
Perhaps, instead of whispering "splash", the puddle whispers "splash|"+llDetectedKey() inside the collision_start event, and the bicycles listen for "splash|"+llGetKey() ?
_____________________
Archived for Your Protection
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
09-01-2009 10:43
You don't have to do this in an open chat. I can think of a few ways off the top of my head. Try.. (1) Puddle detects collision with bicycle, gets bicycle owner's UUID. (2) Puddle creates a trigger based on the UUID (llGetSubString(UUID,-8,-1), for example) and sends it as a message on a private channel. (3) All bicycles in the region hear the message and filter it, listening for only the trigger that matches their own owner's UUID, as in .... string UKey = llGetSubString((string)llGetOwner(),-8,-1); integer handle = llListen(-987654,"","",UKey); ETA: Qie's suggestion is even easier.  ETA (again): Obviously, if you do it my way you can also whisper "Splash" at the same time if you wish. Just don't let that word trigger anything.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
09-01-2009 10:44
Whisper the ID of the object that collided along with the message. eg: llSay(MAGIC_NUMBER, (string)llDetectedKey(0) + " splash"  ; Then in the listener: if(llGetKey() == (key)message && llGetSubString(message, 37, -1) == "splash"  { ... }
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
09-01-2009 11:55
From: Junglejim Jonson if you drive through it on a bicycle or any vehicle for that matter the puddle say splash - which make the script on the bicycle splash (trigger its particle script)
Did I miss something? Why don't you let the collision event in the bicycle trigger the splash? To make sure it is a dog you hit you could check its name with: if ( llDetectedName(0) == "pluto" ) splash(); // pluto is not with us anymore...
_____________________
From Studio Dora
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
09-01-2009 12:17
From: Dora Gustafson Did I miss something? Why don't you let the collision event in the bicycle trigger the splash? To make sure it is a dog you hit you could check its name with: if ( llDetectedName(0) == "pluto" ) splash(); // pluto is not with us anymore... LOL .... Good plan, Dora. If the OP really needs to hear the word "Splash" in chat, there's no reason why he can't just include llWhisper(0,"Splash!"  in the splash() function and still send the particle-triggering message in a private channel. The message can simply be llDetectedKey(0) itself, so the bicycle listens for .... llListen (-987654,puddle,"",(string)llGetOwner())
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
|
09-01-2009 14:50
From: Rolig Loon LOL .... Good plan, Dora. If the OP really needs to hear the word "Splash" in chat, there's no reason why he can't just include llWhisper(0,"Splash!"  in the splash() function and still send the particle-triggering message in a private channel. The message can simply be llDetectedKey(0) itself, so the bicycle listens for .... llListen (-987654,puddle,"",(string)llGetOwner()) it might be better to use llDetectedOwner for the message so that if the puddle detects the vehicle and not the owner, then it will still say the right key that the vehicle is listening for. also white not make the puddle do the splashing? like the splashable water systems?
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
09-01-2009 17:00
YEAH the bikes are free and can be borrowed and not owned by the people using them so owner has to be avoided - as they can have their own free bikes too but they dont own the puddle? so it will not hear the puddle surely? and i tried the whisper event its just too quiet the say event works but that triggers all the other bikes in say distance  when i just want that single individual bike to be affected
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
09-01-2009 17:53
Oh, well in that case instead of using the owner's key as the trigger, you use the key of the bicycle itself. In the puddle object's collision_start event you include the line
llSay(-987654,(string)llDetectedKey(0));
and in the bicycle, you use
llListen(-987654,puddle,"",(string)llGetKey());
The listen event in your bicycle will only hear the puddle speak if it was the bicycle that collided with the puddle. Other bicycles nearby, all listening on the same private channel, won't hear a thing.
It ought to work.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Junglejim Jonson
Registered User
Join date: 4 Feb 2008
Posts: 52
|
09-02-2009 04:10
thanks thats great  ))  )))PPPP
|