Hi there everyone!
I'm trying to change a variable to toggle an animation (single frames in a directory) on and off. I figured the way to do this was to make the counting calculation a variable and have it set to either 1, so it shows frame 1 only and doesn't count, or 28 where it will then count to 28 and play the animation.
The problem is I can't figure out how to write the LeftMouseDown action to toggle between the 2 variables/states, or to change the 1 variable back and forth. Spent a few hours messing with it and my brain is now mush. HELP!
Thank you
It is currently May 3rd, 2024, 3:38 am
how do I toggle between 2 variables on LeftMouseDown action?
-
- Posts: 15
- Joined: October 5th, 2011, 3:21 pm
-
- Moderator
- Posts: 1931
- Joined: January 29th, 2010, 1:43 am
- Location: Willmar, MN
Re: how do I toggle between 2 variables on LeftMouseDown act
LeftMouseUpAction=!SetVariable YourVariable (29-#YourVariable#)
DynamicVariables=1
If you want to toggle between 1 and 28, just add them together and subtract the current value of your variable.
You may benefit from this thread.
DynamicVariables=1
If you want to toggle between 1 and 28, just add them together and subtract the current value of your variable.
You may benefit from this thread.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
-
- Posts: 15
- Joined: October 5th, 2011, 3:21 pm
Re: how do I toggle between 2 variables on LeftMouseDown act
Yes I'd like to have them toggle per mouse click, so 1 Click would set 28 and another click would set 1. I don't understand your code there fully but will give it a try and will check out that thread.smurfier wrote:LeftMouseUpAction=!SetVariable YourVariable (29-#YourVariable#)
DynamicVariables=1
If you want to toggle between 1 and 28, just add them together and subtract the current value of your variable.
You may benefit from this thread.
Thank you for the fast reply!
Imaginos
-
- Posts: 305
- Joined: August 14th, 2009, 8:04 am
Re: how do I toggle between 2 variables on LeftMouseDown act
Here's that code in a quickie test skin.
-
- Posts: 15
- Joined: October 5th, 2011, 3:21 pm
Re: how do I toggle between 2 variables on LeftMouseDown act
Heh, thanks... I see. The variable code takes both numbers added together and then subtracts one of the two from that total, giving you one of the two numbers. Tricky and nice!
Thank you again for the code/help/thread link.
Thank you again for the code/help/thread link.