Sorry if the title is worded weirdly, here’s what I’m trying to do:
I am making a twine game (Sugarcube), and at the start, I am letting the player choose their starting weight, money, etc using a listbox. Here is an example:
Each option has a different weight value. Depending on what the player chooses, the weight value of that option will be displayed on the StoryCaption.
For example, if Large is chosen, and the weight assigned to Large is 200, then I want the Weight counter in the StoryCaption to also show 200. But obviously, the weight will need to fluctuate as well later on, independent of the starting weight.
Well first of all, it may be more simple to use Links instead of a listbox for that case. For instance, assuming you want the next passage to pop up after the player selects a weight:
What is $name's weight? (Determines starting weight)
<<link "Slim">><<set $weight to XXX>><<goto "next passage's name">><</link>>
<<link "Average">><<set $weight to XXX>><<goto "next passage's name">><</link>>
<<link "Chubby">><<set $weight to XXX>><<goto "next passage's name">><</link>>
<<link "Large">><<set $weight to 200>><<goto "next passage's name">><</link>>
<<link "Obese">><<set $weight to XXX>><<goto "next passage's name">><</link>>
Simply replace the “XXX” with the number you want the player to weigh, and replace “next passage’s name” with the name of the passage you want the button to take the player to after selecting their weight.