Jump to content

Creating a HUD for existing no-modify item


jaynoe90
 Share

You are about to reply to a thread that has been inactive for 501 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi, fairly new to scripting in LSL but here is what I want to do:

- Create a HUD with multiple buttons that (in theory) says commands

- The item I'm trying to use it on is https://marketplace.secondlife.com/p/FREE-Sorcerers-Wand-Spellcasting-System/128334

- The item uses chat commands that you need to type (i.e. "/1 draw" or "/1 lumos")

- I want to create buttons that effectively do this but I'm having no luck using the different say functions I've seen. I've seen forums recommending llRegionSay but I can't seem to get it to work.

I can assume the wand has a listener in the scripts but they're no-modify (understandably) so I can't get into them to see if they are indeed listening on a specific channel. Is there a universal "catch-all" channel that I could use to refer to ALL attachments I'm currently wearing? (The wand is the only attachment that would use these commands anyway).

 

Is this even possible, and how would you go about doing this?

Link to comment
Share on other sites

This depends entirely on how the script, there's no "universal override" channel. Most scripts designed to listen to their owner on a specific channel do ONLY that for efficiency and simplicity -- they do not listen on the public channel 0, or to other speakers/objects on their chosen channel. Doesn't sound like you're trying to put your scripts directly into the receiving object, but just for completeness' sake, an object cannot hear itself speak in any case.

If the commands do not work when sent by objects owned by you and can't edit the scripts then you're out of luck, there is nothing to be done other than get a custom/full perm version of the scripts, or make your own equivalents from scratch.

Link to comment
Share on other sites

56 minutes ago, jaynoe90 said:

Is there a universal "catch-all" channel that I could use to refer to ALL attachments I'm currently wearing?

Not in the way you want. Each scripted attachment has its own listen filter and criteria - which includes whatever arbitrary channel(s) it was originally written to listen on. They will only listen on those channels and not any additional ones.

Edit: As an aside, if you send a message directly to an avatar with llRegionSayTo and use a non-zero channel, then all of that avatar's attachments can hear that message if they are listening on that channel.

However, we can infer a few things from what you've shown us:

  • the chat commands are prefixed with "/1" which is a macro to make your avatar speak on a specific channel. That means the wand is most likely listening on channel 1.
  • We can also assume that the wand is probably scripted to only listen to chat commands from its owner (i.e. you).

Given the above, all of the existing LSL functions that produce normal speech (llSay, llWhisper, llShout, llRegionSay, llRegionSayTo, etc) will not be of use to you because the source of the speech will be coming from the scripted object instead of you.

But not all is lost, there is one function that I think can accomplish what you want: llDiloag. This function creates a pop-up window which contains buttons you can define. And when you press one of those buttons, the function will speak the button text on the defined channel. The trick here is that the source of the speech will come from your avatar (which is to let the same script "hear" the text, as normally a script cannot hear any chat it generates itself). So I think you could use that to trick the wand into thinking you have said the command.

Here's a brief example you can try, using the two sample commands you listed:

llDialog( llGetOwner(), "wand commands shortcut", ["draw","lumos"], 1 );

 

Edited by Fenix Eldritch
typos, additional thought
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

15 minutes ago, Fenix Eldritch said:

Not in the way you want. Each scripted attachment has its own listen filter and criteria - which includes whatever arbitrary channel(s) it was originally written to listen on. They will only listen on those channels and not any additional ones.

Edit: As an aside, if you send a message directly to an avatar with llRegionSayTo and use a non-zero channel, then all of that avatar's attachments can hear that message if they are listening on that channel.

However, we can infer a few things from what you've shown us:

  • the chat commands are prefixed with "/1" which is a macro to make your avatar speak on a specific channel. That means the wand is most likely listening on channel 1.
  • We can also assume that the wand is probably scripted to only to chat commands from its owner (i.e. you).

Given the above, all of the existing LSL functions that produce normal speech (llSay, llWhisper, llShout, llRegionSay, llRegionSayTo, etc) will not be of use to you because the source of the speech will be coming from the scripted object instead of you.

But not all is lost, there is one function that I think can accomplish what you want: llDiloag. This function creates a pop-up window which contains buttons you can define. And when you press one of those buttons, the function will speak the button text on the defined channel. The trick here is that the source of the speech will come from your avatar (which is to let the same script "hear" the text, as normally a script cannot hear any chat it generates itself). So I think you could use that to trick the wand into thinking you have said the command.

Here's a brief example you can try, using the two sample commands you listed:

llDialog( llGetOwner(), "wand commands shortcut", ["draw","lumos"], 1 );

 

Oh my god that worked. Thank you so much. With that I can create something like what I wanted and just add to that array. You're a star.

Link to comment
Share on other sites

Oh that's cool, didn't think of using dialogs as a way to sidestep the problem.

Edited to add: another alternative that I actually use for myself and didn't think of before either: make a bunch of gestures that use the desired commands and give them hotkeys, as gestures are spoken by your avatar.

For example, create a gesture with an empty trigger and empty "replace with" fields so they actually don't interact with the local chat, then give it an action step "Chat: /1 draw" and bind it to a desired shortcut key. I've replaced my facial expression/related HUDs with these for direct keyboard control. The downside is of course that people need to activate the gestures, and the chosen shortcut keys might be already taken so they might need to be edited by the end user.

Edited by Frionil Fang
Link to comment
Share on other sites

1 hour ago, Fenix Eldritch said:

The trick here is that the source of the [llDialog()] speech will come from your avatar

Not relevant to this discussion, but as an aside, llDialog ( and llTextbox ) responses come with the sending object as the avatar, but the sending ~location as the object which called the function. In practice, this means that if the object making the llDialog call is the same one that is listening for the response, it will always be heard as long as the avatar's viewer is able to send the response* . dialog boxes on channel 0 could be used for (very loud) role-play telephones.

*sometimes works for a few seconds after tp to a very distant region, local distance is loosely related to the viewer's draw distance.

  • Like 2
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 501 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...