Trying to change state on a character based on a variable

Jan 05, 2024

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!

5 Replies
Ron Price

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".