In Sugarcane, how does one refresh a passage?
I have something like this:
Name: <<print $player.name>>
Level: <<print $player.level>>
HP: <<print $player.HP>>
MP: <<print $player.HP>>
XP: <<print $player.XP>>
Gold: <<print $player.gold>>
You buy a weapon!
<<set $player.gold = $player.gold - $price>>
The passage still shows $player.gold as it was before the change.
Can I use state.display() somehow to refresh what's on the screen? If it takes JavaScript script passage, I won't know how to write it for Twine, so help in that regard is appreciated.
The passage's name is "Purchase" so I tried <<set state.display('Purchase');>> but that didn't work.
Thanks!
Comments
Even if I could jury rig it somehow, the point is, I would like to know how to use state.display(). I have a game that uses it, but Henry Soule wrote the code and I can't figure out how to adapt it. "StoryRegions Module" is a script passage. Don't know what the "offscreen" does, but I've tried adding it (or not adding it, like above) and couldn't get it to work.