Jump to content
Sign in to follow this  
YuukoC

Simple color change help

Recommended Posts

hello, i want to know if can i get some help with a simple color change script that works like this:
 

-touch the object

-menu appears with the colors  p/e: black, white, blue, green,etc...

-i choose the color

-object color changes

 

that's all, just simple, because i already made it worth with avsitter but i want one that works with a touch, not after i sit on it.

Share this post


Link to post
Share on other sites
Posted (edited)

Hi YuukoC, by the way you break up the desired actions of your script, I guess that you don't have any LSL knowledge so far. This forum is for scripters to help each other with their projects. If you want someone to script you such a color change script, you need to ask your question in the in-world employment forum.

If you want to learn to create such a script yourself, I would recommend to start with the LSL101 tutorial (links in the box on the right).

In your script you need to call the function llDialogue in the event handler "touch_start". You will find all the necessary information here but it might be a bit overwhelming for a first scripting project: http://wiki.secondlife.com/wiki/Lldialog

Edited by Estelle Pienaar
  • Like 1

Share this post


Link to post
Share on other sites
9 hours ago, YuukoC said:

that's all, just simple, because i already made it worth with avsitter but i want one that works with a touch, not after i sit on it.

If you've already gotten it all working when an avatar sits on the object, then you can take that working code and move it into a touch_start event instead of the changed event.

  • Like 1

Share this post


Link to post
Share on other sites
9 hours ago, YuukoC said:

... i already made it worth with avsitter but i want one that works with a touch, not after i sit on it.

This actually makes it a bit tricky. You wouldn't really want to pop up a separate script's dialog when somebody is sitting on the object, so you kinda want one script that responds both to the avsitter menu (presumably via a link_message event) and to touch when the toucher is not a sitter. Unfortunately, avsitter doesn't seem to provide any facility to make that particularly easy -- see the response to this question in their FAQ.

 

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)
15 minutes ago, Qie Niangao said:

so you kinda want one script that responds both to the avsitter menu (presumably via a link_message event) and to touch when the toucher is not a sitter

I understood the OP in a way that he wants to have a generic "touch event" script that replaces the "sit event" script of AV sitter for the exclusive use of color changing objects.

But for the sake of the argument: In your use case, Qie, I would propose to create a seperate script that only executes if the avatar who touches the object is at the same time not sitting on it. Then the scripts for the color change cannot run similtaniously and everything should be fine?

Edited by Estelle Pienaar
  • Like 3

Share this post


Link to post
Share on other sites

That would definitely work, but I was worrying about preserving the current color-while-seated ability, while also obsessing that ideally there should be one piece of code that does the color changing, so it can be maintained in one place (not that this is so complex that it really matters). Seems likely that the OP already has a user-supplied script that AVsitter invokes via link_message specific to the color menu buttons, so it may be just as easy to add a touch_start handler that does the whole dialog thing so its listener can call a color-change function that can be shared with the link_message handler. As Fenix mentioned, the same code should be pretty easy to adapt regardless of the triggering event.

The "tricky bit" is that AVsitter by default only interacts with sitters, and has a separate "AVmenu" functionality for non-seated applications using the same AVpos configuration notecard but can't coexist in the same link as the AVsit scripts.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you everybody, actually i should said it before, i'm trying to change the color of a table, that's why i don't want to sit on it to change it.

*Estelle Pienaar just a little bit, i'm not really good at scripting but i can follow almost all the instructions from avsitter, but thanks for your help, i'll give it a look and hope can understand it.
*Fenix Eldritch ohh that sounds easy, i'll look how to try it and hope it works.
*Qie Niangao sorry the confusion, forgot to say what kind of object i was wanting to improve with the script.

Thanks again, for taking the time to read&answer, it seems i may do it better with your tips.

  • Like 2

Share this post


Link to post
Share on other sites
On 7/19/2019 at 10:48 PM, YuukoC said:

Thank you everybody, actually i should said it before, i'm trying to change the color of a table, that's why i don't want to sit on it to change it.

Thanks again, for taking the time to read&answer, it seems i may do it better with your tips. 

if you have questions on your way or if you run into problems, don't hesitate to ask them here!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...