Using Landmarks w/ Scripts?
|
Kado Orr
Registered User
Join date: 26 Jul 2006
Posts: 4
|
08-21-2009 22:59
Trying to come up with a good "first-time" Script project. I decided I'd take a crack at making a simple HUD that will act as a list of bookmarks for Landmarks.
So I've been picking through LSL Wiki trying to get a grasp on the overall concept of "using" an item from your inventory. My overall understanding of scripting is minimal at best, so I'm not sure where I should focus my search to gather information on this, and get started.
Is this maybe something that's going to be too difficult for a new scripter to grasp?
Any help or direction would be greatly appreciated.
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
08-21-2009 23:26
Well, first, you can't "use" anything in your main avatar inventory via script. Only things in the Object/HUD' inventory can a script even see, let alone use. Next, each type of inventory item is "used" differently (or not at all) via script. Textures can be loaded onto prim faces by a number of functions. Objects can be rezzed. Animations can be "started" and "stopped". Body parts/clothing can't be "used" by a script at all, really. When you are talking about Landmarks, all you can do is use llRequestInventoryData to get the coordinates inside the landmark. You can't really "use" it in any other way. Once you have the data, you can use it with llMapDestination() to pop up the map (there is an example doing just that with a landmark in the wiki). Also, scripts cannot create Landmarks; only the user/agent can do that with the viewer. Now, if you just want to record coordinates, rather than use Landmarks, you will need to look at llGetRegionName(), llGetRegionCorner(), and llGetPos(). Likely, you will have to maintain the data in some sort of list, so you will need to look at the various List functions. That should get you started. 
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
08-22-2009 12:56
you may end up banging your head over llMapDestination (because it has some sever limiting conditions) and llRequestInventoryData (if you use actual landmarks in the hud's inventory, because it returns positions relative to the sim it's in when it's called)
but if you get past that, and don't have any trouble with basic structure (global variables, events) then it will give you a fair amount of experience dealing with lsl and it's quirks.
laying out a basic structure of how it will operate in plain english helps, because there a many ways to approach the same idea, so I'm loathe to give any examples without knowing what you had in mind for how it will look/operate.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
Kado Orr
Registered User
Join date: 26 Jul 2006
Posts: 4
|
08-22-2009 13:13
I'm looking to make something very basic at this point. Infact, after a bit of research I've tried experimenting with SLurl and the OwnerSay command to provide a link. But, I'd like to limit my clicks as much as possible.
Ideally, what I'd like my HUD experience to be (in the most basic of steps. This would be multiplied for each button.)
There is one button. This button is programmed to take me to a certain place upon clicking. Then that button is hit, I'm given the general Second Life landmark preview(?) prompt. (Screenshot of Sim, Coords, Descrption, TP/Cancel, etc.) That's it.
The closest I've been able to get to this is using llOwnerSay to make it whisper me SLurls to travel with. This works, but I'd like to skip the actually link-click part, as it feels sloppy.
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
08-22-2009 14:07
While I wouldn't recommend using this in a product, the URI scheme for instant one-click teleports is kinda fun:
secondlife:///app/teleport/(sim name)/(sim x)/(sim y)/(sim z)
Unfortunately, it doesn't always work. Some users have a hosed secondlife:// method entry in their OS.
|
Kado Orr
Registered User
Join date: 26 Jul 2006
Posts: 4
|
08-22-2009 17:46
I don't intend to use this any place besides my own machine. I don't expect it will ever be sold or shared unless somebody just wants it just to have it.
How would that sort of SLurl be implimented into a script? Don't need a fleshed out script. Just some direction on using these in script.
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
08-22-2009 19:27
It works just like a regular SLURL; just print it out in chat and then click the link.
Unlike a SLURL, it will teleport you without opening the map or prompting you. Basically, you click and WHOOSH!
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-22-2009 20:33
The problem is going to be getting the name of the region that the LM references. As pointed out, it returns the vector in global coordinates and no simulator name. You can use this in several functions, including llMapDestination, if you supply the name of the simulator you are in via: llGetRegionCorner(). But to direct teleport via Talarus's suggestion, you have to have the name of the region the LM is pointing to and there are no functions that return a region name except for the region you are in. But to bring up the destination using LM's you just use the wiki example and bypass the chat: http://lslwiki.net/lslwiki/wakka.php?wakka=llMapDestinationIf you want to build your own list without using LM's then I have that script in my user page: https://wiki.secondlife.com/wiki/User:Jesse_Barnett/Slurl_TP_HUD
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
08-22-2009 21:37
Yeah, I wasn't suggesting it for LM use, but instead of SLURLs, where it would be recorded by the HUD from current position.
If you enforce some kind of naming scheme for landmarks placed into it by users, then you can have them put the sim name in the name of the landmark, though. Adds more manual hassle for your users, but they have to already drag/drop their LMs on your HUD anyway.
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-23-2009 18:34
OP,
You can have the hud ask for the name of what you want to call the LM and then store the name, llGetRegionName(), llGetPos() in a strided list. I actually take mine a step further and assign the LM's to categories. When the name is picked use the region, pos, pos in llMapDestination. This will call up the Map where you can see the spot and teleport or ignore. Unfortunately I have not been able to find a way to call the Place Information window with anything but using a slurl and clicking on it in chat.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|