Alisha Matova Posted February 8, 2012 Share Posted February 8, 2012 I'm stuck! On something rather simple.I have a simple volume detect prim messaging the avatars uuid back to my main script. I need to take that uuid and insert it into one of the states functions.Could someone please post a quick example that parses a uuid from a message into a function for me?Thanks in advance! Link to comment Share on other sites More sharing options...
Dora Gustafson Posted February 8, 2012 Share Posted February 8, 2012 It is simple to get the UUID from the listen event:listen( integer channel, string name, key id, string message ) { UUID = id; } What I don't understand is what you mean by sates functions? 1 Link to comment Share on other sites More sharing options...
Talia Davidov Posted February 8, 2012 Share Posted February 8, 2012 @Dora, That ID from the listen event won't pass along the detected ID, that would be the UIID of the prim itself. @Alisha Two scripts, the first in the volume detect prim, the second in the prim you want to get the value default{ state_entry() { llVolumeDetect(TRUE); } collision_start(integer num) { llWhisper(-12321,(string)llDetectedKey(0)); }} key collider;default{ state_entry() { llListen(-12321,"","",""); } listen(integer channel,string name,key id,string message) { collider = (key)message; llSay(0,"UUID " + (string)collider + " hit me"); } } The llSay line is in there just as an example of using the collider value. You could instead switch states and then use the value as you need instead. Edit to add: If you are using within one prim, better to use linked message instead of whisper and listen 1 Link to comment Share on other sites More sharing options...
Yohan Roux Posted February 8, 2012 Share Posted February 8, 2012 Looks like a pinball machine, instead of using the key why not use the object name or both, then have all the object names in a list and then use llfidlistfind you give you an index and then use an IF else chain to do the function according to the index number of the object name, and don't use llwhisper, that takes longer, as you are using a large neg number use llregionsay, and if to have the key of the receiver then use llregionsayto. Link to comment Share on other sites More sharing options...
Yohan Roux Posted February 8, 2012 Share Posted February 8, 2012 He seems to want a function to run for a given key, can't see how he could unless he had a list of all keys first, think he should use the object name myself but I could have misunderstood it. Link to comment Share on other sites More sharing options...
Rolig Loon Posted February 8, 2012 Share Posted February 8, 2012 Yohan Roux wrote: He seems to want a function to run for a given key, can't see how he could unless he had a list of all keys first, think he should use the object name myself but I could have misunderstood it. The OP doesn't need a long list of saved keys. He's already got the one he needs. It's llDetectedKey(0) in his collision_start event. All he wants to do is send it to another script and use it. Talia's example does that just fine. As she says, if the two scripts are in the same linkset it's even easier to use llMessageLinked.In the sending script ... key UUID = llDetectedKey(0); llMessageLinked(LINK_SET,0,"",UUID); in the receiving script ... link_message(integer link, integer num, string msg, key id) { key Av_ID = id; } 1 Link to comment Share on other sites More sharing options...
Fluffy Sharkfin Posted February 8, 2012 Share Posted February 8, 2012 Also, if the two scripts aren't in the same linkset, you may want to consider using llRegionSayTo to transmit the avatar key rather than llSay or llWhisper, since it doesn't have a range restriction (as long as both objects are in the same sim of course), and won't interfere with other listeners if they happen to operate on the same channel. Link to comment Share on other sites More sharing options...
Alisha Matova Posted February 9, 2012 Author Share Posted February 9, 2012 thank you All very much! I managed to get things working with Talia's example =) tyty! the "(key)message" part did the trick =D Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now