Hello again, forums. So, I'm working on my next big thing. Title and theming is all a WIP, of course, but for now I'm trying to figure out the coding.
Enclosed is my work in progress, and I have a few issues I'd like help with! Sorry if anything's like, super obvious, it could be I'm just being a dingus.
- You don't really collect the $cheese, it just like. Resets itself to however much you got on your last cheese adventure.
- Cheese is the only working variable for some reason? No error messages get displayed for your other options, but it doesn't actually add anything and still displays 0.
- Fight is so broken. How do I fight. I'm just an eel
Comments
1. The CSS you are using to hide the Undo/Redo links does not hide the tw-sidebar HTML element itself, this mean that it still takes up (invisible) horizontal space which can effect narrow screens, I have included tw-sidebar CSS in my example.
2. A better place to initialise your variables is within a startup tagged passage, this passage automatically gets processed at the start before the first passage is shown to the reader. My example includes one.
3. You should not include the is operator when testing if a variable is greater than / less than a value, the same goes for the "or equal to" variations of the same.
4. It is easy to misspell the name of a variable so I find it safer to use the it keyword when either increasing or decreasing the value of a variable. ... you also need to make sure you always include the dollar sign $ at the start of your variable names otherwise the code wont work, as is the case with the above code in your example which was missing the $ on the $drop variable.
5. There should be no extra coma at the end of your argument lists.
I have attached a modified version of your example which include the above changes.
Issues: fighting the enemies after world expansion is so, so broken, should be able to fix that on my own, though. I need to rephrase the world expansion code. And I'm not sure of an efficient way to stop people from spending more cheese/materials/other resources than they have. One person who I gave the link to test mentioned going 500 cheese into the negative, LOL.
Use an (if:) macro to test is there are enough materials to make an item.
In your main passage you are currently using a condition to hide links: ... you need to do the same in the target passages to conditionally hide their links as well.
eg. In your craft passage you could change the boards link to something like the following:
I'm considering changing the name to "Cheese Death" or something similar, though, haha.