[Twine 2][Sugarcube 2]Problem with the numberpool marco

Please specify version and format if asking for help, or apply optional tags above:
Twine Version: 2
Story Format: sugarcube 2

So this is probably something really stupid but I’m getting far too frustrated to look at this clearly. I have a navigation system where the player gets to a list of levels in a dungeon, because I need a limitation on the number I used the numberpool macro.

''Current Level:'' <<=previous()>>
''Level Unlocked:'' @@#max;<<=$unlock>>@@ 

''Goto Level'':
<<numberinput "$goto" `previous()` 1 `$unlock`>>


[[Cast|$goto]]

The problem I have is that when I click cast, it leads me to level 1, not the number the player has inputed. I think it’s because the link is created before the variable got changed but I’m not sure how to change that.

Try changing:

[[Cast|$goto]]

to:

<<link "Cast">><<goto $goto>><</link>>

That way the link will use the current value of $goto when the “Cast” link is clicked on.

Hope that helps! :slight_smile:

Thank you! :laughing:
The problem is now solved, which means so much to me, I had another passage with a similar problem to this so this is greatly appreciated.