Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

hud / command line script??

Motoko Karu
Registered User
Join date: 28 May 2008
Posts: 11
06-23-2008 23:44
Hello Everyone,

Sorry in advanced for the newbie question.

First some background... I've got a flight-assist tool that I use with chat commands such
as "/1 flight on" "/1 flight off".

I'd like to develop a simple HUD with a button, so that when I push it, "/1 flight on" is passed to the command line.

Can this be done??

Or to start out in a simpler manner, how about having a simple prim, so that when I touch it, it passes /1 flight on to the command line?

I've attempted something to the effect of:

touch_start(integer total_number)
{
llSay(1, "flight on";);
}

but that doesn't appear to work. Any suggestions would be greatly appreciated.

Arrigato ^_^

--Motoko
Varun Blitz
Registered User
Join date: 22 May 2008
Posts: 62
06-23-2008 23:52
it shud work perfectly. i use it all the time, have made elaborate HUDs to command my objects.
just make sure that the objects are listening on the same channel on which HUD speaks.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
06-24-2008 00:04
most likely, your flight assist is set to listen only to the OWNER, not to the owner's objects. Each avatar and each object has it's own, unique "UUID" (or "Key";). Scripts can tell the UUID for everything they hear. And your objects aren't YOU.

If your flight assist is nomod, a quick way around this is to make a menu.

CODE
default
{
touch_start(integer numdetected)
{
llDialog(llGetOwner(), "Select option", ["flight on", "flight off"], 1);
}
}

Touching the HUD will then trigger a dialog, when you press one of these buttons, the Flight Assist should interpret the speech as coming from YOU.

If your flightassist IS moddable.. find this.
CODE
llListen(1, "", llGetOwner(), "");

and replace it with:
CODE
llListen(1, "", NULL_KEY, "");

THEN at the top of the "listen" event in the flight assist, add this line.
CODE
if (llGetOwnerKey(id) != llGetOwner()) return;

You can get the idea of what I'm suggesting, by looking at the following:

if (the owner of(the speaker) is not my owner) ignore it.

The one neat thing about avatars (or agents) is that they own themselves. So in my case.. both my key, and the owner of my key, is 145b5e86-fcb2-4351-877a-0dfe65e80518. Your key will be different of course.

If the llListen already says "NULL_KEY" (which is unlikely).. then find this:
CODE
if (id == llGetOwner());

and replace it with:
CODE
if (llGetOwnerKey(id) == llGetOwner())
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
06-24-2008 00:08
If depends on how the object you want to control is scripted. If the other object listens only to its owner, you won't be able to use another object's chat to control it. Some scripts will accept all listens on a given channel and look for objects with the same owner, but there's no standards out there so it's hit or miss.
_____________________
Motoko Karu
Registered User
Join date: 28 May 2008
Posts: 11
Thank you Sorry to be rude
07-07-2008 13:35
Hello Winter, Hello Varun,

I apologize for being rude/late in my replies. RL intruding on SL... ^_^

Anyways thank you for the various suggestions. I've attempted to apply them to my
situation, but it doesn't appear to work.

I suspect I'll have to consider playing around with one of the open source flight assist scripts.

Thank you again.

--Motoko
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
07-14-2008 13:15
i'm still quite puzzled how huds work, i'm not in world to try the dialog method. but how do i get one object to listen to another object only owned by the owner? ie, you have an attachment on your body, that listens for a message on a specific channel. you have something on your hud that says that message on the specified channel, but how to make it so it doesn't interfere when other people around have the same object, or use other objects on the same channel
Mereille Despres
Registered User
Join date: 5 Sep 2007
Posts: 79
07-15-2008 06:42
Ruth,

Look at Winter's post (#3) above.

Basically, in your listen event you say

-- if the owner of whatever is speaking is the same person as my owner then do stuff

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


llGetOwner() gets the listening object's owner
llGetOwnerKey(id) gets the speaking object's owner (the owner if 'id' which is what is talking).

Conveniently, avatars own themselves. So if the speaker is an avatar, this still works. You can happily have the option of clicking your hud button, or saying /1 flight on just like you do now.
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
07-15-2008 12:22
aah ok, now i understand, i've learned alot about scripts from the forums, i but know there is still alot more to learn as well. which is why i continue reading often, and i sometimes can answer questions. thanks for explaining that to me.