Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

*Help* Creating Pop Up Text box

Prano Quan
Registered User
Join date: 15 Aug 2008
Posts: 29
06-01-2009 16:45
Hello all,

I need help with creating a pop up text box.

The aim is to attach this to the prim by simple script. When user clicks prim, the prim will let out a text box (like the ones you see when you enter an owned land). How do I do this?

The whole purpose of the prim is to describe the blackbox/prim I'm going to create. I don't want to use llSay/whisper because I'm going to describe the object (lots of words). So I figured, a pop-up text box will allow users to read-through "What's this?" object with more privacy and less spamming in chatbox.

Thank you.
Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
06-01-2009 17:03
This simple script will pop up a dialog, but it only allows 512 bytes of text:
default
{
touch_start(integer total_number)
{
llDialog(llDetectedKey(0), "This message can only be 512 bytes long", [], 1 );
}
}
If you can chop your message up into pieces that small, you could have NEXT and PREVIOUS page buttons that pop up the next and last page, with any number of pages.
Kayaker Magic
low carbonated footprint
Join date: 11 Sep 2008
Posts: 109
06-01-2009 17:33
I could not resist trying out my own suggestion: Here is a multi-page dialog message script that is pretty simple:
CODE

integer page;
list mess = [
"This message must be 512 bytes or less",
"this is page 2 of the message",
"this is page 3 of the message",
"this is the last page of my message"
];
list next;
default
{
touch_start(integer total_number)
{
page=0;
if (llGetListLength(mess)>1)
next = ["next"];
llListen(1,"",llDetectedKey(0),"");
llDialog(llDetectedKey(0), llList2String(mess,page),next, 1 );
}
listen(integer chan, string name, key id, string mes)
{
if (mes=="next")
{
page += 1;
if (page >= llGetListLength(mess)-1)
next=[];
llDialog(id, llList2String(mess,page),next, 1 );
}
}
}

Of course this will get confused for several reasons if several avatars click on it at the same time...
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
06-02-2009 01:42
if you use llGiveInventory and a notecard, the default is to show the notecard when it's received, which will allow you any amount of pre-written text you want...
_____________________
|
| . "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...
| -