Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
|
04-09-2003 12:55
first issue. llDetectedName: default { touch_start(integer a) { llSay(0,llDetectedName(a)); } } given this code, whenever someone touchs it the object, if it is the first time they touch it, it should say their name, if it is not the first time, then it should say the name of the last avatar to touch it. However if that variable is there, it returns an empty key... If you place an actual integer there, say '0' it then says the name of the person in the 0 spot... but that isn't what i want to happen. that however was merely a minor issue. Nex and I were playing with it last night, and i wanted to know what name it would report, i.e. first only, full, caps no caps, and so on. The big one was that I was working on my lost and found script because we were going to go clean up in the treasure hunt cause we were going to sensor sweep the whole sim, and then ride to the treasure in style on a couch nex made while he heckled me about being slow, (heh, damn you canadians!). But there is a limit to the number of objects that a sensor sweep can detect... and it is 16... why is it 16? This totally makes my script that finds lost small objects useless as it is. infact it makes it into a much longer script, since i would have to make the object cover every square-inch, er square centimeter of the sim, comparing each object it sensed with a master list so as not to get duplicates... Which can be done... um yeah well so I want to be able to sense more objects, yeah thats about it 
|
Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
|
Re: scripting rant.
04-09-2003 13:19
From: someone Originally posted by Nada Epoch first issue. llDetectedName:
default { touch_start(integer a) { llSay(0,llDetectedName(a)); } } The problem with this is (as you might have realized by now) you are asking for an invalid index. The argument to touch* (and sensor) is the number of things detected starting at zero so if the argument is 3, then you can ask about the 0th person, the 1st and 2nd. Passing the argument is asking about the 3rd person, and since there is no such person, you get the empty string back. To put it another way, valid indicies are in the range [0 .. a-1] P.S. Nada, if you have redacted the part of your post I am quoting by the time I hit "submit reply", I'm still leaving this up. P.P.S. I really like the word "redacted"
|
Tcoz Bach
Tyrell Victim
Join date: 10 Dec 2002
Posts: 973
|
Hmmm....
04-09-2003 13:29
According to the lsl ref, in touch_start, integer a = The number of detected objects...it doesn't appear to have anything to do with info about the toucher per se...the referencable data would be specific to the last toucher, every time. Seems that's as intended.
With this info, am I wrong in thinking that you are passing "the number of detected objects" to the llDetectName function (which likely wouldn't get you what you want)? Looking over the scripting methods it would seem you would need to capture each instance of a "touch" in a list or something if you wanted to hold them.
I'm interested in this since I'm starting work on a "bug sweeper" program. I'm actually less interested in finding objects that belong to me in a given radius than I am with finding objects that may have been * cough * "dropped accidentally".
_____________________
** ...you want to do WHAT with that cube? **
|
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
|
04-09-2003 14:00
I think you nailed it wednesday... guess nex was right in making fun of me. counter will always be one a head of the the number of places in the list. Doh.
tcoz, that is totally what the script was to do, it would scan the sim for an objects which where mine, and then take me to them, where by i could delete them, which would be good. But it can't not yet with the limits, unless we do some fancy scripting, which i don't want to do. Elegance and simplicity are the best way.
|
Cory Linden
Linden Lab Employee
Join date: 19 Nov 2002
Posts: 173
|
04-11-2003 15:53
Sorry, Nada, but 16 is all you get. There are wide variety of reasons for this, most releated to ensuring safe script operation from the POV of the simulator, especially related to memory allocation since the script needs to cache a great deal of info about objects.
In better news, be sure to read the release note of 0.6 as there are many new scripting features, some of which might have been mentioned in various forum posts.
c
|