I'm using sugarcube 2x in Twine 1.4
I want to know if it's possible to have a link display a list of variables of a certain class.
Like for example I have this link called 'move' that will give you a list of rooms you can go to, and in order to display all of the links it searches for variables that have the class 'move' assigned to them.
I'm sorry I can't give any examples in code, I can't write any off the top of my head.
Comments
If I may reiterate my question, how can you assign a class to a $variable?
Why are you trying to add classes to story variables in the first place? If you know which variables need to be flagged in some way to denote they should included in your list of moves, then you already know which ones you need to include in said list. I'm not seeing the point in what you're trying to do.
Explaining what you're trying to accomplish may be helpful. What's the end result you wish to achieve?
I'm trying to make a game that plays similarly to a visual novel called Snatcher.
Pressing one of the options, move, look, etc would give you a list of other links (where to move, where to look), and these lists would change depending on the room.
(I know I could accomplish this just by having a long series of ifs, but I wanted to try something else).
That's a fairly simple example, but you should get the idea. You could change how the options are presented and shown for extra flair. Additionally, the <<click>> macros could be turned into widgets to make things more tidy and reusable.
Thank you for your time. I'll let you know if I have anymore questions.
Thanks again!