llSetMemoryLimit Mono And A Bit Of Confusion

I’m going to talk here about a relatively new scripting function, llSetMemoryLimit, this may not work the way one thinks it does, but it basically sets the upper memory limit your script can use. I’m far from being a scripting expert but this looks like a function that people should get used to using where they can, even if it might not actually save memory for a sim the way we may think it should, I’m not sure how the server handles the space.

Anyway, when you create a new script, if Mono is ticked, it has an upper memory limit of 64kb, if you don’t compile the script as Mono, it compiles as LSO, and that has an upper memory limit of 16kb, with LSO it’s a hard rule, all LSO scripts have an upper limit of 16kb, llSetMemoryLimit won’t work with LSO, with Mono however you can set a lower limit. In this post I’ll show how this works with a very basic script, a notecard giver.

I’ll start by visiting LSL Wiki and going to the llGiveInventory section. LSL Wiki isn’t as up to date as the LSL portal but I often find the discussions and examples on LSL Wiki more helpful. So all I want is a notecard giver, I rez a prim, go to the contents tab, click new script, get the default hello world script, delete everything and replace it with this (with apologies for the horrid coding style):

default
{
state_entry()
{
}
touch_start(integer total_number)
{
llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_NOTECARD, 0));
}

Then I make sure there’s a notecard in the contents of the prim and when I touch it, I’ll get a Notecard. However this is a Mono script so it defaults to an upper memory limit of 64kb:

Default Mono Script Limit

So let’s look at how we can reduce that using llSetMemoryLimit()

Continue reading “llSetMemoryLimit Mono And A Bit Of Confusion”

Scripted Tools For Estate Owners And Managers Coming To A Sim near You Soon

As we ponder what the hell is going on with Olivia Dunham Torley it’s time to take a peek at what those sneaky Lindens are doing at the beta server office hours. Cerise Sorbet was quick to spot a new LSL scripting command being announced, and posted to the official forum about it. Coming soon, well if you’re on BlueSteel it’s already here, is llManageEstateAccess:

  • integer llManageEstateAccess(integer action, key id)
  • Use to add or remove agents from the estate’s agent access or ban lists or groups from the estate’s group access list.
  • Only works for objects owned by the Estate Owner or an Estate Manager.
  • Calls are throttled at a rate of 30 calls per 30 seconds.
  • Returns TRUE is action is sent to the database.
  • Returns FALSE if throttled, invalid action, invalid or null id or object owner is not allowed to manage the estate.

Actions for llManageEstateAccess:

  • ESTATE_ACCESS_ALLOWED_AGENT_ADD: Add the agent to this estate’s Allowed Residents list.
  • ESTATE_ACCESS_ALLOWED_AGENT_REMOVE: Remove the agent from this estate’s Allowed Residents list.
  • ESTATE_ACCESS_ALLOWED_GROUP_ADD: Add the group to this estate’s Allowed groups list.
  • ESTATE_ACCESS_ALLOWED_GROUP_REMOVE: Remove the group from this estate’s Allowed groups list.
  • ESTATE_ACCESS_BANNED_AGENT_ADD: Add the agent to this estate’s Banned residents list.
  • ESTATE_ACCESS_BANNED_AGENT_REMOVE: Remove the agent from this estate’s Banned residents list.

This has potential!

Continue reading “Scripted Tools For Estate Owners And Managers Coming To A Sim near You Soon”

Follow

Get the latest posts delivered to your mailbox: