Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Some new script calls I'd like

Myria Daguerre
Junior Member
Join date: 29 Apr 2004
Posts: 6
06-24-2004 23:09
key llGetCreator()
key llGetCreatorKey(key id)

These would work just like llGetOwner/llGetOwnerKey, except that they would return the creator key instead of the owner key. If creator is unknown (this appears as ";(nobody)" in newview), then these should return NULL_KEY. To be consistent with llGetOwner/llGetOwnerKey, an avatar should also be its own creator: for all avatars X, llGetCreatorKey(X) == X.


integer llGetType(key id)

Gets the type of object the given id represents:
TYPE_AVATAR
TYPE_OBJECT
TYPE_SCRIPT
TYPE_TEXTURE
TYPE_SNAPSHOT
TYPE_CLOTHING
TYPE_NOTECARD
TYPE_SOUND
TYPE_LANDMARK
TYPE_BODYPART
TYPE_ANIMATION

For convenience, these values can be equal to the INVENTORY_* constants of the same name (though TYPE_AVATAR would have to be different).

The purpose of this is to get rid of things like checking for llGetOwnerKey(id) == id to make sure an avatar, and not an object, is speaking to a listener. That's a hack, and this would allow it more concisely.


integer llCharAt(string str, integer index)

Returns the ASCII code of the specified character within string str, or -1 if the index is out of range. To be implemented correctly, the cast order in C++ should be:

(int) (unsigned int) (unsigned char) str[index];


string llChar2String(integer character)

Returns a single-character string with the specified ASCII character. It would be wise to limit character to 32 <= x <= 126.


list llListReplaceList(list src, integer start, integer end, list replacement)

Returns a new list with replacement replacing the specified elements of start. This is much simpler to use than llDeleteSubList and llListInsertList.

Melissa ©
Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
06-25-2004 07:34
The first one sounds like a good idea, the last one I have no strong opinion on.

Character functions are, IMHO, a bad idea.

First of all, hopefully, SL is UNICODE, not ASCII. Also, you should be able to do anything non-hackish you need to do with existing functions, and we have the base64 functions for encoding and xor'ing if needs be. And if you really really want to treat letters as numbers, you can use a list (list lTrans = ["a", "b", "c", ..., "A", "B",..."Z"]; ).

[edit: semi-colon, bracket damnit, not *wink*]
_____________________
Sarcasm meter:
0 |-----------------------*-| 10
Rating: Awww Jeeze!
Grim Lupis
Dark Wolf
Join date: 11 Jul 2003
Posts: 762
06-25-2004 08:13
I'm with Wednesday, except that I do have an opinion on the llListReplaceList. I'd like to see that one, myself.

But the character related stuff would only be useful if character was an intrinsic data type, which would make it a keyword, which would probably break some scripts somewhere. I hate it when LSL changes break existing scripts.
_____________________
Grim

"God only made a few perfect heads, the rest of them he put hair on." -- Unknown
Myria Daguerre
Junior Member
Join date: 29 Apr 2004
Posts: 6
06-25-2004 09:26
From: someone
Originally posted by Wednesday Grimm
First of all, hopefully, SL is UNICODE, not ASCII.


Unfortunately, Second Life is not Unicode.

From: someone
Originally posted by Grim Lupis
But the character related stuff would only be useful if character was an intrinsic data type, which would make it a keyword, which would probably break some scripts somewhere. I hate it when LSL changes break existing scripts.


Characters can be added to the language without a new type. integer already exists and is sufficient for this use. The only real addition to the language I guess would be things like 'A' which would be exactly equivalent to the literal integer 65, which wouldn't break anything.

Melissa
Oz Spade
ReadsNoPostLongerThanHand
Join date: 23 Sep 2003
Posts: 2,708
06-25-2004 11:15
I support GetCreator and ListReplaceList, all the others I don't understand (llGetType) the use or know if its really needed or not (the Char thingy).
_____________________
"Don't anticipate outcome," the man said. "Await the unfolding of events. Remain in the moment." - Konrad
Myria Daguerre
Junior Member
Join date: 29 Apr 2004
Posts: 6
06-26-2004 21:01
The point of llGetType primarily is to distinguish between avatars and objects, especially when one is speaking to your listener. Currently the only way I can see to do this on a consistent basis is to check for an object owning itself; for all avatars X, llGetOwnerKey(X) == X, something that is never true for objects.

Melissa
Oz Spade
ReadsNoPostLongerThanHand
Join date: 23 Sep 2003
Posts: 2,708
06-26-2004 23:48
You could also use llKey2Name, as it always returns blank for objects.

But yeah I get what you mean now, wouldn't be bad to have.
_____________________
"Don't anticipate outcome," the man said. "Await the unfolding of events. Remain in the moment." - Konrad
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
06-26-2004 23:53
From: someone
Originally posted by Oz Spade
You could also use llKey2Name, as it always returns blank for objects.


Nope. llKey2Name returns the object's name if it is within the simulator of the caller.
==Chris
Oz Spade
ReadsNoPostLongerThanHand
Join date: 23 Sep 2003
Posts: 2,708
06-27-2004 00:01
Really? Hmm, wonder why it hasn't worked for me before then.

N/m on that then. :P
_____________________
"Don't anticipate outcome," the man said. "Await the unfolding of events. Remain in the moment." - Konrad
Gunzour Yellowknife
Registered User
Join date: 5 Jun 2004
Posts: 21
06-27-2004 10:23
I definately would like to see llGetCreator and llGetCreatorKey. It seems like an oversight to not have these in LSL.