Dec 062013
 

We’re going down the pub! Warning, this post may containt geekiness and nuts.

One of the things that has always puzzled me in Second Life has been the lack of arrays in LSL. I mean arrays, they are sexy, they are useful, they store data, they beat lists, strided lists and any other sort of list by a country mile. Basically arrays are too sexy to be bodged as lists.

I didn’t do much scripting in Second Life because scripting consumes much time in my day job, so I felt it would be like a busman’s holiday, but arrays, how can you not have arrays? That was one of my first questions to myself back in 2007 when I joined Second Life and it remains a questions that puzzles me as we come close to 2014.

I was so scarred by Second Life not having arrays that when I took a look at Cloud Party and saw that they supported arrays, I cheered!

The power of arrays should not be underestimated, indexof, finding matches of, adding, removing, substrings, two dimnensional! Arrays are bloody sexy and more importantly, they are bloody useful.

Continue reading »

Feb 132013
 

I’m going to go through a little bit of scripting here, caveats apply, I have a very basic understanding of LSL, this can almost certainly be done in a more efficient manner and you use this advice at your own risk! Now on with the show. Also the scripts I have examples of don’t fit the window, so you’ll need to use the scrollbars to see it all.

One of the simple scripted tools in Second Life is a notecard giver or a freebie object giver. These are useful and the script is simple, if you want to get funky and have reports from who touched your board then it gets a tad more complicated, but the basic functionality is a simple script:

default
{
state_entry()
{
}

touch_start(integer total_number)
{
llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_OBJECT, 0));
}

}

That’s it, just put a prim with your freebie goodies inside the object giver prim and you’re good to go. However we can build slightly on this by using both sides of the object giver prim to give a different object, to do that we can use llDetectedTouchFace, which will, as the name implies, detect which face of your prim is touched.

So let’s start by creating a new prim and then creating a new script. To do this just go to the content tab of your prim and click create new script.

Continue reading »

Nov 242012
 

This is part one of what will probably be a one part series, but you never know. Anyway, there are some odd tips and tricks around LSL and I’m quickly going to look at one of them. Ok so, here’s the scenario, Unhinged – A festival for Eku’s head, has more goings on in terms of DJ events, than you can shake a stick at. So say I wanted to list some upcoming events I’d maybe have a board with this:

An Image Should Be Here

Unhinged Events

However this is a fast changing list of events and before I know it, my board needs to say this:

 

An Image Should Be Here

Later Events For Unhinged

Now if I were using textures of course, these boards inworld would look funkier, the thing is I can make them a bit funkier, however I’m not using textures, I’m using llSetPrimMediaParams tricks. This is an imperfect solution but one with potential because I’m using HTML.

Continue reading »

Nov 072012
 

I haven’t been that interested in the US election, not being an American or having the right to vote in the election helps a bit there. The world economies being in a mess no matter who wins, helps there too but I did want Barack Obama to win largely because it’s a slap in the face for The Wonga party in government in the UK who would have seized upon a Mitt Romney win to justify their heinous mess of a job they’re doing in Government. However it’s not like Labour offer anything much better, just a little bit in the right direction but we’re not exactly spoilt for choice.

However, when Linden Lab are feeling down about the views people post to their employees, which is allegedly part of the reasoning behind the mistaken policy of hiding Jira’s, they should be grateful that they don’t have Donald Trump as a disgruntled customer because his twitter meltdown was truly spectacular, I mean really really spectacular. That’s some funny stuff.

However, let’s move on to an area where Linden Lab are very good, scripting resources. This doesn’t mean scripting in Second Life is easy, but let’s give credit to the amount of resources available.

Continue reading »

Oct 282012
 

LSL HTTP Server is a lovely concept, unfortunately it has drawbacks. This works great when you want information from external servers, but it’s a pain when you want information from inworld objects. I’ve been working on making a notecard giver that you update centrally and it updates your remote boards, HTTP is a great way of doing this, the only problem is, URL’s are temporary.

What we really need is for these addresses to take advantage of DNS for simple tasks, so instead of the address being an IP address, it is something along the lines of http://www.secondlife.com/region_name/objectAddress. This is why DNS is such a great concept.

Currently I have to use a system of updating my remote boards using llEmail to inform them of the new URL. This means that I need to store the extenal objects email addresses and use llEmail to update them, this is not only cumbersome, it’s a waste of resouces as I have to communicate with a system that Linden Lab themselves recognises as having serious bottleneck issues.

Continue reading »

Jan 162012
 

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 »

Oct 172011
 

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 »