BlowSUp Posted January 9, 2012 Posted January 9, 2012 Hi all,I have a small project I stated in which I want my object to do a scan using the llsensor function(looking for surrounding avatars), then displaying the results of the scan in a lldialogue function/box thingy, but I am stumped on how to take the data gathered from the scan, and translate or carry it over to the dialogue function, where each name is displayed sperately.... can anyone help with this?So far I have: string title = " ";list peepnames = [];key agent;default{ state_entry(){ llSay(0,"Entered, commencing Scan"); llSensor("", "", AGENT, 96.0, PI); // activates the sensor. // look for avatars (i.e. not moving objects) on all sides of the object } sensor (integer peepsdetec) { peepnames = [llDetectedName(peepsdetec)]; agent = llDetectedKey(0); llDialog(agent, title, objnames, -9908); }}
Dora Gustafson Posted January 9, 2012 Posted January 9, 2012 Take a closer look at sensor The parameter is an integer that shows how many hits it has. To get the names you must iterate through the hits. The example given at sensor shows you exactly how you can do that.
Rolig Loon Posted January 9, 2012 Posted January 9, 2012 You will also need some way to activate the sensor. As written, the sensor fires once, when the script is reset. You'll either want the sensor to fire continually, in which case you'd use llSensorRepeat or trigger llSensor from a timer event, or you'll want to trigger it only on special occasions, so that the sensor isn't working during times when the area is idle. Remember also that a sensor can detect a maximum of the 16 nearest objects/avatars in a scan, so you may want to adjust your sensor range.
PeterCanessa Oh Posted January 9, 2012 Posted January 9, 2012 Note that only the first 10-ish characters of each name will be shown in llDialog(), the buttons are fixed-width and that's all they can fit. You may want to have a look at Rufus' http://community.secondlife.com/t5/LSL-Library/Dialogger-dialogs-using-prims/m-p/1006855/message-uid/1006855#U1006855
BlowSUp Posted January 9, 2012 Author Posted January 9, 2012 Hmmmmm, I think what I meant to say was, I need each and every avatar detected within that 96m scan range to have their name displayed in a DIFFERENT bdark blue box, within that lldialogue box.... is that possible, I mean, I know they do it in HUDS for targetting, Im just not to sure... HOW lol
Rolig Loon Posted January 9, 2012 Posted January 9, 2012 A dialog box and a HUD are not the same thing, but they can accomplish the same purpose. If you want to use llDialog, then you'll end up with a set of buttons that can each have the name of a detected avatar on them, as Peter was describing. If you want to create a HUD, that's fine too. In that case, you'll want to use a system like Rufus developed, or create one of your own with multiple prims or with "hot" areas defined by llDetectedTouchST. In either case, you will have a bunch of buttons that you can click to do whatever comes next. Also, you'll have a display that needs to be updated every time your sensor does a new scan -- either by creating a new dialog box or by updating button labels on a HUD.
BlowSUp Posted January 9, 2012 Author Posted January 9, 2012 Right, I mean a HUD which uses a dialogue box to display the results of the agent scan, with each deteced avatars name in a seperate box.... but where can i find the scripting to seperate the names and list them each independently... in the boxes?
Rolig Loon Posted January 9, 2012 Posted January 9, 2012 A HUD doesn't use a dialog box. A dialog box is a specific entity, a blue box in the upper right corner of your screen, created by llDialog. It has buttons on it. If you want to think of those as separate "boxes," fine. They are things you click in order to trigger a response. As I said before, if you want to make a HUD, you can put "boxes" on it too. You won't create them with llDialog, but you can make them behave the same way --- click on one and it triggers the script to do something. Read about llDialog in the LSL wiki, or in a tutorial, if that's the route you choose. If you want to build a HUD, it's no different from building anything else that responds to a touch* event. See llDetectedKey, llDetectedTouchST, and the other llDetected functions.
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