Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Library: Object Radar

Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-16-2008 15:08
From: Entheogen Aeon
I understand someone learning a new langauge and going through pain of learning. I have been there myself, but OP posted his horribly written script and described it as some awesome freebie that should be free and not sold (why would anyone want to buy this anyway). There is really nothing new or special in that script, and theres a better example on LSL wiki (http://rpgstats.com/wiki/index.php?title=Sensor) of how to get all detected objects.

If you are sharing your program, you should make sure that variable names make sense, a more or less sane style is used (no obj <= total_num -1) and that it is correct overall. Other newbies would get very bad ideas looking at OP's script. Otherwise ask for help with it and how it can be improved, but do not try to push it as some amazing freebie.

You still do not get it and from your attitude you never will. So let's just be upfront and clear; Stay away from threads started by scripting noobs and try picking on the scripts of some of us older members instead. I see a lot of talk but haven't seen you posting any of your work here. That is how you teach, by example not by criticizing the work of others.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Amara Twilight
Registered User
Join date: 16 Feb 2004
Posts: 47
12-17-2008 12:15
From: Jesse Barnett
NO the OP was NOT asking for it. The OP gave of their own free time without asking for recompense to post a script that they were proud of.

If you come back and ask for help then no problem, that is what we do here. If you come back to insult other people's scripts, then just don't come back. We do not take kindly to this.



as the old net thingy goes QFT!
Jeran42 Claxton
Registered User
Join date: 9 Oct 2006
Posts: 6
01-15-2009 13:58
oh, I am still doing Sl, I have long since improved my scripting ability.
yes,I was new to scripting, so mistakes are there.
and I say, you went off topic pretty badly...but thanks for the tips.
and I dont mind the flames, they keep me toasty and give me advice.
I continue to release just generally useful scripts, free to the public, simply for the good of the internet (and my own desire for underground fame)
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
01-15-2009 15:13
From: Jeran42 Claxton
oh, I am still doing Sl, I have long since improved my scripting ability.
yes,I was new to scripting, so mistakes are there.
and I say, you went off topic pretty badly...but thanks for the tips.
and I dont mind the flames, they keep me toasty and give me advice.
I continue to release just generally useful scripts, free to the public, simply for the good of the internet (and my own desire for underground fame)

Definitely glad to see you still around and contributing!
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
01-16-2009 12:29
From: Entheogen Aeon
Apparently official LSL wiki pages are either inaccurate or old.

As a side note, there is no such thing as an *official* LSL wiki, not even the one at wiki.secondlife.com.
_____________________
So many monkeys, so little Shakespeare.
Entheogen Aeon
boing boom tschak
Join date: 25 Dec 2007
Posts: 34
01-16-2009 12:37
From: Lee Ponzu
As a side note, there is no such thing as an *official* LSL wiki, not even the one at wiki.secondlife.com.


Wow why does Linden Lab has to suck so much? I mean the concept of Second Life is cool, but wth, documentation of client is practically non-existent, and no official specification/documentation of LSL? It's like Second Life is some dude's home project :(
Jeran42 Claxton
Registered User
Join date: 9 Oct 2006
Posts: 6
01-17-2009 09:18
well it is pretty open source now days. you can have private servers that run different languages i hear. not too keen on that kind of scripting, but hey.
and yes, it sucks not having proper documentation, but we are a large community of smart people, and we seem to be figuring it out on our own pretty well.
plus, lindens dont suck at everything in my opinion, i think they just are normal people who have alot of stuff on their plate.
Entheogen Aeon
boing boom tschak
Join date: 25 Dec 2007
Posts: 34
01-17-2009 11:59
From: Jeran42 Claxton
well it is pretty open source now days. you can have private servers that run different languages i hear. not too keen on that kind of scripting, but hey.
and yes, it sucks not having proper documentation, but we are a large community of smart people, and we seem to be figuring it out on our own pretty well.
plus, lindens dont suck at everything in my opinion, i think they just are normal people who have alot of stuff on their plate.


Well, they get tons of money, why cant they implement it in a sane way? The should hire some real programmers and optimize the shit out of their servers and roll out documentation that actually makes sense and is consistent with reality.
RobbyRacoon Olmstead
Red warrior is hungry!
Join date: 20 Sep 2006
Posts: 1,821
01-17-2009 12:04
From: Entheogen Aeon
I understand someone learning a new langauge and going through pain of learning. I have been there myself, but OP posted his horribly written script and described it as some awesome freebie that should be free and not sold (why would anyone want to buy this anyway). There is really nothing new or special in that script, and theres a better example on LSL wiki (http://rpgstats.com/wiki/index.php?title=Sensor) of how to get all detected objects.

Regardless of why you think it's a substandard script or why you feel that the OP was acting overly proud, for you to feel compelled to voice insults just demonstrates that you are capable of acting like a pompous ass.

Without exception, every programmer/scripter has written code that they could later improve upon, and there's nothing wrong with feeling satisfied about your current level of progress and wanting to share that with others.

I applaud the original poster's desire to give to others.
_____________________
Lizardfolk FLux
Registered User
Join date: 4 Apr 2009
Posts: 1
04-09-2009 20:11
I have a problem getting this to work. I made sure I copied the exact code but nothing happens when I exit
Laurence Corleone
Registered User
Join date: 12 Oct 2006
Posts: 126
04-09-2009 22:33
Just tested as posted and it works just fine. Do you understand the script and did you touch the object it is in?
_____________________
There are no stupid questions, just stupid people.
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
04-26-2009 09:18
Argent is correct.

The thing to keep in mind about the difference between ++x and x++ is that the former returns the incremented value and the latter does not. This seems like a small matter, but in object-oriented code, if the object being incremented is expensive to create, it matters a LOT.

You see, with ++x, we increment the object, and use its value.

With x++, we have to create a new object to hold the old value, since it's returned. Yet, in this case, we don't even use the value.

In C, the difference between the two is minimal and easily optimized out.

In C++, when x is an object, the semantics require creating the duplicate object even if its value isn't used, if creation might have any side effects. No doubt there are cases where creating the duplicate value can be optimized out by the compiler, but frequently it can't. Frequently, the compler can't see the constructor implementation, so it must invoke it.

So, if you're not going to use the pre-incremented value, use ++x, not x++. I suggest you just get in the habit of always using ++x, and only use x++ if there's a reason for it -- and in that case, remember to ask yourself about the ramifications of creating a copy of the pre-incremented value.

I suspect this is true of any language that supports the "++" operator, and most expecially, object-oriented ones.
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
04-26-2009 09:37
In LSL integers are passed around as 32-bit values on a stack, no object is created.
_____________________
Argent Stonecutter - http://globalcausalityviolation.blogspot.com/

"And now I'm going to show you something really cool."

Skyhook Station - http://xrl.us/skyhook23
Coonspiracy Store - http://xrl.us/coonstore
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
04-26-2009 18:00
Agreed, Argent. I still think my advice to use "++ix" by default is good advice.

In any case, testing shows that ++ix is faster than ix++ for old LSL.

CODE
default
{
state_entry()
{
llOwnerSay("ready");
}

touch_start(integer total_number)
{
integer ix;
float t1;
float t2;

llResetTime();
for (ix = 0; ix < 10000; ++ix) {
}
t1 = llGetTime();

llResetTime();
for (ix = 0; ix < 10000; ix++) {
}
t2 = llGetTime();

llOwnerSay((string)(t2 - t1));
}
}

Consistently prints positive numbers (about .8). Exchanging ++ix and ix++ consistently prints negative numbers of the same magnitude.

I don't remember who it was who told us that the byte code for ++ix is less than for ix++. If asked, I would have said it was probably you.

I can't measure any difference between the two for Mono.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
04-26-2009 19:21
sometimes it's useful to get the current value, instead of the already incremented value, depending on the program logic (which I habitually forget to and write around it with --x)
_____________________
|
| . "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...
| -
1 2