Game Development Reference
In-Depth Information
TABLE 15.1
URL Giver script - LSL Script for Favorite Website HUD
0
// In Line 6 add in the name of your desired webpage and the URL for it
between the quotes. The script will make a menu appear on your screen
asking if you want to go to that webpage. This script is modified from the
public domain example script shown here:
http://lslwiki.net/lslwiki/wakka.php?wakka=llLoadURL&show_comments=0
1
2
3
4
5
6
default
{
touch_start(integer total_number)
{
llLoadURL(llDetectedKey(0), “Name of Webpage”, “http://the URL of your
desired webpage”);
}
}
7
8
9
the contents into a new script you have made inworld. Name it “URL Giver for HUD” and save it into your
inventory for installation in each of your HUD button prims.
Use the Edit Linked setting to select each button prim individually, and load a copy of the script into its
contents using the Content tab on the Build/Edit menu as shown in Figure 15.12. Make sure to change the
information in line 6 of each script to the name of the website site (such as “my home page”) and the URL
(such as http://www.myhomepage.com). Test each button to make sure it generates a blue “go to” card on your
viewer and then takes you to the website you wanted as shown in Figure 15.13. If not, go back and check the
scripts. (Did you miss a comma or semicolon?)
15.7.4 s eTTing The s Cale and p osiTion of y our n eW hud
First make a copy of your inished, scripted HUD and take that into your inventory as a backup. Now, scale
the whole object down, as a linked object, until the size is approximately x = 0.06, y = 0.09, z = 0.25 as shown
in Figure 15.14.
Name it “My favorite sites HUD_FINAL” or something like that and take it into your inventory. Now,
select it in your inventory and attach it to the bottom right position of your screen using the menu that
appears when you right click on it, just as you did in Section 15.1.1. It should appear in the corner, just as
Figure 15.15 shows.
If it is not quite right, select the object and go into edit mode, scroll back so you can zoom out on the
object, then scale the HUD down to the size you would like it to be or move it into a better position.
15.7.5 f inal T WeaKs and C ongraTulaTions
Once the HUD is in position, double-check to see if each button will respond to your mouse and bring in a
drop-down menu card from the Firestorm Viewer that will let you access the URLs you have chosen. If they
all do, you are good to go. Sign in and tweet or post something about your new HUD. Now that you have
scratched the surface on the topic of making HUDs, the virtual world is your oyster. Go ahead and create
 
Search WWH ::




Custom Search