Moon Corrigible Posted February 12, 2020 Share Posted February 12, 2020 I apologize, I don't know the correct terminology. I'm using an llSesnor and I would like it to detect both objects with the name "Left Corner Setter" and "Right Corner Setter". Is there a way to use a character or code to to get it to detect anything with the words 'Corner Setter' in the name? Thanks! Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted February 12, 2020 Share Posted February 12, 2020 No, LSL doesn't have wildcards. Your best bet would be to filter by type, and then look for those names (or a partial match). Link to comment Share on other sites More sharing options...
Rolig Loon Posted February 12, 2020 Share Posted February 12, 2020 (edited) Assuming that the objects are fairly nearby and that there aren't a lot of other objects within range, you can look for anything within range and then filter the results to find what you are looking for: So, use llSensor("","",ACTIVE|PASSIVE,10.0); and then receive sensor(integer num) { while (~num) { --num; if ( llSubStringIndex(llDetectedName(num),"Corner Setter") != -1 ) { //Got one! Now do something with it. } } } Build on that idea to create a short list of objects with the right name and then do whatever with them. You are limited by the detection range and by the fact that a sensor will only report the 16 closest objects it detects within range. Edited February 12, 2020 by Rolig Loon Clarity 1 Link to comment Share on other sites More sharing options...
Moon Corrigible Posted February 12, 2020 Author Share Posted February 12, 2020 I'm just a little worried that there might be more than 16 scripted objects in the vicinity, and that the sensors might not find it then. But honestly I have no idea how realistic that worry is. Dumb question - would running two sensors (one for each) take up less script resources? I read that each llSensor will return up to 16 responses and I'm wondering if that would be overly taxing? Thanks again! Link to comment Share on other sites More sharing options...
Rolig Loon Posted February 12, 2020 Share Posted February 12, 2020 1 minute ago, Moon Corrigible said: Dumb question - would running two sensors (one for each) take up less script resources? Unless you plan on looking over and over and over, that's a non-worry. I assume that you just need to find the objects once, do something, and be happy. Link to comment Share on other sites More sharing options...
Moon Corrigible Posted February 12, 2020 Author Share Posted February 12, 2020 Yes, exactly - I just need to find them once and have it report it's position back to the rest of the script. You are all are so awesome! Honestly that llSensor script is SO much more elegant than anything I would have come up with. THANK YOU!!!! Link to comment Share on other sites More sharing options...
Rolig Loon Posted February 12, 2020 Share Posted February 12, 2020 And if you really worry about having more than 16 objects in the search range, decrease the range and move the sensing object around. It's clunky, but scripters have been doing it as long as SL has been around. Link to comment Share on other sites More sharing options...
Fenix Eldritch Posted February 13, 2020 Share Posted February 13, 2020 If I may suggest another approach: Give your target prims the same name but then differentiate them by giving each one a unique description i.e. "left" or "right". That way, you could set your sensor to look for all objects named "Corner Setter" and then inspect each detected prim's description with llGetObjectDetails to figure out if it was the left or right variant. 4 Link to comment Share on other sites More sharing options...
Moon Corrigible Posted February 13, 2020 Author Share Posted February 13, 2020 Oh my gosh that's brilliant!!!! You all are amazing!! 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