Jump to content

Tour Hud?


Nika Talaj
 Share

Recommended Posts

I'm looking to do a custom tour Hud for a friend, and I seem to remember seeing library scripts for that, or maybe ancient freebies ... but anyway, i can't find anything in my inventory.  I think I've searched the library subforum here as well, though I use these forums so seldom I'm not quite sure I did that successfully.  Anyway, does anyone know where I can get something I can hack into shape?

 

Thanks in advance!

Link to comment
Share on other sites

I made a couple of tour HUDs two years ago, but I won't be able to go in world and dig through my old inventory to find them until tonight.  As I recall, one of them did little more than recite a little tourist blurb off a notecard and put a SLURL in chat to aim the user at the next tour location.  I can't recall how the other one worked, but it was equally simple.  I'll send them along if I can find them, but my guess is that you could write them from scratch almost as easily.

Link to comment
Share on other sites

Thanks, Rolig!  I'd appreciate looking at them, since this, too, needs to be really simple to use.  The hugely functional ones, that take up a lot of screen space and almost require training to use, I think would be inappropriate here - it's a small set of sims.

Link to comment
Share on other sites

I discovered that I do have one of the two scripts on this old laptop, so I'll copy it here.  It compiles, but I can't get in world at the moment to test it, so I can't guarantee that it does what i is supposed to.  Even if it doesn't, though, it's a simple script to tweak and there's enough here to give you a nucleus to build on.  It expects a notecard with pairs of data lines.  The first line in each pair starts with "1#" and looks like

1#a SLURL goes here|a short name goes here

(notice the "|" between the SLURL and the short name) and the second line in the pair starts with "2#" and looks like

2#A somewhat long and flowery tourist blurb goes here

Touch the one-button HUD and it creates a dialog with numbered buttons that are keyed to the list that displays in the dialog text.  I expected a short tour evidently, so didn't provide for more than one page of dialog text and buttons.

Anyway, here's the script.  It's not very inspired, but it may be useful.

list gDirectSLURL;list gSpot;list gBtnList;list gBlurb;string gName;key gQueryID;integer gLine;integer gChan;integer gLisn;integer gCount;default{    state_entry()    {        gName = llGetInventoryName(INVENTORY_NOTECARD, 0);        gQueryID = llGetNotecardLine(gName, (gLine = 0));    }    on_rez(integer start)    {        llResetScript();    }    changed (integer change)    {        if ( change & CHANGED_INVENTORY)        {            llResetScript();        }    }    dataserver(key query_id, string data)    {        if (query_id == gQueryID)        {            if (data != EOF)            {                if(llGetSubString(data,0,1) == "1#")                {                    list temp = llParseString2List(data,["|","#"],[]);                    gDirectSLURL += [llList2String(temp,1)];                    gSpot += [" \n"+(string)(++gCount) + ". " +llList2String(temp,2)];                    gBtnList += [(string)gCount];                }                else if (llGetSubString(data,0,1) == "2#")                {                    gBlurb += [llGetSubString(data,2,-1)];                }                gQueryID = llGetNotecardLine(gName,(++gLine));            }            else if (data == EOF)            {                state running;            }        }    }}state running{    state_entry()    {        gChan = (integer) ("0xF" + llGetSubString(llGetOwner(),0,6));    }    on_rez(integer start)    {        llResetScript();    }    changed(integer change)    {        if(change & CHANGED_INVENTORY)        {            llResetScript();        }    }            touch_start(integer number)    {        llSetTimerEvent(15.0);        gLisn = llListen(gChan,"","","");        llDialog(llGetOwner(),"Where shall we go?"+(string)gSpot,gBtnList,gChan);    }    listen(integer channel, string name, key id, string msg)    {        llListenRemove(gLisn);        if(~(channel = llListFindList(gBtnList,[msg])))        {            llOwnerSay(llList2String(gBlurb,channel));            llOwnerSay("Click this link for an instant TP to: " + llList2String(gDirectSLURL,channel));        }    }    timer()    {        llListenRemove(gLisn);        llSetTimerEvent(0.0);    }}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...