Need Some Help with A T/F Variable

Jun 27, 2020

Hi Everyone, 

I was wondering if someone could give me some advice on this demo.  I just submitted it to the EL Challenge #287 on interactive tables and I can't figure out how to program my variables at the end.

I have created an 18-square sushi menu.  You can click the sushi to learn more about each piece, but I also added a button so you can "order" a piece of sushi and add it to your plate on the following slide.  I used a T/F variable to indicate you selected a specific piece of sushi.  When you go to the slide that shows the plate of sushi, I used the T/F variables to change the state of the chosen pieces so they are visible on your plate.  My issue is that if you only choose, for example, 4  of the 18 types of sushi, the plate of sushi looks like the pieces were placed randomly, rather than in a nice huddle like at a real sushi restaurant.  It looks great if you choose 15 or 16 pieces, but crappy with just a couple chosen.  I want the pieces to show up arrayed out from the middle no matter what pieces are chosen so that it looks nice and orderly when the plate slide is displayed.   I'm hoping someone can help me with some variable logic to take this demo over the finish line.  Or even another suggestion on how to execute it completely differently.  I can't make it work. :)  Thank you!

Here are my files:

Demo: https://bit.ly/3g30MYx

Download: https://bit.ly/3i6rxNz

7 Replies
Dave Cox

Hi Jodi,

StoryLine will only arrange the items on the table where you put them. So to do what you want, you will need to decide on an arrangement for each of your possible combinations.

For the 18 items that you have, you have a possible of 262,143 table arrangements for your table, and you need to decide the table arrangement for each. A daunting, but solvable task.

To start with, I would bit map your eighteen items a bitmapped number. 

So item 1 would = 1, item 2 = 2, item 3 = 4, item 4 = eight, item 5 = 16, item 6 = 32, and so forth.

I would then create an object state for each of the 262,143 layouts with the look that you want, and label each state with it's number. State 1 would display item 1. State 2, displays item 2. State 3 displays items 1 and 2. State 4 displays item 4, State 5 displays items 1 and 4. State 6 displays items 2 and 4. State 7 displays items 1, 2 and 4, and so on.

You would then add the bitmapped value of the items selected to calculate the selected state for the table, and display that state with the image for you set table.

Yes, it is a lot of work, but I have done it before a project, and it does work. This sort of item mapping used to be common in software programming, but isn't as commonly used any more. It does at times still have value though.

Good luck with our challenge.

Michael Hinze

See attached a quick example that hopefully shows how this might work. On slide 1, I capture the selections in 18 variables (Position 1 - 18). On slide 2, I created 18 separate objects, each with 19 possible states. You can move these objects around at will (I just arranged them in 3 rows of 6). I execute a bit of javascript that is just meant to create an ordered list and push all the "blank" selections to the back of the list. Then I call layers (one for each position) that change the state of the associated bitmap object to whatever sushi piece was selected. I have done six layers, I'm sure you can duplicate a layer and adjust the variables in each of the remaining 12 layers (that should take too long). You'll end up with a total of 18 layers. With tat setup, the selected pieces will always be displayed one after another, without any "holes". So even if you select Tekkamaki and Sake Handroll, they will still be shown side-by-side. Hope that helps.

 

 

Jodi M. Sansone

Thank you so much for the demo!  I just downloaded it and I follow the logic--I could not have gotten here on my own.  When I was working on this demo last week I kept thinking "This darn thing won't do what I want it to do, it just does what I tell it to do."  I couldn't untangle it and I don't know javascript, so I never would have been able to realize my vision for this. Thank you!

Jodi M. Sansone

I got to the point where my sushi looks perfect on the board--and I limited it to 10 pieces because that's enough for anyone to eat. :)  And I customized the feedback for the 10 layers.  Oy!  Now I have to figure out the logic for toggling the buttons...that will be next week's learning adventure.  I'm glad I decided to take July off!  Thank you for your help and time. 

This discussion is closed. You can start a new discussion or contact Articulate Support.