Help with RegionSay talkback?
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-12-2007 10:07
I'm working on a script again, trying to learn even more, and was wondering a couple things: I'm trying to have a single object that can be placed anywhere in a regino and talk to each other to determine where it will teleport you to. A sim-wide teleporter system, yep. BUT I want it to work in any region, even if you just drop one down, you should be able to select it from another, no inputting of coords. SO what I'm trying to do is have it RegionSay a request for coordinates, if it hears that request, send out its coordinates, and then recieve those coordinates and set the sit position.. if that makes sense. (Using llSitTarget and llUnsit like so many dropable teleporters do). However, I'm not sure how to do it so that it will regionsay the coordinates and be able to read them. I can give them a vector such as vector Dest; Dest=llGetPos(); but would llRegionSay(5, Dest); be recieved correctly if I had the listen event listening for llListen(5, Dest, "", ""  ; ? And if it would be recieved correctly can I then just set the sit position directly as a new vector like newdest=dest-pos; llSitTaget(newdest, ZERO_ROTATION); ? I'm not sure how much of this is making sense but I'm trying to make it clear to understand lol.. essentially, how can I have a teleporter hub listen for a request, broadcast its coordinates, recieve coordinates and then use those coordinates in a sit position? Thanks in advance EDIT:: I may be using llListen wrong in that i put a string name in. I don't know what exactly that is right now but I think I did it right >.>
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
12-12-2007 10:49
The listen will get the key of whatever spoke to it, and with that you might use llGetObjectDetails to get the information you want (perhaps OBJECT_NAME to get something to show in a menu, OBJECT_OWNER match to reduce the likelihood of others messing with your system, OBJECT_POS already set up as a vector you can use). Unless there are other details you want to track, what the remote objects say in chat really doesn't matter, as long as they say something.
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-12-2007 10:52
From: Viktoria Dovgal The listen will get the key of whatever spoke to it, and with that you might use llGetObjectDetails to get the information you want (perhaps OBJECT_NAME to get something to show in a menu, OBJECT_OWNER match to reduce the likelihood of others messing with your system, OBJECT_POS already set up as a vector you can use). Unless there are other details you want to track, what the remote objects say in chat really doesn't matter, as long as they say something. Oh awesome thanks! Didn't even think of that... haven't used llGetObjectDetails yet so now I get to learn that ^_^.. thanks a ton!
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-12-2007 10:56
New question
Assuming I can get that figured out so that they end up talking to each other and working and everything (I'll dot hat when I get home.. LSL editor has its limits for me lol.. I like to test individual things visually), is there a way to store every new one? Or should it just test every time anyway, since one could be suddenly taken out of the region, making it a useless button?
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-12-2007 11:07
Also, is there a way to send an av somewhere without llSitTarget or llSetPos and such?
Just...send them there? I can easily make the correct sit position with the object position, but just wondering if it was possible to do without it, just have it use the exact object position to send the av there, without moving the object
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
12-12-2007 11:20
Here is where you get options  If you poll for other teleporters every time one is touched, you do get pretty close to a zero configuration system. Positions are tracked in real time. You're also doing a lot of redundant work, and you might run into reliability problems in times of extreme lag (responses don't come in on time). You could have your teleporter network only have its little chat on owner command. the good part is that you can verify with your own eyes that all the teleporters know about all their destinations, one drawback is that you have to remember to run the magic command when you move things. If a teleporter gets taken away, it's not a huge problem if you don't notice that immediately. The destination will still be there, in some form  . To help ride grid hiccups, you might store a time in your list along with each pad's key and vector, and let those entries live for some arbitrary period before you flush them. This exercise might also be no more than busywork if you aren't seeing actual problems with delays, so maybe keep to a simple "dumb" polling until you see evidence that you need more =) A teleporter that is simply moved (in the same region) will report its new position on the next poll, so that situation isn't a problem. From: someone Also, is there a way to send an av somewhere without llSitTarget or llSetPos and such? There is llMapDestination for an alternative, but the only "real" function we have so far is llTeleportAgentHome. https://jira.secondlife.com/browse/SVC-212 if you want to add your vote =)
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-12-2007 11:23
From: Viktoria Dovgal Here is where you get options  If you poll for other teleporters every time one is touched, you do get pretty close to a zero configuration system. Positions are tracked in real time. You're also doing a lot of redundant work, and you might run into reliability problems in times of extreme lag (responses don't come in on time). You could have your teleporter network only have its little chat on owner command. the good part is that you can verify with your own eyes that all the teleporters know about all their destinations, one drawback is that you have to remember to run the magic command when you move things. If a teleporter gets taken away, it's not a huge problem if you don't notice that immediately. The destination will still be there, in some form  . To help ride grid hiccups, you might store a time in your list along with each pad's key and vector, and let those entries live for some arbitrary period before you flush them. This exercise might also be no more than busywork if you aren't seeing actual problems with delays, so maybe keep to a simple "dumb" polling until you see evidence that you need more =) A teleporter that is simply moved (in the same region) will report its new position on the next poll, so that situation isn't a problem. For now I think I'll just use the poll every time, and see how effective it is with varying #s of tp pads, see if it can handle say 10 at a time without lagging too bad or something.. and see what kind of taxing its causing on resources as well. I may then change it to owner only or to a command to re-poll incase someone thinks one is missing.
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-12-2007 16:26
EDIT:: Got that line working, now trying to get it to talk to a duplicate isn't working.. at least not that I can tell. Here's the new code: integer chan; default { state_entry() { llSay(0, "Working"); llSetSitText("Dead"); chan=123456; } touch_start(integer number) { state new; } } state new { state_entry() { llRegionSay(chan,"Who's there?"); llListen(chan, "", "", "Who's here?"); } listen(integer channel, string name, key id, string message) { if(message="Who's here?"); { llRegionSay(chan, "I'm here!"); } if(message="I'm here!"); { llSay(0,(string)llGetObjectDetails(id, [OBJECT_NAME])); } } touch_start(integer number) { llRegionSay(chan, "Who's there?"); } }
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-12-2007 17:57
ok got the regionsay talkback working properly now.. had some troubles as it seems llRegionSay lets the object listen to itself, but got that solved ^_^ integer chan=-78136487; default { state_entry() { llSay(0,"Working"); llListen(chan,"","",""); } listen( integer channel, string name, key id, string message ) { if(message=="Who's there?")llRegionSay(chan, "I'm here!"); else if(message=="I'm here!") llSay(0,(string)llGetObjectDetails(id,[OBJECT_NAME])); else llOwnerSay("Invalid"); if(id==llGetObjectName()); } touch_start(integer number) { llRegionSay(chan, "Who's there?"); llOwnerSay("[DB]Who's there call sent"); } }
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-12-2007 18:06
Still hearing itself after all, just eliminated the infiniloop.. anyone able to get rid of it hearing itself? The polled objects are now saying the name and location of the base object since its replying too
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
12-12-2007 19:46
Ok, I played with your scripts in posts 8 and 9. Post 8's version was basically fine (once all the "Who's here? and "Who's there?" were matched up  ). The one in post 9 works OK too, I have three of them here and they seem to be reporting to one another and not hearing themselves. It's easy to overlook the little things if you've been staring at something for too long, so are you remembering to give each of your test boxes a different name so you can tell who is talking? Script resets after that might not hurt either. One quirk in the post 9 version is that every teleporter is picking up the "I'm here" messages, so every teleporter learns about everybody else _except_ the one who asked "Who's there?". Not a big deal since you aren't even storing this information yet, but some filtering (maybe include the requester's key in the "I'm here" message) or broader listening ("Who's there?" counts as an "I'm here" as listen time) would help there.
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-12-2007 20:09
From: Viktoria Dovgal Ok, I played with your scripts in posts 8 and 9. Post 8's version was basically fine (once all the "Who's here? and "Who's there?" were matched up  ). The one in post 9 works OK too, I have three of them here and they seem to be reporting to one another and not hearing themselves. It's easy to overlook the little things if you've been staring at something for too long, so are you remembering to give each of your test boxes a different name so you can tell who is talking? Script resets after that might not hurt either. One quirk in the post 9 version is that every teleporter is picking up the "I'm here" messages, so every teleporter learns about everybody else _except_ the one who asked "Who's there?". Not a big deal since you aren't even storing this information yet, but some filtering (maybe include the requester's key in the "I'm here" message) or broader listening ("Who's there?" counts as an "I'm here" as listen time) would help there. The script in #8 kept looping forever once i got it working properly... at least I think it was that one.. had someone elsee test it o the same result too so i made a new one And now, with the #9 script, what is happening is I've named three boxes, one is mememe, one is youyouyou, one is himhimhim. When mememe polls the others (Close proximity so I could make sure all were working without tping to tem), it reports their name a nd location, but then they also report it's location so it ends up Mememe:Youyouyou, <o,o,o> Youyouyou: Mememe, <o,o,o,> Mememe: Himhimhim<o,o,o> Himhimhim: Mememe, <o,o,o,> Its rather odd.. I can't figure out what is causing it. And yeah, I will need to refine it once I get to that point, but this little excercise was to get used to how to do it a bit ^_^ Next up is llDialog, the beast... but I need to work out why the other two are reporting the bases location and name too ETA:: Resets won't help as I need the original to report ALL of the ones in the region.. resetting after reporting will cause it to report only one =/ tested that already ETA2: The #9 script is working fine for me in that the one asking is telling me who replies.. dunno why it isnt for you... all I've changed that I can remember is to add OBJECT_POS tot he llGetObjectDetails line
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
12-12-2007 20:32
use 2 channels, one for requests (which they all listen to) and one for responses, (which only the activated one is listening to)
this could get very messy with heavy use... light personal use is no issue
as a bonus you can have the responding pads say both their object name (which will allow friendly names like store, skybox, etc) along with their position. which you could then use in button text
a few ideas instead of asking for the positions every time, send out a message once, on set up, that includes it's own location, and requests all other listening locations, which report back and it adds them to it's internal list. include a single listen, and when it hears a new request, it adds it to it's list if it's not there, and then responds with it's own name/loc. on de-rez it passes a takedown message, and any other pads which search their lists and remove it if found.
possibilites for movement teleporter sets a sit target with the location of the target teleporter rezs a temp prims with the same that dies on unsit teleporter rezzes a temp prim with moves to target on sit, and dies on unsit (great with warppos) teleporter communicates with an attachment, that uses move to target teleporter rezzes vehicle wich av sits on and it takes them to target (variation of above) teleporter rezzes a temp prim which uses llMapDestination to open the map on the target (Cleary SGC uses this method in their stargates, works intra/extra sim) teleporter rezzes a physical object which push/drags avatar to destination (half hollow cyllinder?)
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
12-12-2007 20:38
From: Okiphia Rayna ETA2: The #9 script is working fine for me in that the one asking is telling me who replies.. dunno why it isnt for you... Yes, that is working fine for me too. It's just that all the _other_ teleporters chime in to tell me who's here, because they are all listening. It's not a huge problem, they are just responding to things they don't need to care about at the moment. (the reset was just a manual thing to make sure you were actually running the script in the form you expected, no need to do that normally.)
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-12-2007 20:41
From: Viktoria Dovgal Yes, that is working fine for me too. It's just that all the _other_ teleporters chime in to tell me who's here, because they are all listening. It's not a huge problem, they are just responding to things they don't need to care about at the moment.
(the reset was just a manual thing to make sure you were actually running the script in the form you expected, no need to do that normally.) ah okies @ reset And oh I see what you mean now... yeah they don't need to chime in =P It is odd though that at least for me, they are reporting about the one that isn't saying 'im here'..its odd.. at least thats how it was earlier, been working on some other stuff lol
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Stephen Zenith
Registered User
Join date: 15 May 2006
Posts: 1,029
|
12-13-2007 02:25
I'd have done it slightly differently. I'd have each teleporter send its position once every 30 seconds (say). You could also make it so it sends a new position immediately if it moves.
Then, when a teleporter hears one of those messages, it checks if it already knows about it. If it does, then it updates a timestamp saying when it last heard from it. If not, it adds an entry to a list, and stores the timestamp.
Then, once every 5 minutes, a timer kicks in and deletes all the entries in the list that are more than 5 minutes old. Of course, the various time periods can be altered depending on various circumstances. It completely gets rid of the need to poll for positions.
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-13-2007 09:01
From: Stephen Zenith I'd have done it slightly differently. I'd have each teleporter send its position once every 30 seconds (say). You could also make it so it sends a new position immediately if it moves.
Then, when a teleporter hears one of those messages, it checks if it already knows about it. If it does, then it updates a timestamp saying when it last heard from it. If not, it adds an entry to a list, and stores the timestamp.
Then, once every 5 minutes, a timer kicks in and deletes all the entries in the list that are more than 5 minutes old. Of course, the various time periods can be altered depending on various circumstances. It completely gets rid of the need to poll for positions. Seems that having it shout out its info every 30 seconds would be redundant..but your post made me think a bit on the most 'efficient' way of doing it Maybe have it so that on rez it shouts out its position with a 'I'm new here' message. Any time it hears the 'i'm new here' message it will save it and also reply with 'welcome to the neighbourhood' and then save that. Have it send out a 'I changed' message if it moves to update it in the others' info, and thats it... With this method it shouldn't need to shout out every 30 seconds as its got any new ones when they get dropped. Instead of a 5 minute refresh, just have it refresh when a new one is dropped, and on owner command. So essentially it would go like this (The convo between tp pads) Newpad: 'I'm new to the neighbourhood' Oldpad1: 'Oh hey, hi, here's my address' Oldpad2: 'Oh hey, hi, here's my address' (ALL POSITIONS SAVED) Newpad1: ' Hey, I've just changed, that house had mold' Oldpad1: 'No problem, got it' Oldpad2: 'No problem, got it' (NEWPAD1 POSITION REFRESHED) This does allow some crossover in that if an old pad disappears it won't know automatically, but if the owner refreshes say....once a day or so, it should be more than fine. ETA:: At the moment, I'm working in LSL Editor (No SL at work) to attempt to figure out a way to store incoming data, and a way to incorporate all this into llDialog..which I don't know how to use quite yet..learning ^_^ I think I've got the regionsay down, just have to figure outt he annoying quirk of the polled saying the poller Plus it helped me get used to llGetObjectDetails ^_^
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-13-2007 09:21
Once my script is done, it will be opensource by the way.. it could be really useful if I end up getting it right... anyway, here is a layout of it when its finished, just how things will happen. Not in code, but syntaxed similarly. I'm working on some code right now Bootup - Say Working Regionsay - I'm new here
hear 'I'm new here' reply 'Heres my address' store object location and name
hear 'Here's my address' store object name and location
if moved regionsay 'I've changed position'
hear 'I've changed position' refresh object name and location info
Parse stored data, convert into usable form for llDialog
Dialog button 1- Set sitposition to object 1 offset Dialog button 2 - Set sitposition to object 2 offset etc
If sat on, unsit at sitposition
if owner says refresh, regionsay 'i'm new here'
That makes it seem so simple XD
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Okiphia Rayna
DemonEye Benefactor
Join date: 22 Sep 2007
Posts: 2,103
|
12-13-2007 09:27
Having some trouble.. since I don't want it to be user configured and such, but I want multiple destinations, I need it to store multiple entries of data from the same command... and I'm not sure how
Since it's listening for 'here's my location' and might be hearing 10 replies, how could I store the data without overwriting the same variable? It's frustrated me... without having them forced specific names and listening for each individual one, I can't figure out how to do this
_____________________
Owner of DemonEye Designs Custom Building and Landscaping Owner and Blogger, Okiphia's Life http://okiphiablog.blogspot.com/ 
|
|
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
|
12-17-2007 04:27
From: Okiphia Rayna Having some trouble.. since I don't want it to be user configured and such, but I want multiple destinations, I need it to store multiple entries of data from the same command... and I'm not sure how
Since it's listening for 'here's my location' and might be hearing 10 replies, how could I store the data without overwriting the same variable? It's frustrated me... without having them forced specific names and listening for each individual one, I can't figure out how to do this you can build the list useing a hash of part of the objectkey. somthing along the lines off:-
....
hear 'I'm new here' reply 'Heres my address' //Calculated from Object Key integer myID = (integer)("0x" + llGetSubString(llGetKey(), 9, 16))
store object location and myID
....
Interesting project BTW, I look forward to seeing the result.
|