Forum Discussion
Trying to change state on a character based on a variable
Hi!
I'm trying to write a game in which the user makes decisions which award or subtract points. As they make these decisions, the customer is shown on screen getting happier or angrier based on their score. However, I cannot get my character "Bob" to change expressions.
I have created the states in question for Bob. I can see the different expressions on the states tab.
I've attached an image so you can see my triggers. The decision made on slide 1.3 awards 4 points for the best decision, and fewer points depending on how many wrong choices you make before you move to 1.4.
I put the variable on the screen, so I could see the score, and it is 4 when I go to slide 1.4 but "Bob"'s expression never changes.
Things I have tried that didn't work:
- Changing the "When" on the trigger to be when object enters.
- Changing the "When" on the trigger to be when timeline reaches 0.25 seconds.
- Changing the variable on the Confused state to be < 3.99 instead of < 4.
- Deleting states I didn't need (I originally set up all the states before deciding on 4 or 5)
Any help much appreciated!
- RonPricePartner
Hello Beth
You are on the right track. When working with the WHEN part of a trigger, it can be confusing. For example, your current trigger is when the timeline starts on the slide. The slide has already started before you change any points, therefore, there is nothing to cause Storyline to check and see what the value of the variable is.
A better "when" for this trigger, maybe "when the variable changes".
- BethLacey-b88dbCommunity Member
Hi Ron! My variable changes on the previous slide though, so I want the expression to be based on the score when the slide starts. Is that possible?
- BethLacey-b88dbCommunity Member
Hi Ron, I'll remove the proprietary images and share it with you - how can I send it to you? Also, I accidentally reported your comment below, sorry. I'm apparently not caffeinated enough this morning to distinguish between words that start with the letter R.
- RonPricePartner
Then that would be a problem. Is this a story that you can share? - I will be glad to troubleshoot.
- RonPricePartner
You post here or you can send it to me at Price@yukonlearning.com. If it is too big for that, you can try Wetransfer.