Twine Version: 2.3.9
Story Format: Sugarcube
So I’m doing one of those puzzles where you have three containers of different sizes and you have to pour stuff from one to another until two of them are even. (Yeah, I know, it’s been done to death, but I’m not here for feedback on my puzzle choices at this time.)
So I’ve got my buckets as objects with properties for current fill, maximum fill, and currently available space, with starting values as follows (these aren’t the finalized values for the puzzle, by the way, I’m currently just trying to get the mechanics of the thing to work):
<<set $left to {fill : 7, max : 7, space : 0}>>
<<set $right to {fill : 0, max : 5, space : 5}>>
<<set $small to {fill : 0, max : 2, space : 2}>>
Then I’ve got a “pour” macro that looks like this:
<<widget "pour">>
<<if $args[0].fill <= $args[1].space>>
<<set $args[1].fill to $args[1].fill + $args[0].fill>>
<<set $args[0].fill to 0>>
<<set $args[0].space to $args[0].max>>
<<set $args[1].space to $args[1].max - $args[1].fill>>
<<else>>
<<set $args[1].fill to $args[1].max>>
<<set $args[0].fill to $args[0].fill - $args[1].space>>
<<set $args[0].space to $args[0].max - $args[0].fill>>
<<set $args[1].space to 0>>
<</if>>
<<set $turns += 1>>
<</widget>>
The following macro calls all work as intended:
<<pour $left $right>>
<<pour $left $small>>
<<pour $right $left>>
<<pour $small $left>>
However, when I pass the macro either combination of “$right” and “$small” (<<pour $right $small>> or <<pour $small $right>>)… nothing happens. The values of the properties of $right and $small are completely unchanged. All of the macro calls here are copy-pasted right out of my markup in Twine, so you can see there are no typos or missing brackets or anything. I can’t see any reason why the right bucket and the small bucket shouldn’t be able to interact with each other when they both interact with the left bucket just fine, but they just don’t. Anyone have any idea what’s going on?