Im doing a character creation with a radiobutton menu.
<label><<radiobutton "$background" "Valedictorian">><b>Highschool</b></label><br>
You were top of your class. Voted most likely to succeed. Class Valedictorian. +10 Int +5 Charm <<set $intelligence += 10>><<set $charisma += 5>><br>
<label><<radiobutton "$background" "Star Athlete">><b>Jock</b></label><br>
You were the star athlete. You won your school many state championships. +10 Stamina +5 Strength <<set $stamina += 10>><<set $strength += 5>><br>
<label><<radiobutton "$background" "Popular Kid">><b>Popular</b></label><br>You were the most popular kid in class. Everyone loved you and wanted to be around you. +15 Looks +10 Charm <<set $looks += 15>><<set $charisma += 10>>
I need to mpt have it add all the stats at once, only the one that is chosen. What Im wondering is, instead of what I have there if i need to use if statments instead?
Would this work with a popup rather than going to another passage? as there are other thngs I want to add to it as well for the character before its finished.
Closing a popup doesn’t refresh the page by default, but it probably worked. If you want the page to be refreshed could add this right before the Dialog close
But, if you’re doing that, then just use <<goto>> as @Hituro showed above.
Also as @Hituro mentioned, the code shown by @jeb019 has been deprecated for many years now and has been removed from the next version of SugarCube (v2.37.0). You really don’t want to be using it.
Network path separators are always forward slashes (/), regardless of what your local filesystem uses. Browsers will generally fix that for you, but you shouldn’t count on it.
Additionally, the backslash (\) is commonly an escape metacharacter in programming languages, which could be biting you here.
Beyond that, if you’re testing from Twine, you’ll also need to publish to file and ensure that HTML file is relative to your DFimages directory, because Twine’s testing builds are created in a temporary location on disk rather than wherever your images are.