Is there a way to change the state of the same object multiple times, simply by clicking on the object? For example, I want to change a shape from red to blue to green by clicking on the shape. This should be continuous. So as long as I keep clicking the colors will change in order.
I thought this might be doable without variables, and turns out it is (at least, I think it's working as you'd described, John). Either way is correct, of course...but figured I'd throw it up here.
The particulars:
Initial state (normal state) is blue.
Then I created a state for red, green, orange, and blue
You'll see how the triggers work if you look at the triggers panel...trigger order is important.
If there are multiple triggers on the same object that are triggered by the same action (such as "on click"), the triggers execute in the same order in which they appear in the Triggers panel (top to bottom).
And that SL "looks" down the list and keeps going until it finds a trigger that it can use (you can tell by my description that I'm not a programmer ).
So a sort of "reverse order" seemed to work here...
If you use only current state to determine whether to change or not, the character will always change to the last trigger's state.
You need an independent, outside, impartial observer (like Wendy's variable) to declare what state to change.
If you change based on the current state, the state will change twice. Notice that the variable only changes once, without the need for a condition, so it is reliable.
Thanks Wendy...I had been just about to do exactly that!
Great minds... :)
So, I'm still confused as to why Rebecca's file works, but mine doesn't. She's using no variables, and only referring to the actual state of the object.
Is it because she's got a NORMAL state that matches the BLUE state, and that's allowing for the progression somehow?
What an eye-opener this has been for me. Your Character never changed to calm because of the order of the triggers. When the first trigger found him angry, it turned him to calm. Then the second trigger found him calm and turned him back to angry. (Changing the order of the triggers would make him always calm and never angry, for the same reasons.) I always thought that only the last state persisted, but looking at Rebecca's file, I realize that in reality, only the first state is never used. Her blue state is never seen, because her last trigger always turns blue to normal. Since they are identical, nobody notices.
I did the same with your sample. I duplicated the calm state, and called it New State, set up the triggers, and now you can click him and he toggles between calm and angry. The difference is that there are three states, and the one associated with the first trigger is never used, so he looks to be switching between two states. (I did add a little color to the New State to make it obvious what is happening.)
You may need to change the order of the triggers, and maybe duplicate the angry state. Depending on his initial state, it may take two clicks to change him the first time.
It looks like I have both a variable, and a non-variable solution. :)
And Walt, to clarify... It looks like Rebecca's non-variable solution works because the Normal and Blue states match, and that the Blue state instantly flips to Normal.
Wendy - I realize this is an old post but THANK YOU if you ever read this. I still can't quit wrap my head around the sequencing triggers but I followed your directions to a tee and it worked!!! You rock. Viviana
Thank you to the 2014 crew who made this thread! It just solved a massive issue a friend of mine was having and I was trying to fix it for her. THANK YOUUUUUUUU
19 Replies
See attached a quick example that cycles an object through four different colors/states based on the value of a counter variable. Hope that helps.
Thta helps.
Thanks
Hi John and Michael,
I thought this might be doable without variables, and turns out it is (at least, I think it's working as you'd described, John). Either way is correct, of course...but figured I'd throw it up here.
The particulars:
Initial state (normal state) is blue.
Then I created a state for red, green, orange, and blue
You'll see how the triggers work if you look at the triggers panel...trigger order is important.
Please shout out with any questions.
Rebecca, that is brilliant. So simple, but what a puzzle to get the trigger order right!
Thanks. That works as well. Just out of curiosity how did you know what order?
Tx, Mereym!
To tell the truth, John, I fiddled a little. I had them all but one.
I knew that, according to Articulate support,
If there are multiple triggers on the same object that are triggered by the same action (such as "on click"), the triggers execute in the same order in which they appear in the Triggers panel (top to bottom).
And that SL "looks" down the list and keeps going until it finds a trigger that it can use (you can tell by my description that I'm not a programmer
).
So a sort of "reverse order" seemed to work here...
Thanks, I've found this the most useful discussion and Rebecca's example is great.
I've made an infographic which may help the next person battling with this :)
Hi Elearn! Thanks for popping in to share. As you can see from the documentation here, triggers execute from top to bottom.
Hi all...
I have a similar issue.
I'm trying to change the state of a character back and forth upon clicking the character.
I've uploaded a sample.
I've tried re-ordering my triggers. One order allows me to change from normal to angry, but not back to Normal. The other order does nothing. :(
I downloaded Rebecca's file, and what I've built looks similar...but I can't seem to get the states to bounce back and forth.
Can someone have a look and suggest a change?
Thanks!
-gt
Hi George
I've added a varaible that toggles - see if this works for you
If you use only current state to determine whether to change or not, the character will always change to the last trigger's state.
You need an independent, outside, impartial observer (like Wendy's variable) to declare what state to change.
If you change based on the current state, the state will change twice. Notice that the variable only changes once, without the need for a condition, so it is reliable.
Thanks Wendy...I had been just about to do exactly that!
Great minds... :)
So, I'm still confused as to why Rebecca's file works, but mine doesn't.
She's using no variables, and only referring to the actual state of the object.
Is it because she's got a NORMAL state that matches the BLUE state, and that's allowing for the progression somehow?
Hi George
I edited Beccy's file to show the name on the state - as you can see it never touches the 'BLUE' state.
I also added in a slide with just two states and it behaves the same as your's changes state once but not again.
Hence the use of variable.
George,
What an eye-opener this has been for me. Your Character never changed to calm because of the order of the triggers. When the first trigger found him angry, it turned him to calm. Then the second trigger found him calm and turned him back to angry. (Changing the order of the triggers would make him always calm and never angry, for the same reasons.) I always thought that only the last state persisted, but looking at Rebecca's file, I realize that in reality, only the first state is never used. Her blue state is never seen, because her last trigger always turns blue to normal. Since they are identical, nobody notices.
I did the same with your sample. I duplicated the calm state, and called it New State, set up the triggers, and now you can click him and he toggles between calm and angry. The difference is that there are three states, and the one associated with the first trigger is never used, so he looks to be switching between two states. (I did add a little color to the New State to make it obvious what is happening.)
You may need to change the order of the triggers, and maybe duplicate the angry state. Depending on his initial state, it may take two clicks to change him the first time.
Thanks all!
It looks like I have both a variable, and a non-variable solution. :)
And Walt, to clarify...
It looks like Rebecca's non-variable solution works because the Normal and Blue states match, and that the Blue state instantly flips to Normal.
Am I reading that right?
yes
Wendy - I realize this is an old post but THANK YOU if you ever read this. I still can't quit wrap my head around the sequencing triggers but I followed your directions to a tee and it worked!!! You rock. Viviana
Great news Viviana - love how the forum continually helps people. All the best with your project and feel free to shout out if you need anymore help.
Thank you to the 2014 crew who made this thread! It just solved a massive issue a friend of mine was having and I was trying to fix it for her. THANK YOUUUUUUUU