Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Make a variable appear in a link

Hey everyone. First off, I'm using Twine 2.1.1 with SugarCube 2.14.0

I've got a section in my StoryCaption passage where I want to have a popup link (I've already set the java and css for it, and they work fine) display the inventory of the player.

However, before I set this as a popup I just had it list in the StoryCaption. A neat trick I did was ask the player their name, and then changed 'Your Inventory' to '$self's Inventory' with $self being the variable for storing their entered name. EG: Hank's Inventory.

Now, it displays as '$self's Inventory' and does NOT display the entered text, but the actual variable name. How can I make it display the name?
<<if $self is "Nobody">><<popup "Your Inventory" "Inventory">>
<<elseif $self isnot "Nobody">><<popup "$self 's Inventory" "Inventory">>
<</if>>

I've also tried writing it as
<<popup $self "'s Inventory" "Inventory">>
and it works...but it does NOT display 'Inventory'...just the name variable.
Sign In or Register to comment.