I want to display #options based on the previous two selections, eliminating what the player chose in those prior choices.
So on their stat screen they have for example, Wrangling, Hunting, Fighting, and Fishing, among others. The first question is what they spent most of their time on. The second is what they spent a little time learning. The last is what their flaw is or what they hated most.
I’m finding myself most comfortable with booleans so I use a lot of true/false in my script and can’t figure out how to say “if the first choice wasn’t wrangling, and the second choice wasn’t wrangling, then display this option”.
(primary_trait_wrangling = false & secondary_trait_wrangling = false)
doesn’t work and
(primary_trait_wrangling = false) & (secondary_trait_wrangling = false)
doesn’t work either. I’m not sure where else to put the ampersand or the parenthesis. I know I read it in the basic tutorial somewhere but flipping through now, I can’t find it.
Or if there’s an easier way then I’m welcome to that as well.
Thanks in advance
When I’m having issues I plug the code into [Tool] ChoiceScript Development Environment and then keep experimenting until I can get it to work.
Can you paste the whole code in?
You’re doing
*choice
*if (primary_trait_wrangling = false & secondary_trait_wrangling = false) #Text?
So for the first choice I have:
*label childhood_trait
Waiting for the egg to hatch was an exciting yet very boring thing. I wasn't watching you closely, then. What did you spend your free time doing?
*choice
#I went hunting with Pa; learned how to read the greenery and track deer and set traps. When he felt I was ready, he had me kill my first hare and taught me to skin it too.
*set Hunting +20
*set Toughness +5
*set primary_trait_hunting true
Deer and squirrel alike were no match for your quick wit.
*goto second_childhood_trait
and for the second choice its:
*label second_childhood_trait
Still, though, that couldn't fill an entire day. There had to have been something else?
*choice
*if (primary_trait_hunting = false) #Well, I also spent some time with Pa out hunting.
*set Hunting +10
*set secondary_trait_hunting true
It was nice to get out of Seja every once and a while, wasn't it?
*goto worst_trait_selection
And what I have so far for the third is:
*label worst_trait_selection
You were good at most things, as a general rule. You had a talent for learning and a very active mind, to boot.
But you're still a human, after all. You all have flaws. And if we're honest with one another...
*choice
*if (primary_trait_wrangling = false & secondary_trait_wrangling = false) #I never enjoyed hunting, no matter how much Pa wanted me to take after him. I'll eat the meat once it's cooked but doing the killing and cleaning...it's not for me.
and of course, that last example isn’t working.
Oh! It’s AND not & I think. Although let me check.
after swapping the & for AND, the error code is: “Invalid expression at char 33, expected no more tokens, found: VAR [AND]”
Try
*if ((primary_trait_wrangling = false) and (secondary_trait_wrangling = false)) #ChoiceText
Incidentally, if you’ve not checked out the wiki.
3 Likes
Perfect!
That’s the page I was thinking of; I was looking through the A Basic Tutorial and couldn’t find it there.
Thanks so much!
1 Like