How do you setup Radio controls?

Technical questions, etc..
Post Reply
User avatar
trueBlue
Captain
Posts: 5214
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

How do you setup Radio controls?

Post by trueBlue »

How do you setup three Radio controls in such a way that if one is enabled, it will run a certain script from ONE button?
The Radio controls should only allow one or the other to be enabled.
Capture.PNG
Capture.PNG (2.05 KiB) Viewed 4003 times
O First - Alert!
O Second - Alert2
O Third - Alert3
Enter - Runs the script that is enabled

The three Alert scripts are included inside the Example.
Attachments
Example.RsObj
(13.04 KiB) Downloaded 209 times
stan
Master Chief Petty Officer
Posts: 580
Joined: 21 May 2009, 17:20

Re: How do you setup Radio controls?

Post by stan »

this is one way, change radio button the press enter.
ExampleDone.RsObj
(17.26 KiB) Downloaded 210 times
User avatar
clintonman
Captain
Posts: 5429
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: How do you setup Radio controls?

Post by clintonman »

And another option
Attachments
Example.RsObj
(16.06 KiB) Downloaded 198 times
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5214
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: How do you setup Radio controls?

Post by trueBlue »

Awesome, thank you guys!

What I do not understand though is this line and the path used:
Activity.Run(owner + "/Alert" + choices)

There is no "/Alert" node.

Guessing it is using Safe Name?
Or the First, Second, and Third nodes in the encapsulation?
User avatar
clintonman
Captain
Posts: 5429
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: How do you setup Radio controls?

Post by clintonman »

trueBlue wrote: 08 Sep 2019, 16:26 Awesome, thank you guys!

What I do not understand though is this line and the path used:
Activity.Run(owner + "/Alert" + choices)

There is no "/Alert" node.

Guessing it is using Safe Name?
Or the First, Second, and Third nodes in the encapsulation?
choices is 1,2 or 3
so "/Alert" + choices is /Alert1, /Alert2 or /Alert3

only works because the name of your scripts end with numbers

the commented code also works and doesn't depend on the 1,2,3 values
Clinton Reese

http://clintons3d.com
stan
Master Chief Petty Officer
Posts: 580
Joined: 21 May 2009, 17:20

Re: How do you setup Radio controls?

Post by stan »

In Clinton's version he added to the name 'Alert' using the choice, creating your file names. The choice being the radio button value.

If you look at mine it has Norm or someone code in it, it was part of the 'Matrix Info" script object in the library. I created a switch to read which value triggered which script. It wouldn't matter what the scripts are called then...

Clinton wrote back faster..
User avatar
trueBlue
Captain
Posts: 5214
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: How do you setup Radio controls?

Post by trueBlue »

Thanks for the explanation!
I changed it round a little bit to just run scripts.
Capture2.PNG
Capture2.PNG (10.73 KiB) Viewed 3967 times
New Axis Snap panel
Capture.PNG
Capture.PNG (3.76 KiB) Viewed 3967 times
User avatar
clintonman
Captain
Posts: 5429
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: How do you setup Radio controls?

Post by clintonman »

Seems less efficient than just the buttons, now you select an option and press the button before was just press button.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5214
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: How do you setup Radio controls?

Post by trueBlue »

clintonman wrote: 08 Sep 2019, 18:42 Seems less efficient than just the buttons, now you select an option and press the button before was just press button.
Morning wrecker! :mrgreen:
But as always you are right. :P
Post Reply