Change font size
It is currently Sat Dec 15, 2018 1:09 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 2 posts ]
Author Message
 Post subject: Formating for llSetText in Floating Text Scripts
PostPosted: Sun Jul 17, 2011 6:30 pm 
Site Admin

Joined: Sun Nov 28, 2010 5:09 pm
Posts: 412
I've not seen this mentioned any where so thought I bring this up. I've noticed in Wright Plaza where there are lots of free things for others, that it is not always consistant how llSetText is used. It can be very helpful for the shopper to see what the item is. However a lot of times, too much text is placed on one line, and it tends to get covered up by text extending out from the next item. So I though it might be helpful to mention that you can break the text description into more than one line. By using \n within the text in quotations itself. As in these examples.

{L_CODE}:
default
{
    state_entry()
    {
        llAllowInventoryDrop(TRUE);
        llSetText("The Best Texture Collection You Will Find - Click to Buy for $0" , <1.0,1.0,1.0>, 1.0);
             
    }
}


The above would show one line of text above the item. But by adding \n you can break it into two lines or more thus:

{L_CODE}:
default
{
    state_entry()
    {
        llAllowInventoryDrop(TRUE);
        llSetText("The Best Texture Collection You Will Find " +  "\n Click to Buy for $0" , <1.0,1.0,1.0>, 1.0);
             
    }
}


Now another problem I often see is there is a mixture of having to right click and take a copy, and/or you can buy the item for $0. By default it appears that when you create a prim it is always going to enter at least $10 in the buy area. so remember to always change that to 0, or no one will be able to get it on OSGRID except you the owner. Also make sure that only a copy of the item can be bought not the original. Also if you want someone to take a copy, remember to check that also, having the next owner as full permission will not allow anyone by itself to take a copy.

And to be honest it was only recently that someone finally explained to me how you can set up an item to be bought. For those like me that did not know this, on the first page of the edit window under the General Tab for the item in the bottom left corner is a little drop down selection. By default it should be on "Touch/Grab Default". But if you then change the selection to "Buy Object" then when anyone Left Clicks on the object they will get the display of everything that is in the item hopefully for OS$0, with the option to buy, and when clicked BUY it will be copied to the Avatars Inventory. The cursor will also display a $ when you pass over the object. Remember now that if you have not changed the default $10 to $0 it will not transfer as transactions are not implemented in most regions on OSGRID.

While I am talking about it if you have any sit animations or similar scripts that require sits, you can also use the same drop down to add a Left Click to those objects, which is a lot cleaner than having to use the Right Click Pie Menu. Then when your mouse goes over the object you will see the little Sit Chair icon display.


Top
 Profile  
 
 Post subject: Re: Formating for llSetText in Floating Text Scripts
PostPosted: Tue Jul 19, 2011 9:32 pm 
OSG Elite
User avatar

Joined: Sat Jun 14, 2008 12:28 am
Posts: 384
Location: Australia
To take llSetText to the next level, variables and methods can be used within the SetText () to spice up your floating text. Remember whats inside "" will be printed exactly, and whats outside "" will be processed as code (except \n which is used as part of the text) ie. touched is used as a variable integer so it is put outside of the "", and the value of touched is used (not the word), and joined with + like
("this has been touched" + touched + "times")
for example this short script gets the avatars name and the name of the current region and counts the number of people who have touched the prim and formats it all nicely using new line commands \n
resulting in a floating text that looks like this
Hello Cam Chevalier
You're currently in
Region Pelican
this has been touched 5 times

{L_CODE}:
integer touched = 1;
default
{
     touch_start(integer total_number)
    {   
        integer i;
        for (i = 0; i < total_number; i++)// we use a FOR loop here because two people can click the object at the same time.
        llSetText("Hello " + llDetectedName(i) + "\n You're currently in \nRegion " + llGetRegionName() + "\n this has been touched " + touched + " times", <0,1,0>, 1);
     touched ++;   
    }
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 2 posts ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net