Hi guys,
I've been trying to understand expression's and scripting with limited success. I've read through the guide and its not making much sense to me.
Can anyone explain how to script one switch to turn lots of other switches off. I think i need to create an "action" script on expression, but here's where i get lost:
Correct me if i'm wrong, an objects x value is not an "attribute". So what command do i need to script to change the x value of another object?
If i can get this bit right i should have a fully working OSC sending and feedback template for Modul8, and i'll be happy to share it.
switch modifying
Re: switch modifying
hmm, maybe "setexpression" is the one?
Re: switch modifying
No worries, i sussed it out; Action script, on expression x, custom button.x=0; =)
Re: switch modifying
Setting expressions in scripts is done directly. For a script to set the x value of the current object:
Some direct value:
The another object's x value:
To have the script runs when a value changes, set the script to run "On Execution", and put x in the box next to that if you want it to run whenever the current object's x value changes, or put otherObject.x if you want it to run whenever the x value of another object changes.
Since you're doing one switch, I'd recommend having a script for each of the objects you want to be controlled by the one switch (you can copy and paste this into each of them). Set the script to run "On Execution" and put theControlObject.x in the box, where theControlObject is the name of the one switch that affects them all. Then the script can be as easy as:
Some direct value:
Code: Select all
x = 21;
Code: Select all
x = otherObject.x;
Since you're doing one switch, I'd recommend having a script for each of the objects you want to be controlled by the one switch (you can copy and paste this into each of them). Set the script to run "On Execution" and put theControlObject.x in the box, where theControlObject is the name of the one switch that affects them all. Then the script can be as easy as:
Code: Select all
x = theControlObject.x