Hello! So I’ve hit a slight bump with my coding. I’m trying to do this where depending on the romance option only that choice shows up for them. This is my code for it
And then this is the outcome
Anyone mind telling me what I’m doing wrong? Thanks!
If you click on the icon that looks like this: “</>” in the editor window when writing a post (last icon visualized in the screenshot):
you’ll be able to paste formatted code without it going a bit wonky from being pasted into said text editor. I would highly encourage doing so, to make it easier for other contributors to try to troubleshoot.
It should produce “```” above and below the space where you can input your code. So, as an example:
<<if $player_name neq "Zeke">>
You really shouldn't be eating cat treats.
Which, in the editor would look like so:
Well, I see a missing quote in the link markup for your second option (
<<link "So many books..." "Chapter2ChoiceNero>>), but that’s not the source of your problem, because that would give you an “unterminated double quote string” error instead of just a blank. The form this is taking suggests to me that Twine thinks none of these if statements apply, but without seeing where/how you’re setting the variable, it’s hard to say more than that.
Like EJ says, you are testing a passage without a condition that applies to fulfill the conditional statement. Either here is nos
<<else>> in there or ealier in the story a variable was no set correctly.
Like Sophia said: we wuld need the whole code of the passage pasted to see
you could quickly output the value $romance to see what it is set to.
<<= $romance >>
Great news I figured out what was wrong! Bad news I’m just stupid and continue to do this stuff in the middle of the night it was just straight up the fact I didn’t have >> this dude at the end of a couple choices. Thanks for your help everyone!
One thing I have found is that more time spent working with Twine hasn’t reduced the number of stupid errors I put in my code, but it has reduced the amount of time that I need to spot and fix them.
TL;DR everyone makes dumb mistakes.