Changes of state triggered by Number Variable - Working intermittently


I've created a game which includes a computer AI challenger, based on a random number generator deciding which answer the computer AI challenger chooses.

However, when the story runs the JS to get a random number, which in turn adjusts a number variable, it should then change the state of the selected answer, this works sometimes, and sometimes is doesn't.

I really can't get my head round why it's doing this, could someone from Articulate take a look for me?

10 Replies
Matthew Bibby

Hi James,

If you want someone from Articulate to take a look, it's quickest to go via their Support channel.  They are both prompt and helpful.

Although, as Articulate don't provide support for JavaScript, they may not be able to help much in this case...

But if you are able to share your .story file here, I'm happy to take a look (as are many others much smarter than me). 


James Bonney

Thanks Matthew.

On the first screen, click on the round blue logo to skip straight to the section that is playing up.

I copied one of the questions multiple times so you can see what i mean without having to see each specific question. The correct answer is the third one down...

After you choose your answer, or run out of time, the 'Chaser' should make their choice...most of the time they do, but on occasions they just don't want to play ball....

It's a SL1 file by the way.

Thanks again

James Bonney

Hi Matthew,

Really appreciate your time taking a look at it.

When I reference the JS variables, that aspect of it is working fine. It's the change of state of the 'Chasers' answer shape that is the issue.

With that in mind, hopefully Articulate will offer to take a look at it.

Thanks again Matthew!

James Bonney

No worries Matthew. I added the last comment for Articulate really (added to my case too) so they can see that although JS is included in the game, it doesn't seem to be that which is causing the issue.

The JS changed the number variable as expected. It's the change of state afterwards which is causing me confusion.


James Bonney

Hi Matthew,

I managed to fix the issue after trying pretty much everything I could think of.

In the end I moved the JS trigger to the main base layer of each question, rather than on the layer when the 'Chaser' decides what their answer is going to be.

It looks like this gives the story/Java more time to process the next few actions and has seemed to fix the issue.

Thanks for your help again!