• 24Nov

    Serving simple HTML by LSL script

    I’ve written an LSL script which “serves” custom-generated HTML via a neat trick I discovered. But don’t bust out the champagne just yet — this method is extremely limited, so I don’t expect this to revolutionize HUDs or anything like that. Still, it’s a fun curiosity.

    The trick is this: If you use text of the form “data:text/html,[html code here]” as the web URL, Firefox (and maybe other browsers?) will render the HTML code as a web page. For example, visit data:text/html,<html><body><h1>Oh hai!</h1></body></html>, and Firefox will render the words “Oh hai!”. It’s not accessing a web page, and it’s not loading a local HTML file, it’s loading the HTML code from the pseudo-URL.

    The same trick works in SL as well, by setting the parcel media URL to the “data:text/html” string. You can use an LSL script to generate the HTML code and set the parcel URL, or even set the URL for an individual avatar. The result is that your LSL script acts as a very simple web server!

    However, as I mentioned, there are some serious limitations: SL won’t let you set the web URL to a string longer than 254 letters! That means you have to cram all the HTML code into that tiny string, which severely limits the complexity of the HTML you can display.

    Another problem is that the method may not work for other web engines besides Firefox / Mozilla. Linden Lab is (or was recently) working on switching to WebKit, the engine used by Safari, for rendering HTML. That’s good news, since WebKit is some great software, but this little trick might stop working when they switch. So, I wouldn’t rely on it.

    So, I don’t expect this method to be more than a silly toy for programmers to play around with. But it is that! And on the plus side, there are signs that we might get proper HTTP server functionality in LSL sometime in the future, which would be a great boon to many scripting industries in SL.

    You can get a full-perm copy of the object and script in SL at my sandbox or copy the following code (below the fold, if you’re viewing this on my blog front page) into an LSL script in your own object (in which case you should apply the “*Default Media Texture” to your prim from the Library, or you won’t see anything). Continue reading »

  • 02Nov

    Tired of those beautiful, photo-realistic sunsets? That new-fangled Windlight rendering engine slow your compy to a crawl? Want to relive the good old days, back when voice chat was new and strange, and Linden Lab even bothered to pretend to communicate with its customers?

    Well now you can!

    … Actually, you’ve been able to do so for a long, long time — ever since the Día de Liberación back in summer 2007. One of the benefits of “message liberation” was that you wouldn’t need to download a new SL viewer just because they made some server changes; old viewers would continue to work with new sims.

    And in fact, that has held true, even to today. The only thing stopping you from using a 1.18-series (pre-Windlight) viewer is that annoying “You must download the latest version to continue” message, which is easily bypassed with a trick I’ll describe below.

    But what of that mandatory security update in early October? Or the security update and protocol switch from UDP to HTTPS less than two weeks before that? Wouldn’t those issues prevent old viewers from connecting?

    Apparently not. As of this writing, even 1.19 and 1.18 viewers (but not 1.17 or other older, “unliberated” viewers) can connect to SL with nary a hitch, though they’re probably still susceptible to the security issues mentioned above. As usual, the purportedly required updates are, in fact, not.

    So, what is this trick, this secret knowledge needed to bypass the download prompt and log in with older viewers? Change the channel. It’s an old trick, though there was some concern that it wouldn’t work anymore since the change to HTTPS. Fortunately, those concerns have not come to pass, and the SL servers seem perfectly happy to use UDP with older viewers.

    Changing the channel is easy. The viewer application takes a parameter, “–channel CHANNEL”, which sets the channel to use. The process for giving that parameter varies between operating systems. The processes are described on the SL wiki, but I’ve included a brief overview below.

    • Windows: Create a shortcut to the older SecondLife.exe. Open up the shortcut’s properties (right click > Properties) and edit the shortcut path. After SecondLife.exe but before the closing quotation mark After the closing quotation mark, add: --channel Happydays
    • Mac: Open up the terminal and run these two commands (adjust the first path if your Second Life app isn’t in Applications):

      cd "/Applications/Second Life.app/"
      echo "--channel Happydays" >> Contents/Resources/arguments.txt

      (Mac users, leave a comment if the above solution didn’t work for you. I don’t have a Mac handy to test it!)

    • Linux: Run the viewer as: secondlife --channel Happydays

    You should now be able to log in to SL with your retro viewer version. Enjoy, good night, and good luck!

    P.S. Don’t have the installer for the old viewer laying around? No worries, they’re still available for download. Mad props to McCabe Maxsted for putting that wiki page together!

  • 26Sep

    Here’s an updated version of an oldie but a goodie. Back in January 2007, I found out how to disable (on your computer only) the SL typing sound — the loud, annoying click-clack-clack sound that plays whenever you or anyone around you starts typing something into chat.

    It has been nice and peaceful since then. But tonight, while testing the latest build of Imprudence, I heard it for the first time in 21 months (since my regular SL settings weren’t loaded). Blech! What a racket. I went to disable it, but then I thought of something better: I could replace it with a nicer sound. That way I’d still have an audible indicator of when someone was typing (something I realize I had been missing).

    After rummaging around in my inventory a bit to find an appropriate sound, I settled on a freebie cricket chirp sound. It was full perm, so I grabbed the asset UUID: b3831ff2-a197-62df-34f7-a83be592c1da

    So, I enabled the Advanced menu (Ctrl+Alt+D, or Cmd+Alt+D for you Mac-types), opened up Advanced > Debug Settings, typed in UISndTyping, then pasted in b3831ff2-a197-62df-34f7-a83be592c1da in the box at the bottom, replacing the UUID that was there. Close up Debug Settings and… voila! Now instead of clacking on a keyboard, everybody chirps like a cricket when they start typing!

    Of course, if crickets aren’t your thing, you can use any sound at all, as long as you have the UUID for it. You can get that by right clicking on it and selecting Copy Asset UUID — but only if you have full permissions on the item.

    So, enjoy your crickets etc.! If you find a free sound that you like even better than crickets, leave a comment with the UUID or link to where it can be downloaded so I can try it out. (No illegal rips, please!)

  • 31Jul

    Wonder where the “Tools” menu went in Second Life viewer 1.20? Linden Lab decided, in the interest of reducing the number of menus presented to the user, to make it only visible when the “Build” window is open (Ctrl-3).

    This change was rather unpopular, and Linden Lab has, thankfully, decided to revert it in a future version. But in the meantime, we’re stuck with it — or we would be, except there’s a quick and easy work-around to disable it! All it takes is a text editor (Notepad, etc.); you don’t even have to compile anything. (If you’re really lazy, you can just download my file and put it in the right spot, as described below.)

    This trick is a simple one. Since SL looks for the Tools menu by name to find which menu to hide, all you have to do is change its name, and SL won’t find it, and it’ll stay visible all the time!

    The really easy way (download the replacement file):

    1. Download my pre-chewed XML file to “Second Life/skins/default/xui/en-us/”, replacing the existing one. On OS X, go to Applications, ctrl-click on “Second Life”, choose “Show Package Contents”, then put the file in “Contents/Resources/skins/default/xui/en-us/”.
    2. Restart SL, enjoy.

    The slightly less easy way (edit the file yourself):

    1. Open up “Second Life/skins/default/xui/en-us/menu_viewer.xml” in your text editor. On OS X, go to Applications, ctrl-click on “Second Life”, choose “Show Package Contents”, then open up “Contents/Resources/skins/default/xui/en-us/viewer-menu.xml” with TextEdit (or your favorite text editor).
    2. Search for: name="Tools" (it’s on line 590)
    3. Change name="Tools" to name="Toolz" or some other non-Tools word.
    4. Save the file, restart SL, enjoy.

    Voila, your Tools menu will now be visible all the time. Piece of cake.

  • 06Jun

    Comparison of Blender and SL poses

    It’s done! I am pleased to present to you, SL Animation for Blender Newbs. It’s 6 pages long, with pictures. It might take you maybe 30 minutes or so to follow along, I’m guessing. If you have any feedback (e.g. suggestions or praise), leave a comment on any of the pages.

    Enjoy.

    Tags: , ,

  • 01Dec

    This should help anyone who wants to make images to be displayed in the SL (classifieds, picks, etc.) and not have them be horribly stretched or squashed by Linden Lab’s inconsistent use of image aspect ratios. I don’t bother to cover aspect ratios for textures to be used on prims, as the proper aspect ratio in that case depends entirely on the prim’s dimensions.

    If you’re making an image for…

    • a classifieds listing … use 10:7.
    • a parcel snapshot … use 10:7.
      (But know that it will be stretched horizontally in people’s picks.)
    • your own pick … use 16:9.
    • a 2nd life profile … use 4:3.
    • a 1st life profile … use 1:1.
    • a group insignia … use 1:1.
    • an invitation or ‘view me’ image … use powers of 2.
      E.g. 64, 128, 256, or 512 pixels wide/high.

    List of Aspect Ratios & Notable Places They Appear

    • 16:9 (1.78:1) — Profile (Picks)
    • 3:2 (1.5:1) — About Land (Options / Snapshot)
    • 10:7 (1.43:1) — Search (Classifieds, Popular Places, Land Sales, and Places), About Landmark
    • 4:3 (1.33:1) — Profile (2nd Life)
    • 1:1 (1:1) — Group Insignia, Profile (1st Life)

    Corrections? Questions? Tips? Leave a comment!

    Update, Dec 6:

    • Torley pointed out that Profile Picks are 16:9 (1.78:1), rather than 7:4 (1.75:1) as I had previously thought.
    • Lex Neva pointed out that 40:28 is equivalent to 10:7.
    • I’ve also corrected About Landmark, which displays at 40:28 (1.43:1), rather than 4:3 (1.33:1). Accordingly, I’ve changed my recommendation for parcel snapshots to 40:28 instead of 4:3, as it does not seem to be displayed anywhere at true 4:3.
  • 22Sep

    Vint Falken has a very good tip for SL photographers who want to hide poseballs and other obstacles from a composition without time-intensive photo-editing.

    But, she opines:

    Note: I’ve tried this on avatars and prim clothing and it does not work on those. Bummer. :p

    Well, glorious day and jubilations, because I’ve found a way that it will work! Just toggle on `Client > Character > Character Tests > Allow Select Avatar’, and you’re ready to go! You can now select avatars and their attachments — and so, in combination with the `Client > Rendering > Hide Selected’ option, you can hide them!

    Here’s an example: This annoying avatar was absolutely ruining my composition:

    Shot With Avatar

    So, I selected her and her prim hair, thus dramatically improving the quality of my snapshot!:

    Shot Sans Avatar

    Unfortunately, to hide the avatar and all attachments, you have to manually select each attachment (luckily not each individual prim!), which can get tedious!

    Fortunately, with the `Allow Select Avatar’ option turned on, you can just select the offending avatar and move it (along with all its attachments) somewhere else where it won’t be in your way! The movement is client-side only, so if the avatar moves (walks, turns, jumps… animation movement doesn’t count), the server will send an update to your client and the avatar will pop back into its old position. But, it should be enough to get your shot in!

   

Recent Comments

  • Alas, I didn't program in any way to import a BVH file onto ...
  • I`ve got the same problem. How is it possible to import ...
  • Sadly, the Mac trick didn't work and I've got to deal with s...
  • Thanks Jarek. I've updated the link in the article. :)...
  • yeah, it is http://www.secondlife.sk/EVA of course, not SECO...