how to set more or less for variable

Once again, I am struggling with variables. In the attached slide, I want the mirror to show red if there are more red answers than blue dropped on it, and blue if the opposite is true. I'm sure there's a way to do it, but I can't figure out how to accomplish it.

Of course it would be even better if I could get the shade to be a deeper or lighter shade of red or blue depending on how many of each landed on it, and purple if they were equal, but that's way beyond my ability level!  Thanks in advance for any help.

Frances

14 Replies
Mike Enders

Hi Frances,

I altered the file (attached) to use variables to change the mirror color.  While there is a more elegant way to do it, I structured it as I did so it would (I think) be easier for you to understand what is happening in the background.  I added a simple reference to the variables on the slide so you can see how they're functioning as you drag and drop the items.

I hope this helps!

Mike

PS.  The more elegant way would be to simply use one number variable.  You could subtract 1 each time a red is added and add one each time a blue is added.  The you could simply change the mirror to red if the variable is less than 0, normal if it's equal to 0, and blue if it's greater than zero.

Frances Steinberg

Thanks, Mike.  Been a verrrry long day and I can't for the life of me figure out how to open your attachment!

As to the number variables, I think that does make sense even to my very limited ability to use variables.  Will go and practice with it and then hopefully figure out how to open what you sent!  Cheers,

Frances

Frances Steinberg

I'm in SL2, but I still can't figure out how to find and open the file from the zip.  Just keep finding a folder and can't see how to open the .story file.

On a more positive note, I've redone it with the number variable and it works (attached)!  And I learned a new skill!!!  Thanks so much,

Frances

Frances Steinberg

Very chuffed with myself, because I normally blank when it comes to variables, and doing this gave me an "aha" moment.

Only remaining question is how I can open the file you sent back, because I can't even open the one I sent you from what I attached and I figure I'll need to know how to do this at some point.  Which folder is the story file in?

Ashley Terwilliger

Hi Frances,

Glad you were able to figure out the variables! It's always a good feeling

in regards to the files, I'm able to open both. You mentioned opening a zip file - but I only see .story files listed here. Is it possible your computer is set to open the .story files in another program or not "seeing" them correctly? 

Frances Steinberg

Hi, Ashley.  I don't know what's happening.  When I click on it, I get a prompt to open or save.  If I open, it doesn't work, and if I save to my desktop there's a whole zipped folder there.  I've never had this issue before but I'll search out what my computer is doing--there's a chance that when they are SL2, it's trying to still use SL1 to open.  Cheers,

Frances

Ashley Terwilliger

Hi Frances,

In regards to the SL1 file trying to open in SL2, that sounds like the program file settings are set to automatically open any .story files within SL2. You'll want to look into this on your Windows -> Control Panel ->Programs ->Default programs and then "Make a file type always open in a program"  is how it's set up on my Windows 8.1 system.

In regards to giving you the file folder set up, what happens if you try to open SL2 and then look for a file within the open set up in there? Are you able to open a file successfully? Have you enlisted the help of your IT team to see if something else is interfering with the set up? It was hard to tell from that image, but are you saving the downloaded file to a local drive and opening there? Can you try moving the downloaded file to your desktop or similar local drive and opening it from there to help rule out a long file path being a problem?