Scripting Features

  • Search existing ideas before submitting
  • Use support.secondlife.com for customer support issues
  • Keep posts on-topic
Thank you for your ideas!
llSetPlayerController - Set player controller params
I'm not 100% sure of the implementation, but maybe something similar to llSetAnimationOverride: First off, you need to request a permission such as llRequestPermissions(target, PERMISSION_CONTROL_PLAYER) llSetPlayerController(list params) Where params is a list of PLAYER_CONTROL_* followed by data. Suggested PLAYER_CONTROL_* settings: PLAYER_CONTROL_JUMP_HEIGHT, (float)percent - Modifies the current jump height by percent. Some upper limit could be added. 0 would disable jumping entirely. This would be useful because the default jump height is so unrealistically high that most games end up disabling jumping altogether. PLAYER_CONTROL_RUN_SPEED, (float)percent - Modifies the base run speed by a percentage. Some upper limit could be added, 0 disables running. PLAYER_CONTROL_WALK_SPEED, (float)percent - Modifies the base walk speed by a percentage. 0 could disable walking entirely. An upper limit could be set. These two would be useful for games and roleplays where a player could get a temporary speed boost, or perhaps slow players down while carrying heavy objects. The one concern I can think of is running/walking animations going out of sync, but that would be up to the dev to supply appropriate animations. PLAYER_CONTROL_CLIMB_RADIUS, (float)radians - Modifies how steep inclines the player can walk up. This would be useful because right if there's just a minuscule incline to a wall, players can walk right up it. The angle players can walk up in SL is very small.
4
·
tracked
llLinkSetDataBytes/ llLinkSetDataBytesFound
note: I didn't set the title to "LinkSet" and I have no clue why it's doing that, considering it's "Linkset" in the editor! weird! This suggestion was brought up a year ago and closed a few days later. I think, with respect to Spidey & Lucia, it deserves a second crack with a more well-defined spec, because we are actually missing an important function here. Problem There is currently only one function that returns any useful data regarding the memory usage of the linkset datastore - llLinksetDataAvailable , which only returns the bytes remaining for the entire datastore. It is currently impossible to measure the bytes used by any specific pair(s) without either reading them and running a base64 count (expensive, risky) or deleting them and measuring the change in available bytes (pointless). This is a problem because there is no limit on the size of linkset data pairs. Unless you only have a single pair in the datastore, it is currently impossible to tell if the pair you are about to read will be too large and crash your script. To that end, it is trivial to come up with an extremely tiny script that creates a pair so big that it is practically guaranteed to crash any script that tries to read it. Nor is it difficult to imagine scenarios where this could occur unintentionally. This will become even more likely with Luau support as Lua scripts (and, AIUI, Luau-compiled LSL) will switch back from UTF-16 to UTF-8, changing how strings count against script memory and facilitating bigger pairs. Proposal llLinksetDataBytes( string name ) string name - The key of the linkset name:value pair to count the bytes of. Returns an integer with the number of bytes used by the pair (including its name and 32-byte passphrase hash, if used), or 0 if it does not exist. llLinksetDataBytesFound( string pattern ) string pattern - A regular expression describing which keys to sum the bytes used of. Returns an integer with the number of bytes used by all keys matched by the regex. The point of these function names is to avoid confusing them with counting length as opposed to bytes . Also, linkset data storage is not "memory" per se, so I don't think the previous suggestion of llLinksetDataMemoryFound is semantically correct. Use Cases llLinksetDataBytes can get the bytes used by a linkset data pair without needing an expensive, risky, or destructive workaround. This is a separate function from llLinksetDataBytesFound because LSL lacks a regex escape function (although it can be done manually, just inefficiently) so it is more efficient if you want to check a single pair immediately before reading it. llLinksetDataBytesFound allows you to measure all pairs matching a certain regex at once. For example, say you have two concurrent data schemas in a single object - some pairs start with "array" and are used for a large array-like structure, some start with "config" and store notecard values, whatever. Trying to actually measure the bytes used by either of these schemas individually is potentially memory-intensive and slow, even though we already have llLinksetDataFindKeys and llLinksetDataDeleteFound . The only current practical solution is to run the aforementioned base64 count on every value you write, modify, or delete, and maintain a byte total manually. Additionally, llLinksetDataBytesFound makes it possible to calculate the entire space available to the datastore (128kB as of this writing, though it was once already raised from 64kB). This is currently impossible because there is no function that returns the complement of llLinksetDataAvailable , nor is there a function that returns the entire capacity, à la llGetMemoryLimit . This function fills that gap without needing to provide a function to return what may well be a constant (but not guaranteed!) 131072 forever. Caveats It is possible that someone could consider the bytes used by a protected pair to be sensitive information that this function shouldn't disclose; however, since llLinksetDataAvailable can be used to do this already, the novelty of this risk would be negligible. Since the bytes within the linkset datastore are UTF-8 but get read into Mono-compiled scripts as UTF-16, the bytes reported will not exactly match the bytes the value would use once read, although any value is better than nothing. (This won't be a problem under Luau, and wasn't a problem under LSL-2, just Mono.)
2
·
tracked
Add a way to access linkset data from a different linkset.
Proposal: llLinksetDataWritePublic( string name, string value, string password, integer perm_mask ) If password is an empty string, it does what llLinksetDataWrite does, plus setting a perm mask for that name. If password is not an empty string, it does what llLinksetDataWriteProtected does, plus setting a perm mask for that name. Perm mask can be a bitwise combination of: LINKSET_DATA_OWNER_READ: Allows scripts with the same owner to read. LINKSET_DATA_OWNER_WRITE: Allows scripts with the same owner to write LINKSET_DATA_GROUP_READ: Allows scripts with the same group to read. LINKSET_DATA_GROUP_WRITE: Allows scripts with the same group to write. LINKSET_DATA_PUBLIC_READ: Allows any script to read. LINKSET_DATA_PUBLIC_WRITE: Allows any script to write. The permissions are dropped on: Using llLinksetDataWrite / llLinksetDataWriteProtected on the same name (this fixes the issues of someone preloading an object with tons of public values). Deleting the key through llLinksetDataDelete... or llLinksetDataReset. To access the data from a different linkset, use: string llLinksetDataReadRemote(key uuid, string name, string password) integer llLinksetDataWriteRemote(key uuid, string name, string value, string password) These function exactly the same as the non-remote versions, except with a key specifying the prim to read from. ---- Why this? ---- If you're gonna work on a large scale project in SL you're likely going to have to keep some data synced across linksets. This can be anything from a game controller keeping list of player HUD UUIDs, or player metadata such as skill points, status effects such as "broken leg" etc that players and NPCs can react to. In order for linksets to acquire such data, you have a few options: A remote server / experience keys: These are relatively slow, and asynchronous, meaning you often have to rely on caching since you can't easily or frequently access the data. Listeners: These are faster, but requires some sort of syn/ack system, fallbacks (because listeners have a tendency to fail during lag spikes) and a lot of string parsing, eating up significant script time as you start adding more and more NPCs that all need to be kept updated. Descriptions: These are fast and synchronous, but limited to 127 characters and don't allow special characters. And the attachment would need to be either attached to a non-HUD slot, or you'd have to cache the HUD UUID somewhere. In which case you're back to square one. Being able to using public linkset data would have the following benefits: The data is synchronous. The data is never dropped because of lag spikes. The data doesn't require two-way communication. The data isn't limited to 127 characters and may use unicode. The data doesn't require your script to perform time-consuming string parsing since linkset data uses key/value pairs. Personally I'm mostly interested in the reading part, but I know some people have been asking for the ability to write, so I included it in the proposal.
22
·
tracked
Adding more control() inputs: game_control() without a game controller
The provisioned features and power of the game_control() event are impressive, and miles ahead of the support available to scripters for processing input events for standard keyboard+mouse usage. Currently there's no way to respond to other mouse buttons (scroll wheel, middle click, right click, shoulder buttons) and there are no vectors for user input aside from the standard movement keys. Thus if someone wants to make a game for users without a controller, they're limited to the interactivity of Quake 1, which is notable as being an aggressively minimalist design (shoot only, all doors open automatically) that was largely abandoned by other games. For SL to really work as a game environment, we need a way to bind a "use" key, or keys for reloading weapons, or for using special powers like a quick melee attack. I'd like to propose the following: - Adding 6 new mouse button bits to control(): scroll up, scroll down, mouse 2 (right), mouse 3 (middle), mouse 4 (shoulder 1), mouse 5 (shoulder 2) - Adding 4 new general-purpose control inputs to control(): action 1, action 2, action 3, action 4 - Adding the general-purpose action inputs to Preferences › Controls - Allow all control() bits to be mapped to controller buttons so vehicles without game_control() can be used with controllers and receive all the benefits of these new features — though this could/should be a feature request on its own The bitmasks for level and edge have plenty of room for these 10 new bits, so I don't think this is too crazy a request.
4
·
tracked
Load More