Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

HUD that "talks" from a notecard

Alesia Schumann
Registered User
Join date: 13 May 2007
Posts: 88
12-01-2007 08:04
Hi everyone,

Is it hard to make a basic HUD with buttons that would refer to a notecard to say something in the chat area?

I think this would be useful for various situations. I'd click on a basic button in a blue box and it would end up being me (or the object name) that says something in green in chat.
_____________________
Exhibit A Photography, for profile pictures:
http://slurl.com/secondlife/Oakworm/24/248/21

My items on Xstreet SL:
http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=77918
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-01-2007 10:11
From: Alesia Schumann
Hi everyone,

Is it hard to make a basic HUD with buttons that would refer to a notecard to say something in the chat area?

I think this would be useful for various situations. I'd click on a basic button in a blue box and it would end up being me (or the object name) that says something in green in chat.

All a HUD is, is a prim or linkset that is attached to a HUD point. So get your scripts and linkset working correctly in world 1st and then size the parts, texture or color and attach. For reading a notecard, look here:

http://www.cheesefactory.us/lslwm/llGetNotecardLine.htm
_____________________
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
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
12-01-2007 10:12
From: Alesia Schumann
Hi everyone,

Is it hard to make a basic HUD with buttons that would refer to a notecard to say something in the chat area?

I think this would be useful for various situations. I'd click on a basic button in a blue box and it would end up being me (or the object name) that says something in green in chat.


This doesn't sound to difficult to do. Might be handy for answering the same Newbie questions over and over again.

You could easily make a hud with a llSay() script in each button that would speak when you touch the button.

Or one button that pops up a menu with numbered buttons and a different phrase tied to each menu button.

Edit: Reading from a notecard seems more difficult to do. I once saw a tutorial on it that made my head spin. That Wiki page seems much simplier, I will give it a try.
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo
White Hyacinth
Registered User
Join date: 15 Nov 2006
Posts: 353
12-01-2007 10:35
I made one.
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-01-2007 10:50
note card readers can be easy or complex, the simplest case is dropping each value into a list

the complex ones can dynamicly switch variable container targets, determine types and treat different sections with different logic, call multiple notecards, sort information by line and card, etc ad nauseam

for hud purposes at the simplest you could feed you notecard list to lldialog, and it would spit out chat from you that equals what the phrase was.

3 caveats
button text must be under 25 characters long per button
you'll only see about 7-12 of those characters on the dialog button (but they'll all be there)
only 12 buttons per dialog


you can get around caveat 1 by storing 2 values (the button text and the text you'll want to go into chat), or by capping that text... but then you must also listen for the dialog button text, and use some form of llSay

there's no getting around caveat 2 except as above by makng shorter names and listening for them

to get around the 12 button problem I wrote an extension to add pages to dialogs allowing up to 100 pages, there's a sample in there that could work for you with very littl tweaking (just add the notcard reader and strip the inventory reader)
_____________________
|
| . "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...
| -
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-01-2007 11:04
Here is a barebones basic HUD that shows how to pass touches using just one script instead of a script in each button:

CODE

//Create a rectangular prim x = .01, y = .1, z = .25
// Create a cyclinder and rotate it on the y axis 90 degrees
// Now it is facing parrallel to the ground
//Size x = .05, y = .05 z = .015
//Make 2 copies so that you have 3 total and place these on the
//rectangular prim.
//Attach to the Center Hud point and place this script inside
//The rectangle will change it's color depending on whic button
//is touched.
//The HUD will also state the link # of the button that is touched

integer prim_num;
string prim_name;
vector color;

say(){
llOwnerSay( "Prim name: " + prim_name +
", link #" + (string)prim_num + " touched." );
}
params(){
llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, color, 0.6]);
say();
}

default {
touch_start( integer n ) {
prim_num = llDetectedLinkNumber(0);
prim_name= llGetLinkName(prim_num);
if(prim_num == 1){
color = <1, 1, 1>;
params();
llOwnerSay("I am the Root Prim");
}
if(prim_num == 2){
color = <0, 0, 1>;
params();
}
if(prim_num == 3){
color = <0, 1, 0>;
params();
}
if(prim_num == 4){
color = <1, 0, 0>;
params();
}
}
}
_____________________
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
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-01-2007 11:11
From: White Hyacinth
I made one.

Sorry White, I know that you are new to the forum here. We only help people with thier scripting problems and don't offer scripts that someone has to buy. We also don't offer scripting for hire here.. Even if someone asks to buy a script here, we direct them to the Products Wanted section instead.
_____________________
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
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-01-2007 11:16
From: White Hyacinth
I made one.


Hi White,
I know you are new to the Scripting Forum. Are you refering here to the fact that you have made a hud before and so she should be able to also? Or are you stating that you have a hud that does what she wants and she should visit your store?

Apologies if I misread the intent, just wanted to clarify that we do not offer scripting for hire or scripts for sale here. We only help others learn to script themselves. Even if someone asks to buy a script here, we will direct them to the Products Wanted forums instead.

Again aplogies, if I misread it:)
_____________________
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
Core Taurog
Registered User
Join date: 2 May 2007
Posts: 17
12-01-2007 11:27
don't forget that whatever your HUD says will be said as the HUD and not you; anything listening will need to do a check similar to

CODE

if (id == llGetOwner() || llGetOwnerKey(id) == llGetOwner())
{
// do stuff
}
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
12-01-2007 13:45
From: Core Taurog
don't forget that whatever your HUD says will be said as the HUD and not you; anything listening will need to do a check similar to

CODE

if (id == llGetOwner() || llGetOwnerKey(id) == llGetOwner())
{
// do stuff
}


Actually, the first check is redundant, since all avatars own themselves. :)
White Hyacinth
Registered User
Join date: 15 Nov 2006
Posts: 353
12-01-2007 17:27
From: Jesse Barnett
Hi White,
I know you are new to the Scripting Forum. Are you refering here to the fact that you have made a hud before and so she should be able to also? Or are you stating that you have a hud that does what she wants and she should visit your store?

Apologies if I misread the intent, just wanted to clarify that we do not offer scripting for hire or scripts for sale here. We only help others learn to script themselves. Even if someone asks to buy a script here, we will direct them to the Products Wanted forums instead.

Again aplogies, if I misread it:)

I was very short in my message, sorry :)

What I was trying to say is that I have built a HUD like that and I am working with it. It is not a product, it is not for sale. I am experimenting with this HUD and trying to find out how to make it user friendly and what features it should have. So the discussion in this topic is very interesting to me.

My HUD is designed to "tell a story". The basics are not too difficult. What you have to do is send requests to the data server for each line of the notecard. So you keep a global counter that holds the next line to be requested (start counting at 0). In the touch_start() event handler you request the line with llGetNotecardLine(NotecardName, LineNumber) and after that you increment the counter. In the dataserver() event handler you llSay() the data recieved.

So each time you click your HUD, the next line of your text will be spoken.

Once you have this basic thing working, the possibilities are endless and will largely depend on the way you want to use your system. That is the area I am experimenting with right now.

I don't have that basic script available to copy/paste in here, but it can be done in less than 20 lines.

One tip: Give the HUD the same name as your avatar. The text spoken will be displayed in a different color than text you simply type in, but most people will not even notice that.
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-01-2007 18:56
From: White Hyacinth
I was very short in my message, sorry :)

What I was trying to say is that I have built a HUD like that and I am working with it. It is not a product, it is not for sale. I am experimenting with this HUD and trying to find out how to make it user friendly and what features it should have. So the discussion in this topic is very interesting to me.

Great then and welcome to the forums. Sorry about that, but that was why I was apologizing if I was wrong. A couple of people have tried selling thier products here in the last months or so.

It is always wonderful to see new people here scripting and learning scripting. Hope you will be around much more now:)
_____________________
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
White Hyacinth
Registered User
Join date: 15 Nov 2006
Posts: 353
12-03-2007 05:25
Hmm, the discussion in this topic seems to have stopped :(

So far, we have seen two basic ideas of "HUDs that talk from a notecard":
1. A system that presents the user with a menu of 1-line texts to choose from.
2. A system to tell a story line-by-line.

Is one of these options exactly what the OP wanted?
Or are there different expectations/possibilities we have not mentioned yet?

I have also seen a HUD (Mystitool) that can make us believe text was not spoken by a HUD, but by an avatar himself (normal avatar name and normal text color). Does anyone know how to make THAT happen?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-03-2007 12:06
From: White Hyacinth
I have also seen a HUD (Mystitool) that can make us believe text was not spoken by a HUD, but by an avatar himself (normal avatar name and normal text color). Does anyone know how to make THAT happen?

llDialog, works for phrases under 25 characters, as I noted above.
_____________________
|
| . "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...
| -
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
12-04-2007 12:43
From: Alesia Schumann
Hi everyone,

Is it hard to make a basic HUD with buttons that would refer to a notecard to say something in the chat area?

I think this would be useful for various situations. I'd click on a basic button in a blue box and it would end up being me (or the object name) that says something in green in chat.


I sell just such a device... look up ClockWerks in classifieds, visit the CW Gadgets store across the street. It's called 'Greeter HUD'. You can program it to speak a message to the avatar (even using the avatar's name in the greet)... example, when you construct the notecard, you refer to the avatar as <name>:

eg:
Hello <name>! Welcome to our sim.... (etc)

it also can hand out a welcome notecard, and it can hand out a gift as well. Simply wear the hud, edit the greeting notecard, drop in a handout notecard (if desired), and drop in a gift package (if desired), and then simply push the greet, notecard, or landmark icon on the hud. A menu drops down with the nearest avatars, and you simply choose the name from them menu and the action is completed.

My store is located in Sabock (the hud is across the street from the clockstore). Either look it up in classifieds, or look in my profile's classifed or picks tab for a teleport to the store.
White Hyacinth
Registered User
Join date: 15 Nov 2006
Posts: 353
12-05-2007 08:44
From: Void Singer
llDialog, works for phrases under 25 characters, as I noted above.

I know how to create a dialog.
My question was: How do I make text spoken by a HUD appear in normal avatar spoken text color?
White Hyacinth
Registered User
Join date: 15 Nov 2006
Posts: 353
12-05-2007 08:46
From: Johan Laurasia
I sell just such a device...

/me reads with interest about Johan's product, then hands Jesse the bullwhip...
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-05-2007 09:48
From: White Hyacinth
I know how to create a dialog.
My question was: How do I make text spoken by a HUD appear in normal avatar spoken text color?

llDialog( vKeyTarget, "press a button to say it in chat", ["yes", "no", "hey, this works!"], 0 );

if the av presses "yes" on the dialog, THE AV will say "yes" in public chat(channel zero), etc. which will obviously be in the normal color for Av's (white, not green).

someone knows a way to make objects talk in the default av color (without having to edit preferences for each person that sees it) I'd love to hear it, otherwise, the above is as close as you can get
_____________________
|
| . "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...
| -
White Hyacinth
Registered User
Join date: 15 Nov 2006
Posts: 353
12-07-2007 16:31
From: Void Singer
llDialog( vKeyTarget, "press a button to say it in chat", ["yes", "no", "hey, this works!"], 0 );

if the av presses "yes" on the dialog, THE AV will say "yes" in public chat(channel zero), etc. which will obviously be in the normal color for Av's (white, not green).

someone knows a way to make objects talk in the default av color (without having to edit preferences for each person that sees it) I'd love to hear it, otherwise, the above is as close as you can get

Wow!
I tried this and I was impressed.

It is a pity the length of strings in llDialog() is limited, otherwise this would be enough solution for my situation. I want to click a button to say something anyway. It looks a bit like an exploit of something that should not be possible to me, but if llDialog can do this, maybe other functions can do it too...
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-07-2007 17:54
From: White Hyacinth
Wow!
I tried this and I was impressed.

It is a pity the length of strings in llDialog() is limited, otherwise this would be enough solution for my situation. I want to click a button to say something anyway. It looks a bit like an exploit of something that should not be possible to me, but if llDialog can do this, maybe other functions can do it too...

actually it was designed that way so that the dialog would keep the target av's keey for the response, allowing the function to be independant of a query id.

it does have limitations, the av must click an option to trigger it, it's limited to say range, and the center of the chat range is actually centered on the object not the av.

thankfully it's only current function that operates this way, and was probably only shortcutted this way because it does require the av to interact with it to make it work
_____________________
|
| . "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...
| -
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
12-07-2007 19:03
What difference does it make if the text is white or green anyways?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
12-08-2007 09:21
From: Johan Laurasia
What difference does it make if the text is white or green anyways?

makes a difference to the person wanting it, that's all that matters =)

on a more serious note, white is Av chat color, green is object, which do you tend to pay more attention to in a general sense? and will students view it as an instructor teaching or some random person with a box (even if the box was made and set up by the instructor)... it's about conotation of the information, which can be a big communication issue
_____________________
|
| . "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...
| -