0 votes
by (750 points)
Okay. My project - I've been revamping it. I'm reducinlg it to 'rooms', and 'character paths' and essentially in the rooms, there is all sorts of content depending on 'where' you just visited. I've been using the hasVisited() to check whether you've been to a specific passage.

While merging my old project which has many 'unique' choices per character, I've sort of come to an impasse because my old project is like a general CYOA web? I think that's what they're called. And my Character Path Passages tend to be single choices leading from one to the next. And when I need to make multiple choices... I've been making empty Passages per choice, and inside each one, a <<goto "Specific Character Path Main choice">>

Outdoor Onsen (Name of the Passage - a Room). It has multiple if else depending on what you did just before getting in there. I create, let's say, three links, in that one, Grag Peek: Specific Action Choice. Then it creates 3 empty passages, which I put in <<goto "Outdoor Onsen I: Grag Peek">> for all of them. This creates the 'history' that I need to use the <<if hasVisited("Grag Peek: Specific Action") eq 1>>, and so forth for the 'choices' in the Outdoor Onsen I: Grag Peek Room Passage.

But the problem is. I feel like it's kinda wasteful since I keep creating almost empty passages with a single <<goto>> macro in it, and I wanted to figure out if there is a way to 'track what you picked without actually going to a passage, like tracking the 'choice' itself?

I am more than happy to clarify things if this is a bit confusing.

1 Answer

0 votes
by (68.6k points)
selected by
 
Best answer

I just want to say one word to you, just one word.  Variables.  Okay, two words really.  Story variables.

If you want to allow multiple choices which all lead to the same passage, then you should probably use a story variable, rather than abusing the story history as you are.  Checking the history is great when you want to know if the player has been to a specific passage under normal gameplay conditions, however, you should not be attempting to shoehorn every bit of state you can into the history.  That's not what it's there for and, as you've noticed, it's cumbersome and awkward.

Anyway.  In some cases you might want to use a separate variable for each choice at a decision gate, while in others you could simply use one for all choices.

For example, if Grag had a choice to peek on one of three ladies at the onsen (naughty, Grag) then you would only need one variable in the Outdoor Onsen passage:

/* Using <<link>> macros. */
<<link [[Specific Character Path Main choice]]>>
	<<set $onsenGragPeekedAt to "Hursag">>
<</link>>
<<link [[Specific Character Path Main choice]]>>
	<<set $onsenGragPeekedAt to "Zola">>
<</link>>
<<link [[Specific Character Path Main choice]]>>
	<<set $onsenGragPeekedAt to "Nimashet">>
<</link>>

/* Using setter links. */
[[Specific Character Path Main choice][$onsenGragPeekedAt to "Hursag"]]
[[Specific Character Path Main choice][$onsenGragPeekedAt to "Zola"]]
[[Specific Character Path Main choice][$onsenGragPeekedAt to "Nimashet"]]

And checking its value later:

/* Using <<if>> macro. */
<<if $onsenGragPeekedAt is "Hursag">>
	Peeked at Hursag content.
<<elseif $onsenGragPeekedAt is "Zola">>
	Peeked at Zola content.
<<elseif $onsenGragPeekedAt is "Nimashet">>
	Peeked at Nimashet content.
<</if>>

/* Using <<switch>> macro. */
<<switch $onsenGragPeekedAt>>
<<case "Hursag">>
	Peeked at Hursag content.
<<case "Zola">>
	Peeked at Zola content.
<<case "Nimashet">>
	Peeked at Nimashet content.
<</switch>>

 

by (750 points)
Thank you. I had the strongest feeling I was being inefficient/wasteful, and indeed, over-complicating things, but I couldn't figure out a way around the current method I had. Thank you!

You're a great asset to helping us all out, TheMadExile :)

I'm currently doing the setter link method which seems the least "Passage" waster :)
...