Automatic completion of <<if>> variables

0 votes
asked Sep 9 by KittyEden (150 points)
I'm working with Sugarcube 1.0.35 right now. There's a particular part of the game that I'm trying to put together and don't know how to- there's eleven separate variables.(all called $partone, $parttwo, and so on) that are either true or false at any given time. I want to make it so that when all variables are true, the game, no matter which passage the player is on at the time, sets a twelfth (separate) variable to be true as well.

Please tell me if I'm not making any sense/need to clarify any information. Help would definitely be appreciated!

-K

1 Answer

0 votes
answered Sep 9 by RealityDev (1,130 points)
selected Sep 9 by KittyEden
 
Best answer

Would it be as simple as a PassageReady passage with an if statement in it, checking is parts one through to eleven are true and if so, setting $parttwelve to true as well? This would only update them upon loading a new passage (or reloading the current one), to my understanding, which may or may not get the full functionality you're looking for.

commented Sep 9 by KittyEden (150 points)
edited Sep 9 by KittyEden
This sounds about right from what I can tell, but I'm having trouble tracking down the information on how exactly to do it. Would you have a link for something that could explain PassageReady info?

EDIT: actually did manage to find a thing explaining PassageReady, but now I'm having trouble with sorting the <<if>> statements themselves. Mainly, I have no idea where to actually begin. HelP?
commented Sep 9 by greyelf (27,360 points)

Create a new passage and name it PassageReady, then place TwineScript something like the following within it

<<if $partone and $parttwo and $partthree and $partfour and $partfive and $partsix and $partseven and $parteight and $partnine and $partten and $parteleven>>\
	<<set $parttwelve to true>>\
<</if>>

.

commented Sep 9 by KittyEden (150 points)
it worked- thank you so much!
...