Advanced Scripting in Second Life

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    2 Favorites

    Advanced Scripting in Second Life - Presentation Transcript

    1. Advanced Scripting in Second Life LIBR 287 - Jeremy Kemp, SJSU SLIS [email_address]
    2. HUD points to the Web Steps overview
      • Gather the web addresses and icons, resize
      • Create the “forward” icon and upload images
      • Upload the script
      • Test and size the object
      • Play dice!
    3. Gather web addresses
      • Visit the web pages and collect the URLs
        • www.ala.org
        • en.wikipedia.org/wiki/Librarian
        • google.com/search?hl=en&q=librarian
        • merriam-webster.com/dictionary/librarian
    4. Gather the Icons
      • Capture icons using a screen capture tool
        • Google
        • Wikipedia
        • ALA
        • Merriam-Webster
        • Tool: SnapZPro
          • ambrosiasw.com/utilities/snapzprox
      • Resize to 256/256 (power of 2)
        • Tool: Photoshop
          • adobe.com/products/photoshopCreate
      • Create the “forward” icon
    5. Upload images
      • Bulk upload and pay 50 L$
    6. Create a container with hotspots
    7. Texture them properly
    8. Scripting – What was touched?
      • ClickedPrim=llDetectedLinkNumber(number);
      • if (ClickedPrim==3)
        • { state rotation_three;
        • }
        • else if (ClickedPrim==9)
        • { pageURL="http://google.com/search?hl=en&q=librarian";}
        • An arrow launches state rotation_three which changes the prim’s rotation
        • Or – the hotspots launch set the URL
    9. Scripting – do that pull down
      • llLoadURL(llDetectedKey(0), "Click 'Go To Page' to visit.", pageURL );
      • llDetectedKey senses the avatar who touched it
      • You get a nice message on the pulldown
    10. Advanced Scripting 2 Building a simple HUD
    11. Steps overview
      • Find the Dice container
      • Empty it (mostly) and add a blank script
      • Add the script parts and test it on the ground
      • Attach to HUD top and resize & position
    12. Clean the dice
      • Remove everything but the “dice_drop” sound
      • Set “Stretch textures” before resizing
      • Set the object to nonphysical and .2 on a side
    13. Starting the script
      • Two variables that are predefined:
        • list rots = [< 0.00000, 1.00000, 0, 1>,<0.00000, 0, 0.70711, 0.70711 >, < -0.00000, 0.00000, -1.00000, 0.00000 >, < 0.00000, 0.00000, -0.70711, 0.70711 >,< 0.00000, 0.00000, 0.000, 0.70711 >,< 0.00000, -1, 0.000, 1 >];
        • list numbers = [&quot; 一 &quot;,&quot; 二 &quot;, &quot; 三 &quot;, &quot; 四 &quot;, &quot; 五 &quot;, &quot; 六 &quot;];
        • 6 quaternions describe rotation of dice to make each sides show. The list of Chinese numbers is for fun.
    14. Rotation and Eulers
    15. When the prim is born:
      • default{
      • state_entry()
        • {
        • llSetRot( (rotation) llList2String(rots,0));
        • }
        • “ Set the rotation of the prim to the first item in the list “0”. Notice the type assignment making the string into a rotation.
    16. Prim is touched = set random rot.
      • touch_start(integer total_number)
      • {
      • integer random = llFloor(llFrand(6.0)); llSetRot((rotation)llList2String(rots,random));
        • “ Take a random number 0 to 6 and round it down (floor)” “Set the rotation of the prim to a random item in the list”
    17. Prim is touched = have some fun
      • llOwnerSay(llList2String(numbers,random)); llPlaySound(&quot;dice_drop”, 1.0);
      • }
      • }
      • “ Use the same random number to pick a Chinese character and say it to owner.”
      • “ Play the sound at volume 1”
    18. Insert the Script
      • Make it in your inventory or in the prim
      • Rename it and add a version number
      • Copy/Paste the notecard text
    19. Attach to HUD
      • Right click> More / Attach HUD / Top

    + jeremykempjeremykemp, 2 years ago

    custom

    1497 views, 2 favs, 3 embeds more stats

    Shows the process to create a heads up display

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1497
      • 1494 on SlideShare
      • 3 from embeds
    • Comments 0
    • Favorites 2
    • Downloads 6
    Most viewed embeds
    • 1 views on http://www.slideshare.net
    • 1 views on http://virtual-worlds-education.blogspot.com
    • 1 views on http://static.slideshare.net

    more

    All embeds
    • 1 views on http://www.slideshare.net
    • 1 views on http://virtual-worlds-education.blogspot.com
    • 1 views on http://static.slideshare.net

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories