Difference between revisions of "Extensible Prim Attributes from LSL"
(→Limits) |
|||
Line 19: | Line 19: | ||
This MetaInformation would be tagged with a numeric identifier, always 0 for llSetMetaInformation. When the feature is accepted and new, feature specific LSL functions are added, this numeric identifier can simply be changed, requiring very little code change. | This MetaInformation would be tagged with a numeric identifier, always 0 for llSetMetaInformation. When the feature is accepted and new, feature specific LSL functions are added, this numeric identifier can simply be changed, requiring very little code change. | ||
=Examples= | =Examples= |
Revision as of 14:56, 26 June 2007
The Chicken and the Egg
There are many new features that can be implemented almost exclusively on the client side, but the main intention would be their use from LSL and/or the server side. The OpenSL project has little ability to work on these features without the corresponding LSL/server-side changes, and LL might be loathe to write in LSL/server side changes until the client side abilities are in place. This creates a classic chicken and egg problem.
Some examples of this are:
The Solution
A generic LSL function set to allow prim-specific communications to the client. This would allow tagging prims with arbitrary communications that the client can pick up and use for whatever purpose.
llSetMetaInformation(string payload); //sets metainformation for tag 0 for this prim.
This would be on a per-prim level, similar to llSetObjectDesc, except hidden to the user. The limit should be at least 1024 bytes. The payload need not persist when the asset is saved to inventory, but it would be nice if it did.
This MetaInformation would be tagged with a numeric identifier, always 0 for llSetMetaInformation. When the feature is accepted and new, feature specific LSL functions are added, this numeric identifier can simply be changed, requiring very little code change.
Examples
Web Textures
llSetMetaInformation("webtexture, face1, http://www.myhost.com/webtexture.php?text=my%20text"); //inserts string into tag 0 for this prim.
This way web textures could be implmented on the client. When LL decides to officially support web textures, they will assign it a new tag number (lets say 2) and add:
llSetWebTexture(string url, integer face); //Updates tag 2 with "webtexture, face<facenum>, <url>"
Which will simply be equivalent to a llSetMetaInformation on tag 2, using the same format that the feature used before, but now packaged in a nice "consumer friendly" format.
Full Boolean CSG Support
Something even as advanced as full boolean CSG support can be added if we had this feature.
During development the developer and tester could use something like:
//Causes the prim to subtract from intersecting prims. llSetMetaInformation("csg, not"); //inserts string into tag 0 for this prim.
Then later on, once CSG was supported and fully tested in the client, the tag number could be changed, and instead of adding an LSL function, the functionality could be added to the build tools in the form of GUI. The key is that this feature provides a test bed for new prim-related attributes that are primarily client-side features, but require minor server-side changes.
Implementation
The sim->viewer protocol already seems to include an extensible prim property functionality.
However, this functionality is not suitable for what we want, currently, according to Kelly.
From what I can tell, it's something like this:
ExtraParams { U8 num_params param { U16 param_type S32 param_size Variable Data } param { ... } param... }
The equivalent viewer->sim structure seems to be called ObjectExtraParams. Most newer prim properties like flexible and lighting use this more flexible dynamic prim property system.