Question Can I use the UI Toggle to control the functions of a UI Button?

ShinyAndroid

Well-known member
Featured Contributor
Messages
81
Reactions
619
Points
83
I apologize if this is a super basic question. But I basically have no experience with scripting or anything. I did look through the forums and videos but I can't figure out how to do this.

Basically I want to have a UI button that does two things (Example: when clicked - change a persons clothes and starts an animation... I can do this part)

And I want to have a UI Toggle that changes the function of that button (Example: When clicked - Just starts the animation, doesn't change clothes).

So, in my mind, I want the UIToggle to uncheck/check the "Change clothes" trigger in the button.

But I can't figure out how to do it. I've gone through all of the options in UIButton but none seem to directly control the triggers. Any ideas?

And again I apologize if this is super simple. I'm just not experienced in it.
 
There might be an easy workaround for that: Make two UI-Buttons at the same place with your desired triggers. Turn off one of them in the atom control. Then use the toggle to change which one is on and which is off.
 
Upvote 0
If you're looking for advanced scripting like this, I would suggest to look into VAMStory instead.
Using native VAM buttons/toggle, you'll end up needing far more atoms than what VAMStory can do in a couple of clicks.
If you combine VAMStory Director and VAMStory Actions, you have an (almost) endless "UI interaction" system for your scene : )
 
Upvote 0
If you're looking for advanced scripting like this, I would suggest to look into VAMStory instead.
Using native VAM buttons/toggle, you'll end up needing far more atoms than what VAMStory can do in a couple of clicks.
If you combine VAMStory Director and VAMStory Actions, you have an (almost) endless "UI interaction" system for your scene : )
Thanks for the tip! I'll check it out. I'm always trying to use as few dependencies as possible but this actually sounds like a worthy addition!
 
Upvote 0
Thanks for the tip! I'll check it out. I'm always trying to use as few dependencies as possible but this actually sounds like a worthy addition!

Bear with me, this is not me preaching for you, using VAMStory, but more like a general note because I had that discussion several times already with different creators and vam friends, and it's taking stupid proportions in the community lately. So take this more as a general knowledge/workflow tip.

People/Creators should not be afraid of using dependencies. You should NOT not use a resource just because you're seeing your dependency count building up. The whole logic behind "there is too much dependencies" has appeared because, when var files arrived, people released absolutely insane scenes/resources with stupid dependency counts since they did not understand it.

A proper resource on the hub shouldn't be a problem for you to use IF it's done properly. You should be careful about resources having a shit ton of dependencies ( so sub-dependencies in your case )... like for instance a look/appearance with 30 dependencies is a shitty var (98% of the time).

For the rest, if you find a plugin or resource that boost your productivity/creativity/end result far beyond what you could do without it. You SHOULD use it. It's not a question of your scene having too much dependencies, it's a question of using resources properly packaged : D
 
Upvote 0
Bear with me, this is not me preaching for you, using VAMStory, but more like a general note because I had that discussion several times already with different creators and vam friends, and it's taking stupid proportions in the community lately. So take this more as a general knowledge/workflow tip.

People/Creators should not be afraid of using dependencies. You should NOT not use a resource just because you're seeing your dependency count building up. The whole logic behind "there is too much dependencies" has appeared because, when var files arrived, people released absolutely insane scenes/resources with stupid dependency counts since they did not understand it.

A proper resource on the hub shouldn't be a problem for you to use IF it's done properly. You should be careful about resources having a shit ton of dependencies ( so sub-dependencies in your case )... like for instance a look/appearance with 30 dependencies is a shitty var (98% of the time).

For the rest, if you find a plugin or resource that boost your productivity/creativity/end result far beyond what you could do without it. You SHOULD use it. It's not a question of your scene having too much dependencies, it's a question of using resources properly packaged : D
Hey I always appreciate any input or tips! And I agree completely on using dependencies smartly. and after using VAMstory for about 10 mins now I feel like I've been sleeping on this big time, so thank you again!
 
Upvote 0
Basically I want to have a UI button that does two things (Example: when clicked - change a persons clothes and starts an animation... I can do this part)

And I want to have a UI Toggle that changes the function of that button (Example: When clicked - Just starts the animation, doesn't change clothes).

So, in my mind, I want the UIToggle to uncheck/check the "Change clothes" trigger in the button.

LogicBricks has got the "SelectChoice" brick, which seems to be precisely what you are looking for.
Otherwise, @Femcore 's approach with using two buttons and just hiding/unhiding them is also very good, especially since you likely want to change the text on the button.
 
Upvote 0
If you're looking for advanced scripting like this, I would suggest to look into VAMStory instead.
Using native VAM buttons/toggle, you'll end up needing far more atoms than what VAMStory can do in a couple of clicks.
If you combine VAMStory Director and VAMStory Actions, you have an (almost) endless "UI interaction" system for your scene : )
Of course, I would always recommend using your VAMStory Actions for buttons too. I missed mentioning that in my first answer, where I aimed to provide a quick and easy solution to the already made setup. :)
 
Last edited:
Upvote 0
Indeed! There is no wrong answer, only alternative workflows. Your approach, @MacGruber's one or VAMStory are all valid.
I'm just not fond of having 156 atoms to make a couple of buttons anymore :p
 
Last edited:
Upvote 0
Back
Top Bottom