No announcement yet.

Conditional Choices ready for testing

  • Filter
  • Time
  • Show
Clear All
new posts

  • Conditional Choices ready for testing

    1. New "variables" view for a story - admin only. Shows all values for all variables in story. And shows all variable sets by room.
    2. For each choice 2 additional fields are shown - Variable and Value.
    3. Choice shows when the specified variable is set to the value specified.
    4. If variable name is set, but value is blank, then the choice will show as long as the user has a value for that variable.
    5. You can combine multiple values separated by comma i.e. "knife,sword" if variable value was knife OR sword, then the choice would show
    6. If there are multiple variable sets for the same name in the same room, then the last one sticks.
    7. Variable names are case insensitive
    8. No commas or square brackets are allowed in values
    9. Preceding and trailing white space will be ignored in values
    10. Multiple spaces in values will be treated as single space in values
    11. At least one non-conditional choice must exist for each room to prevent a room from not having any choices

    If some of you could play around with this, try to break it, make sure it does what I claim it does, it would be greatly appreciated.

    I will combine all of the notes from these last two topics into a help file.

    To Do / Other Ideas - please opine:

    12. Add help file / faq / instructions on variables
    13. If no variables exist in a room (or editing new room) have variable fields hidden by default? ("Use Variables" link would make them appear)
    14. Allow > 5 choices per room
    15. Just like loose ends, show a view of all choices that will never show because there is no variable set with that value. Please note that while this would likely be useful, it would not catch all conditional choice errors e.g. some paths would cause a variable to never be set thereby making a choice impossible to show. But, it would catch the obvious ones.
    16. Allow a NOT EQUAL TO condition - this might be overkill and tricky since I allow multiple value conditionals
    17. Admin variable view - shows all variables as they are reading/navigating through story.
    18. Admin - show all choices and visually indicate

  • #2
    Looking forward to playing around with this in a day or two, just as soon as I can get through some promised proofreading for someone else.


    • #3
      Thanks for the info! Thanks for that other post that told me how to set variables: "New Features+ Room Variables are here..."

      Ok, so when I set an option to require a variable ("knife should be y"), it just appears in red text under the option ("Variables: knife, Values: y"). I thought that the option would be invisible if you didn't have knife set to y, but I can still see it. Is this only because I am an admin, or will others see this too?
      Last edited by Lightning_11; 12-13-2019, 06:28 AM. Reason: New Info


      • #4
        That is correct Lightning_11 - you are seeing the rules because you are viewing it as an admin. You can corroborate this by simply logging out and viewing your story. At some point, I may create a "non-admin" toggle for admins.


        • #5
          Ok, that sounds great. Thank you for the clarification and all the hard work updating the site.


          • #6
            I'm having trouble with these.

            The first two links go to pages that have [questionzircon=2] and then a link back to this page.

            Only the first two questions show up the first time I got there so that part works. But when the page is reloaded those are still the only ones that show up, you never get the other three that were supposed to appear.

            Last edited by Wildblue; 01-21-2020, 02:54 PM.


            • #7
              It took me awhile to even figure out how to test these because I had to set the game to public and then log out, and then log back in to make sure I had it right. I wish there was a way to just preview it.


              • #8
                Wildblue, I can't test it right now but have you tried link restrictions on new pages? It might be something about the fact you're reloading a page you've already been to that's confusing it, and it would be useful to narrow down the cause.


                • #9
                  I'm not going to test it right now, I'm busy writing.

                  I did discover that you can't just remove the link restrictions and save the page, you have to delete the link and then add it again because without that the changes won't save.


                  • #10
                    I can add an admin feature that makes it clear a choice is showing because the condition is met.


                    • #11
                      Wildblue send me a link to
                      your room.


                      • #12
                        Just spent some time testing this, and it's not just returning to old pages that's the issue. If a variable condition is set on a link at all, it will hide that choice from the player.

                        I'm using Firefox and haven't tried it with anything else, but that seems to be the outcome in every situation I could come up with.

                        [display variable] also seems to be broken, unless I just fundamentally misunderstood something about how all of this works. The [display whatever] is plainly visible on the page even when logged out. Although [set variable=whatever] hides itself for the player as it should...the thing the variable is set to is just ignored in conditional links.


                        • #13
                          It's possible something (everything?) broke when conditionals went in, because set, display, and alert all did work when I originally checked them out.


                          • #14
                            I tested the exact scenario described above and it's working as I expect. If you post a link to your room I can take a closer look.

                            Keep in mind that if you restart the story, it resets all conditionals. Are you doing that?

                            Simply reloading the first page doesn't cause the conditionals to be cleared.


                            I'm not sure how to approach the admin view so that you can not only see all conditional choices but also know that due to your current conditions, it is visible.

                            Personally, if I want to test, I just use another browser but that isn't possible if it's a private story. Any ideas for visually how to do this?

                            I could always show the current conditions in a list near the choices. Would that be sufficient?


                            • #15

                              Made a test story to see if I could replicate issues that Mizal was having, and I couldn't. I don't doubt that perhaps it's the admin view trickery (making a current conditions section is almost a necessity, so writers can make sure the variables are working as intended), or another issue that my rather basic testing game didn't pick up on. A purely cosmetic change I'd recommend is, when imputing a variable name with a capital letter, the error not show up asking that:

                              Variable names can only contain letters, numbers, underscores and dashes. (Choice #1)
                              Variable names must start with a letter. (Choice #1)

                              This confused me greatly, until I switched it to lowercase, and then it was fine. That, plus the current conditions should help alleviate confusion. Thanks!


                              Do Not Sell My Personal Information