- Archive
- :
- Forum Archive
- :
- Second Life Forums
- :
- Scripting
- :
- Re: touch/buy prim conflicts with llLoadURL ?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Printer Friendly Page
touch/buy prim conflicts with llLoadURL ?
- Mark as New
- Bookmark
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-26-2010 12:14 AM
I am making some book sized/textured prims that have N/C's with information about the book, synopsis if available, review, publisher, author etc etc. I set the "book" to "buy" to give a copy without having to add a script for each, but now I found a library that has a table full of books and you can click and "buy" for L$0 and it gives you the book prim. Inside it only has a script to load the url to the web page as follows:
default
{
touch_start(integer total_number)
{
llLoadURL(llDetectedKey(0), "title", "http://www...URL HERE");
}
}
They have the book prim set to "touch/grab" and the script works to load the url, but to "buy"' you have to click and go thru the pie menu and select that.
I tried it by retaining the "touch/BUY" on the prim, with the above script inside, and the script does not work if that "touch/buy" is set on for the prim. If I turn that to touch/grab it loads the page in the viewer or if I have my viewer set to open the browser instead it does that.
The book prim I found is full perm, I just set a copy I got to touch/buy and tried it, and it doesn't work to both "sell" the prim the easy way, and launch the web page with the above script.
Not sure if this is something I'm doing wrong, or the script is always overidden/deactivated by that touch/buy setting on the prim?
I like having it set to touch/buy as that shows an obvious dollar symbol when moused over, clearly indicating people can click and take a copy, otherwise signs have to tell that I guess.
Im not even sure a giver script will work with the url launch script either, I'm guessing one overrides the other, haven't tried that but would not really like to have TWO scripts in each.
Re: touch/buy prim conflicts with llLoadURL ?
- Mark as New
- Bookmark
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Reply to Doggie Jigsaw - view message
12-26-2010 03:25 AM
You could put the llLoadURL in a changed owner event. Then if the new owner rezzes the prim the page gets launched.
default
{
changed( integer c)
{
if (c & CHANGED_OWNER) llLoadURL(llGetOwner(),"Text","http://");
}
}
Re: touch/buy prim conflicts with llLoadURL ?
- Mark as New
- Bookmark
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Reply to Doggie Jigsaw - view message
12-26-2010 04:32 AM
The buy setting for the left mouse click means that no touch event gets triggered.
If you work with a script instead the buy functionality that gives the book to the toucher, you can of course also open a URL - you can do about as much as you want inside the touch event once it gets triggered. The point is: You have to set the left click to Touch/grab.
Re: touch/buy prim conflicts with llLoadURL ?
- Mark as New
- Bookmark
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Reply to Doggie Jigsaw - view message
12-26-2010 05:47 AM
I assume the loadUrl script is only working AFTER you buy in the book you purchased? it could very well be that the saleable book is set to sell contents, and not copy.... and the contents is actually the book you recieve that is set to use the load urls...
alternatively you could do much the same thing by setting it to sell a copy, and having the script change the default click action on owner change.
Re: touch/buy prim conflicts with llLoadURL ?
- Mark as New
- Bookmark
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Reply to Doggie Jigsaw - view message
12-26-2010 07:55 AM
It sounds like the OP may have visited one of the venues at the Community Virtual Library, where we have a few hundred books like the one he describes. The "book" is a single textured prim and the actual contents are accessible on line, usually from the Gutenberg Project. We want to make the books available free -- there's obviously no cost to us -- but we also want to make them browseable, so that a library patron can scan through one and decide if she really wants a copy. (I know, this is silly in a way because there's no cost to the patron who decides to discard a free book. Still, people cling to RL habits of browsing.) Our books are always set to touch/grab and either sold for L$0 or set as Free to Copy. I know that means that a newbie patron who hasn't figured out how to take a copy or buy an object with the pie menu may be put off by that extra step, but we "sell" a rather large number of books in a typical month -- so it can't be that difficult.
Re: touch/buy prim conflicts with llLoadURL ?
- Mark as New
- Bookmark
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Reply to Doggie Jigsaw - view message
12-26-2010 09:12 AM
I went to the Caledon Library Rolig, it's not large but it does have a number of books on a table, very nice spot.
So according to what you mentioned in your response, you don't see the lack of setting the prim to touch/buy has been a hinderance to people... hmm, well maybe I'm just trying too hard to make things too easy when I probably don't really have to.
To answer the other questions, at the library the book prims work perfectly to do what they were set to do- give out a free copy of the "book" with the script inside to send you on your way to the web site to read the book.
I am setting up an area or more likely 2 areas in my 2 sims on another grid (inworldz) where I will have several "books" on a table relevant to the purposes so people can click, get a n/c with the info about the book (they would have to BUY these books because they are not in the public domain) synopses, general info, reviews and suggestion to buy used on Amazon. I thought it would be real nifty if it can also send them right to the page on Amazon for each book, thus I liked that script.
According to responses here, it looks like setting the "touch/buy" on the prim prevents the touch script from working, I guess in retrospect that makes sense.
Anyway thanks for everyone's input and ideas, I will try that other script and see if I feel it is better than just not setting the prim to touch/buy.
Re: touch/buy prim conflicts with llLoadURL ?
- Mark as New
- Bookmark
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Reply to Doggie Jigsaw - view message
12-26-2010 01:01 PM
So according to what you mentioned in your response, you don't see the lack of setting the prim to touch/buy has been a hinderance to people... hmm, well maybe I'm just trying too hard to make things too easy when I probably don't really have to.
I didn't mean to sound flippant. I'm all for making things as easy for the end user as possible, and it does worry me that some library patrons may be put off by even the simplest extra step. Thanks to your post, I'm about to try a different approach to handling our free books. There's no way to get around having this be a two-step process, but the little script below makes them two easy-to-understand left clicks. The first click opens a dialog box; the second one either delivers a free book or opens the web site where you can read its contents. All you need to do is drop the script in your book object along with a copy/transfer copy of the "book" that has a simple llLoadURL script in it.
integer gDchan;
integer gDlisn;
string gURL = ""; //Put the book's URL here between the quotes
default
{
touch_start(integer total_number)
{
gDchan = (-1)* (integer)("0xF" + llGetSubString(llDetectedKey(0),0,6));
llListenRemove(gDlisn);
gDlisn = llListen (gDchan,"","","");
llDialog(llDetectedKey(0),"Do you want to take a copy of this book or read it on line now?",,gDchan);
llSetTimerEvent(10.0);
}
timer()
{
llListenRemove(gDlisn);
llSetTimerEvent(0.0);
}
listen(integer channel, string name,key id, string msg){
if(msg == "Take a Copy")
{
llGiveInventory(id,llGetInventoryName(INVENTORY_OB
JECT,0)); }
else if (msg == "Read it")
{
llLoadURL(id,"Read " + llGetObjectName() + " on line ....",gURL);
}
}
}
Clearly, you could offer different options than these in the dialog box if you wanted to.
Re: touch/buy prim conflicts with llLoadURL ?
- Mark as New
- Bookmark
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Reply to Doggie Jigsaw - view message
12-26-2010 04:50 PM
I didn't mean to sound flippant. I'm all for making things as easy for the end user as possible, and it does worry me that some library patrons may be put off by even the simplest extra step. Thanks to your post, I'm about to try a different approach to handling our free books. There's no way to get around having this be a two-step process,
Not at all, thanks a lot Rolig, that script works very well, I think I will just change the dialogue text for the buttons and that would work just fine!
Looks like a win-win all around with this!
Re: touch/buy prim conflicts with llLoadURL ?
- Mark as New
- Bookmark
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Reply to Doggie Jigsaw - view message
12-26-2010 05:29 PM
I changed a couple of dialogue things in this for my purposes on the other grid, it works perfectly there too.
So to use this it goes in a prim, in my case a book, inside that prim you can put the object or NC to hand out, in my case I decided to put a copy of the book prim with the NC inside it just because it looks cool having a miniature book rezzed out.
With the prim set to normal touch/grab the script offers 2 choices:
Get a copy of the contents
Find the book online (at the URL it can be set to send you to)
// script by Rolig Loon modified a tad by Doggie Jigsaw
// Put the object or NC inside the prim, changing INVENTORY_OBJECT as needed. Changes of the button names requires changing the msg == line // to the same names.
integer gDchan;
integer gDlisn;
string gURL = "http://www.amazon.com"; //Put the book's URL here between the quotes
default
{
touch_start(integer total_number)
{
gDchan = (-1)* (integer)("0xF" + llGetSubString(llDetectedKey(0),0,6));
llListenRemove(gDlisn);
gDlisn = llListen (gDchan,"","","");
llDialog(llDetectedKey(0),"\nDo you want to take a copy of this for the NC and info inside?\n Or see copies for sale on line now?",,gDchan);
llSetTimerEvent(10.0);
}
timer()
{
llListenRemove(gDlisn);
llSetTimerEvent(0.0);
}
listen(integer channel, string name,key id, string msg)
{
if(msg == "Take a Copy for NC")
{
llGiveInventory(id,llGetInventoryName(INVENTORY_OB
}
else if (msg == "Find it online")
{
llLoadURL(id,"Find it " + llGetObjectName() + " online ....",gURL);
}
}
}

