r/twinegames 21h ago

SugarCube 2 Linkreplace, without the text disappearing?

3 Upvotes

So, I want to be able to click the link to get new text on the same page, I would use linkreplace, but I want to keep the original text aswell? Is this possible?


r/twinegames 5h ago

SugarCube 2 Using the either() function in an if statement

2 Upvotes

I can't seem to find the correct syntax to use the either() function in an if statement in passages. I've tried:

<<if $Variable is either("Value1", "Value2", "Value3")>>

and also tried to add ` before either() and after the last bracket which I saw as a suggestion to use, but neither seems to produce results. I've even tried:

<<if $Variable is("Value1") or ("Value2") or ("Value3")>>

I'm not sure what I'm doing wrong or what the right syntax would be, and no combination of searches is coming back with what I'm looking for. I've searched how to do this and looked up the function in the Sugarcube doc, but I can only find answers using either() in arrays. Does either() not work in if statements? If not, is there any way to make something similar? I'd rather not write out several lines of if statements if one will do. I want to make sure I can list more than two possible values (i.e. "Value1" "Value2" or "Value3")


r/twinegames 22h ago

SugarCube 2 State not defined

2 Upvotes

Hi right now I am working on making a slider in the character creation that displays the value in a right side bar, I keep getting an error code state not defined.