Forum Discussion
Storyline Menu Topping Game- Variables & Triggers
I am trying to create a level 2 topping game where our learners can practice building our pizzas (and seeing them be built as they click on ingredients). I am struggling to figure out how to get the variables and triggers set so that:
- The learner can click on toppings and remove them as many times as they would like
- They are only scored after the submit button has been clicked
- The toppings must be layered in the correct order
- The toppings appear and disappear when they are selected/deselected
Anyone make anything like this before or have advice on what I can do to create this? I am able to make it so the layers appear and I get the correct "Correct or Incorrect" with the selected toppings, its the appearing in the right order and allowing unlimited clicks prior to clicking submit that I am hung up on.
I've tried using CHAT but it hasn't given me the result I am looking for yet. Happy to share the project if anyone wants to take a deeper look. Thank you!
2 Replies
- Nathan_HilliardCommunity Member
Without the details and given what you said you have working, for simplicity I would suggest a T/F variable for each topping to indicate if it is in use (I assume it is either on or off the pizza). Then, you can adjust the topping as needed (with triggers or scripts). For example, you could show or hide it, or play assigned motion paths according to the value change of each topping variable.
As for layering in the correct order, if you are using slide layers, then the last shown layer will always be on top. Since it is cumbersome to show the layers in a specific order other than how you placed them on the slide, then different layers for each of 16 toppings is probably out.
I would suggest placing all the toppings on one layer, in whatever order, and setting up a variable to hold a list of the current topping order. This would be easiest if you used something like a JavaScript array and a small script to adjust the order whenever the learner clicks to add or remove a topping. Then, you can quickly cycle through each topping slide object, which you can access using the object() function of the Storyline JS API.
https://www.articulatesupport.com/article/Storyline-360-Advanced-JavaScript-API
For each topping, you can adjust the property object([id]).depth, which sets the stacking order of the objects on the slide (at least within the layer that the objects are on). Using the variable array holding the list of topping orders, you can just assign each order in the list to the corresponding topping, which will shift it in front of or behind the other toppings. You could do this before or after any animations or motion paths if desired.
Tracking these variables should allow you to add and remove toppings as many times as needed, before clicking submit.
Of course, you would need to adjust this to fit your particular design.
- KendalRasnake-1Community Member
Hi Tess,
This looks like a fun project. It is probably doable, but with the number of toppings that you have it might take some time to get all the variables and triggers right, at least if you are going to allow the learner to select the wrong toppings and then get feedback on what they got wrong.
I recently made a serious game with a lot of triggers and variables, which you can see on my website Memorable Learning. You can contact me through my email there, mailto:kendal@memorablelearning.com, if you want to discuss more about how I might be able to help you and take a look at your project.
Related Content
- 10 months ago
- 7 months ago
- 10 months ago
- 10 months ago
- 10 months ago