Jump to content

Pulling a variable from chat line for a gesture


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

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

Recommended Posts

A gesture is not a LSL script, so the question is a bit out of place here.  There really isn't a much better place, though.  Gestures are extremely simple.  There's only one way to pass anything from chat and that's to use it as a trigger, preceded by a slash, as in   /hop .  You can output text to chat by building it into the gesture's primitive script, but that's about it.

Virtually everything you need to know about gestures --- or are likely to find in SL's documentation --- is in this very brief Knowledge Base article >>> http://community.secondlife.com/t5/English-Knowledge-Base/Using-gestures-and-animations/ta-p/700069

  • Like 1
Link to comment
Share on other sites

Your question is not very clear. I think I understood something but I may be wrong. Any way, here is my answer about passing variables to a script through gesture.

First, the gesture: You need a gesture which replaces the trigger by a channel number. For example: "/trigger" replaced by "/11223344[_]". (Where "[_]" represents a blank space.)

Your avatar cannot speak on a negative channel but you can speak on a very high positive channel. It's the same thing.

Then, the script: Nothing complicate, a simple listener for the owner on the channel you set in the gesture. (Here, 11223344.) Your script will hear everything you type beyond the trigger. For example, if you type "/trigger param1 param2", your script will hear "param1 param2" on channel 11223344. You use llParseString2List() and you get all your variables nealty put into a list.

You can go a little further and use several gestures which talk on the same channel but insert a keyword so that your script can sort things out. For example: "/triggerone" replaced by "/11223344[_]one[_]" and "/triggertwo" replaced by "/11223344[_]two[_]". The listener script will hear "one" or "two" followed by everything you type beyond the trigger.

But there is no special syntax to respect. It's up to you to decide what and how you want to receive the variables... and to check them.

For example, amongst the scripted gestures I use, I have "/chat" which is replaced by "/11223344 chat,[_]" (Not the real channel) and the variables I am supposed to give are range, channel, name, text. So I can speak to my objects on any channel, including the negative ones, through any means from llWhisper() to llRegionSay(), using an appropriate name if necessary. The same script commands my titler through another gesture and I have a bunch of gestures which send predefined texts to it like an orange "AFK" which appears when I say "brb" or "afk" and disappears when I say "back", etc, etc.

The sky is the limit... but you have to script it.

  • Like 1
Link to comment
Share on other sites

Rolig - yes, I know, but that is sort of the issue. Gesture-making can be very annoying because the term is something that will pull a tonne of results from non-SL sites, and no one really seems to focus on it. The site you linked is the one they all seem to lead to in the end, but then I've seen what I THINK are gestures being used that can pull variables...

 

Kaluura - I'm not sure what is confusing about my post, but you do understand what I was looking for :) It started as idle curiousity because I wanted to just pull names I was typing to make a greeting gesture for a sim I work. Then I began trying to figure out what else I could pull... I will play with the infoyou gave me, it looks like the chat channel thing could be very potent...

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4501 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...