Hi,
I'm using default Sugarcube install in Twine 2. I have a passage that is intended to be only accessed as part of other passages (it gives custom descriptions which I'll want to add as a snippet in a number of different places) so is accessed, currently, using the <<display "Description Passage">> command.
As part of that, I'd like it to grab a variable from another passage which gives yet another part of a description. A schematic would look like (ignore the missing <<nobr>>s: lazy):
Story Passage
You see something, it's a <<display "Description">> something.
Description
<<goto "Size Description">>
<<set $description to "relatively">>
<<set $description += $size>>
<<print $description>>
<<goto previous()>>
Size Description
<<if $thingSize = 0>>
<<set $size to "small">>
<<else>>
<<set $size to "big">>
<</if>>
<<goto previous()>>
However, when I run that I get:
Error: <<goto>>: passage "previous()" does not exist
My code's working - if I call Size Description from Story Passage it works fine. I'm assuming that the issue is that the <<display>> command isn't working alongside previous() - for instance passages accessed through <<display>> don't correctly set up their name or the purposes of previous().
1) Am I correct in identifying the error and
2) Is there a work around for this? I'd sooner not change the structure of the code too much as I need both Size Description and Description functioning as they are.
Hopefully the question makes sense! Any help appreciated.
I'm using default Sugarcube install in Twine 2. I have a passage that is intended to be only accessed as part of other passages (it gives custom descriptions which I'll want to add as a snippet in a number of different places) so is accessed, currently, using the <<display "Description Passage">> command.
As part of that, I'd like it to grab a variable from another passage which gives yet another part of a description. A schematic would look like (ignore the missing <<nobr>>s: lazy):
Story Passage
You see something, it's a <<display "Description">> something.
Description
<<goto "Size Description">>
<<set $description to "relatively">>
<<set $description += $size>>
<<print $description>>
<<goto previous()>>
Size Description
<<if $thingSize = 0>>
<<set $size to "small">>
<<else>>
<<set $size to "big">>
<</if>>
<<goto previous()>>
However, when I run that I get:
Error: <<goto>>: passage "previous()" does not exist
My code's working - if I call Size Description from Story Passage it works fine. I'm assuming that the issue is that the <<display>> command isn't working alongside previous() - for instance passages accessed through <<display>> don't correctly set up their name or the purposes of previous().
1) Am I correct in identifying the error and
2) Is there a work around for this? I'd sooner not change the structure of the code too much as I need both Size Description and Description functioning as they are.
Hopefully the question makes sense! Any help appreciated.