Too many triggers cause Errors..? variable triggers

Jul 13, 2021

Hi all!

I have a complicated case study, I have created a lot of triggers to make the project work, and it is almost the end of the stage. But, I have one problem to finish up this. 

This activity has 31 buttons as options that learners could choose on one slide, so I have created 62 buttons for creating the display for users to check click and unclick items-this connects to the other layers to show the feedback on each selection. So, 31 buttons that display on top, and behind the buttons, there are 31 more buttons with have been selected design. I also have created a number variable option that shows how many options the learners have picked. Now, I want to limit the users' choice to just 20(And I have created it as Money so, below 0 budget, learners cannot choose the options anymore). 

The trigger -please check the attached image- worked one time when I applied the triggers on half of the buttons (about 15), but when I completed creating triggers, for some reason, it stopped working and I couldn't select any of the options... more specifically, when I click the button, the money will be subtracted and the checked items will be turned to 'normal' not 'selected', so basically just losing money without select any options. 

Hopefully, this makes sense to you. If someone has any idea to solve this problem, would be much appreciated. Thank you! 

3 Replies
Walt Hamilton

Unless you have several hundred more triggers, you don't have too many for SL. You may lose track, but SL can easily handle what you have.

Just guessing, but there a couple of best practices that suggest themselves to me.

The trigger to change to Disabled should probably be set to "<= 0", rather than "=0".

I can't tell for sure without seeing the project, but my first guess is that you may want to change the state of Vital to Selected, rather than Normal if Money is > 0. I'm basing that on this statement you made: "will be turned to 'normal' not 'selected', so basically just losing money without select any options. "

Or, attach your .story file here, and somebody can take a look at it and tell you exactly why it doesn't work.

 

Phil Mayor

If I would have built this I would have used selected state and added triggers on each button to hide a layer and show a layer.

The layer would be a function that runs the calculation based on if an object is selected or unselected, this would reduce the number of triggers on the buttons and ensure you are only trouble shooting in one place.