Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Expansion of LSL built-in functions

Kex Godel
Master Slacker
Join date: 14 Nov 2003
Posts: 869
02-26-2004 12:12
LSL is an awesome tool that really makes SL stand out from the other "virtual world" environments, because it lets us bring things to life, and prevents our world from being just a giant static art sculpture gallery.

In many cases, the Linden Scripting Language is sort of a way to automate the same capabiltiies that we can do manually (ie positioning things, rotating them, scaling them, setting object name, etc)

However, there are many capabiltiies that we have, and information that we can gather that is completely inaccessible in LSL, even with workarounds.

The built-in functions provided to us in LSL is a set API of around 240 functions. These functions form a "vocabulary" or toolset with which we can work. Through the API, we can gather information out our environment, and make changes to the environment. We build a system between this input and output by writing our scripts.

What I'd like to see is a way to expand this API vocabulary, so that we can do many more things and learn more about our environment. Each new function can expand our creative possibilites by another whole dimension. Each new addition of new API calls increases our creative abilities exponentially.

I ask that our language be extended so that many of the things that we can do manually be implemented to be capable of being done by script.

Here's a short example of some functions that we can do manually, but would really expand our creative domain if we could also do them by script:

Edit Panel:
llSet/GetObjectDescription()
llGetObjectCreator()
llSet/GetGroupModifyPerm()
llSet/GetObjectPermissions() // includes "anybody can move", "anybody can copy"
llSet/GetObjectNextPermissions()
llSet/GetSaleAmount()
llSet/GetSaleType()

llSet/GetPrimHollow()
llSet/GetPrimHollowShape()
llSet/GetPrimCutB()
llSet/GetPrimCutE()
llSet/GetPrimTwist()
llSet/GetPrimShearX()
llSet/GetPrimShearY()
llSet/GetPrimTopX()
llSet/GetPrimTopY()
llSet/GetPrimDimpleB()
llSet/GetPrimDimpleE()
llSet/GetPrimAdvancedCutB()
llSet/GetPrimAdvancedCutE()
llSet/GetPrimType() // cube, sphere, etc
llSet/GetPrimMaterial() // metal, glass, etc
llCreateBasicPrim()
llSet/GetPrimBump()
llSet/GetPrimShine()
llSet/GetTextureFlipX()
llSet/GetTextureFlipY()

Land Tools:
llGetParcelName()
llGetParcelDescription()
llGetParcelPrice()
llGetParcelProperties() // no build, no script, damage, no fly, etc
llGetParcelAutodelete()
llGetParcelSize()
llGetParcelPrimsUsed()
llGetParcelPrimsAvailable()
llGetClaimDate()
llParcelReturnObjects()
llSet/GetAutoDelete()
llParcelBanAdd()
llParcelBanRemove()
llParcelBanList()
llParcelAccessAdd()
llParcelAccessRemove()
llParcelAccessList()

Miscellaneous (some may require new dialog-permission acknowledgements):
llGetAvatarRot() // which way is avatar standing
llGetAvatarHeadRot() // which way is avatar looking
llSet/GetAvatarAway() // true/false
llSet/GetAvatarBusy() // true/false
llSet/GetAvatarGroup() // let you change groups
llGetAvatarGroupList() // see what groups are available
llAttachInventoryItem(key id) // attach item from inventory to your av
llSet/GetAvatarClothing(integer slot, key clothing)
llSet/GetAvatarLandmark(string region, integer x, integer y) // sets your landmark beacon
llAvatarSit(key target) // make avatar sit on target
llAvatarStand()
llAvatarFly()
llGet/SetAvatarRun()
llShowProfile(key) // show profile of person on your screen
llMuteChat() // adds person or object to mute list


Please feel free to follow up with functions which you think would benefit LSL, but please only mention things which are already within SL's feature set -- things which we can do manually but can't do automatically in LSL.

If you've got an idea for an entirely new feature, please post a new thread.

Also if you think any of the above functions would have problems being implemented, please feel free to discuss why. I know some of the ones marked under "miscellaneous" might seem somewhat awkward to implement, but most of those are proposed for objects which you would wear as attachments.

I hope I get at least a few replies, as most of my suggestions don't seem to generate much discussion =/

Thanks for reading!

-- Kex =D
Francis Chung
This sentence no verb.
Join date: 22 Sep 2003
Posts: 918
02-26-2004 12:39
I endorse this product and/or service :)

That's a pretty good list. And, to beat a thorougly dead horse,
llWriteNoteCardLine()
and in a similar vein
llWriteToTexture()


Sensor tools:
llDetectedNumberOfPrims()
and
llDetected*All the things in the edit panel()

BTW, does llAvatarStand() do the same thing as llUnsit()?
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
02-26-2004 13:23
The addition of llSet/llGet top size, shear, and so on is one of my most-wanted features. If we could set shear and top size via LSL, you could do so much with autorezzers.
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Oz Spade
ReadsNoPostLongerThanHand
Join date: 23 Sep 2003
Posts: 2,708
02-26-2004 20:25
I fully endorse this idea/feature(s)!

The clothing one is a bit confusing, what would this be used for? To get the key/name of the clothing?

Maybe also:

llOpenWindow(string window_name); //Where window_name would be like "inventory"

llGetOpenWindows(); //Would return a list maybe with the opened windows.

Only two I could think of that haven't been covered already.

But YES to everything in the Edit menu being LSLable and YES to everything else listed.
_____________________
"Don't anticipate outcome," the man said. "Await the unfolding of events. Remain in the moment." - Konrad
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
02-26-2004 22:25
Inviting people to groups?
_____________________
</sarcasm>
Kex Godel
Master Slacker
Join date: 14 Nov 2003
Posts: 869
02-27-2004 12:35
llWriteNotecardLine() should definitely be in the list somewhere =)

I wouldn't want an automated way to invite people to groups, but I'd like an easy way to switch between the groups I am a member of, so that I can script a command-line trigger to easily switch them.

The twist / hollow / etc are probably the most wanted by me as well, but most of the ones near the top of the list seem like functions that should have already been implemented.

The suggested functions near the bottom are second-priority to the rest, but they would be nice. Some of them are kind of "aggressive", but they can be required to have permissions granted to them like several other functions already do (ie llStartAnimation).

As for the clothing functions, I'd like to have an easy way to script wearing clothing outfits, since we don't have softlinks in our inventory for (no copy) items. Presumably the way something like this woul dwork is you'd have the UUID for clothing you own, and you could use llSetAvatarClothing(key) to wear it, or llGetAvatarClothing(CLOTHING_SHIRT) to get the key of what you're currently wearing.

Another function that might be useful to some is llGetMoneyAmount() to return an integer indicating how much money you have. This would probably be a permission-requiring function call as well.
Neil Protagonist
FX Monkey
Join date: 11 Jul 2003
Posts: 346
02-28-2004 20:29
I fully endorse this list,

of particular importance to me personally is the ability to set clothing and also write to a notecard.


I also would not mind seeing some of the following

llSetDebugOption(DebugConst, t/f) Sets debug options like fog on/off and opens/closes texture console etc.
llSnapshot(string name) forces a snapshot from owner.
llGetRank(CategoryConst, key id) gets the av's rank in the leaderboards in the specified category.

I'd like to see these two be settable as well.
llGetAvatarRot() // which way is avatar standing
llGetAvatarHeadRot() // which way is avatar looking
Chromal Brodsky
ExperimentalMetaphysicist
Join date: 24 Feb 2004
Posts: 243
03-01-2004 07:02
As long as we're making wishes, I might as well commit to writing a few other function-related ideas.

It'd be nice if there were the idea of a 'script library' which would be a set of declared functions that would be globally available to scripts. This would be useful both for cleaning up script code appearance. It's also intriguing for things like scripting groups who might have libraries that are group-owned and accessible.

I guess the obvious danger is that scripts are currently self-contained (unless they're referring to some NoteCard content, anyway), and dividing essential script components into library and script might be asking for trouble. Perhaps if the library had to be installed (e.g.: #included) as an instance in each object to be used...

I couldn't agree more about the potential usefulness of additional 3D primative methods; The ability to hollow/unhollow prims on the fly is particularly intriguing from a building standpoint, and the shearing/twisting could be very nice for animation effects...

Oh well, I should shut up new. Talk about being a precocious newbie. ;)
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
03-01-2004 11:47
From: someone
Originally posted by Chromal Brodsky

It'd be nice if there were the idea of a 'script library' which would be a set of declared functions that would be globally available to scripts. This would be useful both for cleaning up script code appearance. It's also intriguing for things like scripting groups who might have libraries that are group-owned and accessible.

Oh well, I should shut up new. Talk about being a precocious newbie. ;)


Who said you could talk!? Get the hell out! Haha, just kidding. Welcome to SL. :D

The ability to create script libraries is hot on my list too. You can already do it in a manner of speaking, though. Use llMessageLinked to communicate between two scripts in one object. That way, you can sell a script as no edit/no copy and then allow others to use it as a closed-source library. Or you can GPL it. You know, if you're one of those filthy Linux hippies. *runs away*

If you need a hand, feel free to IM me in-world.
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Cath Coral
Junior Member
Join date: 17 Jan 2004
Posts: 1
03-03-2004 11:14
Me too!

I just found out that apparently there's no way to get an object's creator. This would be sooooo useful!

Cath.