Forum Discussion

AaronMcCray-a06's avatar
AaronMcCray-a06
Community Member
6 hours ago

Storyline is ignoring variables on a complex slide

I created a "game" puzzle interaction where:

  • You have a slide where the learner has to assemble a puzzle (drag and drop)
  • The learner reveals puzzle pieces by leaving that slide and going to a different slide and answering a question correctly
  • Returning to that slide allows the learner to a) try to fit that piece in, and b) the next piece is revealed so they can answer the next question and so on

This worked perfectly fine when they could check any piece in any order. However, the client wanted them to only allow pieces in order. In making this change, Storyline completely ignores the actions as if it's confused. Here are how the actions work now:

There are nine "pieces" on the "home" slide. Each piece has a question block placed over the piece that links to the relevant question slide. The idea is that when you answer a question correctly, that piece disappears and now you have a puzzle piece that you can drag and drop. 

When the question slide is visited it changes a variable to true that is triggered when you revisit the home slide (which is set to saved state). This worked fine when the state was "if you go to question slide and answer the question correctly, variable is set to true, when you revisit home slide if variable is set to true on timeline start, make state of question block hidden." As the only states were initially visible and hidden.

The issue is adding an "and" and disabled state in the action now that the client changed things. Storyline is not reading the "and" logic correctly. Each question piece has two actions: "if variable A is true and variable X is true, change the state to hidden" and "if variable A is true and variable X is false, change the state to normal." It now just keeps them as disabled. If I remove one or the other actions, it does as I tell it to do, but does nothing when both are active. It seems to be confused by this logic. (which is pretty typical programming logic). 

4 Replies

  • It is always a good idea to put variable references in a temporary text box on a slide so you can check whether they are changing as expected. 

    One thing of concern that I can see in the screenshot is that the numbers in the variable names don't seem to match the numbers in the name of the object they're associated with. 

     

    Beyond that, troubleshooting is just guessing without seeing all the programming. Someone might be able to solve the issue if you upload the .story file. Here are the best practices for doing that:

    • Only include slides that are related to the problem.
    • Be sure objects, layers, motion paths, and variables have meaningful names.
    • If there is proprietary content, replace or delete it. For example, replace proprietary text with “ipsum lorem” text.
    • AaronMcCray-a06's avatar
      AaronMcCray-a06
      Community Member

      The numbers didn't match because the subsequent box is unlocked by the prior question. And I did check if the variables were changing correctly. 

      I actually just "fixed" it in a really silly way with trial and error. I removed the "and" in the "set to normal" action and just made it "if variable a is true, set to normal" and then placed the "if variable a is true and y is true, make hidden" UNDER the set to normal action. The initial setup SHOULD have worked by programming logic, but didn't, for whatever reason. But since Storyline does reads actions in order, the second action overrides the first anyway. 

      • JudyNollet's avatar
        JudyNollet
        Super Hero

        Oh, thanks for explaining the variable names. (The confusion shows why it's so much easier to troubleshoot by looking at a .story file.)

        I've never had any issues with similar triggers. In any case, I'm glad you got it working.