Troubleshooting
Target a single switch and change it's color with a pad?
Started by jbw on .
Sign in or create an account to join the conversation.
I have a project with a switch object, one row with twelve columns, and am looking for a way to change the color of a single switch by controlling it with a pad.
I'm hoping to set it up so that when you tap the pad it will cycle through three different colors for a specific switch, and not all twelve at once.
The only thing I've figured out so far is to set the attribute of the switch so that multiple colors show up. Yes, I am new to this.
Like I say, I'd like to be able to control the color change of just one switch, by tapping a pad that will cycle through three different colors.
Any help is appreciated!
I'm hoping to set it up so that when you tap the pad it will cycle through three different colors for a specific switch, and not all twelve at once.
The only thing I've figured out so far is to set the attribute of the switch so that multiple colors show up. Yes, I am new to this.
Like I say, I'd like to be able to control the color change of just one switch, by tapping a pad that will cycle through three different colors.
Any help is appreciated!
Got it so when I press a pad it changes the color of the switches. Did so by moving the "setattribute" script to the pad object rather than the switch object, and setting the script to run when the pad is pressed "On". Easy enough.
Now I just need two things:
1. To be able to target just one of the 12 switches in the switch object (1 row of 12 columns), and not all 12.
2. The ability to cycle between 3 colors with each tap on the pad.
Now I just need two things:
1. To be able to target just one of the 12 switches in the switch object (1 row of 12 columns), and not all 12.
2. The ability to cycle between 3 colors with each tap on the pad.
Came up with a solution for #2:jbw wrote:Now I just need two things:
1. To be able to target just one of the 12 switches in the switch object (1 row of 12 columns), and not all 12.
2. The ability to cycle between 3 colors with each tap on the pad.
Create three separate pads, one for each color. So rather than cycling through colors with one pad, just tap one of the three to change the color.
[color=#FF0000]Last thing needed: The ability to target a specific switch, because right now it changes the color of all the 12 switches. Again, it's 1 row and 12 columns, and I want to be able to change the color of just 1 rather than all 12[/color]
Any help for this last one is appreciated! Hopefully there's a way to do this.
Here's the code I have set to the 3 Pads (with the number different for each color):
The answer is probably something relatively easy. I just haven't found it yet.
setattribute(Switches25,'colors',{8355711});
And for the "Switches25" I have the "Multicolor" box checked.The answer is probably something relatively easy. I just haven't found it yet.
I guess this is something you want. The color expression now holds 3 random colors, just change those values to the ones you want. Any questions, just ask;)
O wait the forum is full, so I'll just use dropbox...
https://www.dropbox.com/s/gdx6x4p2u12ksyi/ColorChanger.jzml?dl=0
Cheers!
O wait the forum is full, so I'll just use dropbox...
https://www.dropbox.com/s/gdx6x4p2u12ksyi/ColorChanger.jzml?dl=0
Cheers!
Thanks!MrCorba wrote:I guess this is something you want. The color expression now holds 3 random colors, just change those values to the ones you want. Any questions, just ask;)
O wait the forum is full, so I'll just use dropbox...
https://www.dropbox.com/s/gdx6x4p2u12ksyi/ColorChanger.jzml?dl=0
Cheers!
Link expired. Please repost.MrCorba wrote:
I guess this is something you want. The color expression now holds 3 random colors, just change those values to the ones you want. Any questions, just ask;)
O wait the forum is full, so I'll just use dropbox...
https://www.dropbox.com/s/gdx6x4p2u12ksyi/ColorChanger.jzml?dl=0
I actually deleted it and I didn't have it anymore so I tried to recreate it. It was something like this, maybe JBW has the original one.
Switch.jzml
Switch.jzml
Thanks for the repost. Much appreciated.