*create class "dormouse"
*create class2 "march hare"
Are you the Mad Hatter? No? Well, perhaps you're the March Hare.
*fake_choice
#No, I'm the Dormouse.
*set class2 "dormouse"
#Yes, I'm the March Hare.
*if (class = class2)
*goto irrelevant
*if (class != class2)
*goto relevant
*label irrelevant
The classes are equal!
*goto end
*label relevant
The classes are unequal, I say!
*goto end
*label end
*ending
That works correctly. Have you tried putting a space between the f and the parenthesis? So instead of
*if(class = "Illusionist")
*choice
#Trap him in an illusion
*goto cultistfight
#Trap him in an illusion 2
*goto cultistfight
*else
*choice
*if(puppetLion)
#Have your puppet lion do whatever
*goto cultistfight
*elseif(puppetCobra)
#Have your puppet cobra do whatever
*goto cultistfight
*else
#Have your puppet rat do whatever
*goto cultistfight
*if(class != class2)
*if(class2 = "stealth")
*choice
#Strike at the cultist from the shadows
*goto cultistfight
So class and class2 can be the same, and if they are I don’t want the second bit showing up because It’d be redundant. I don’t want to put the first bit inside an if statement though because that’s a lot of text, though i guess i might have to?
@Eiwynn I just downloaded a fresh copy of ChoiceScript and tried stand-alone *if and it worked for me…
And don’t apologise! Always good when people try to help. I’ve suggested plenty of wrong solutions; the important thing is getting at the problem eventually. (:
@AnomanderRake Can you select your whole portion of game text, and then click on the button that looks like </> so it’ll preserve your spacing? That way it’d be easier to figure out what’s going on.
Edit: I noticed a few problems with indentation. After *if statements, *choice, and *else, you need to always indent by one level. Try this?
*if(class = "Illusionist")
*choice
#Trap him in an illusion
*goto cultistfight
#Trap him in an illusion 2
*goto cultistfight
*else
*choice
*if(puppetLion)
#Have your puppet lion do whatever
*goto cultistfight
*if(puppetCobra)
#Have your puppet cobra do whatever
*goto cultistfight
*if ((puppetLion = false) and (puppetCobra = false))
#Have your puppet rat do whatever
*goto cultistfight
*if(class != class2)
(what? there's nothing here)
*if(class2 = "stealth")
*choice
#Strike at the cultist from the shadows
*goto cultistfight
Or, is this meant to be one choice and you only see certain options? Then you only need one *choice command. I could do it up as an example that way if it’d be helpful.
*choice
*if(class = "Illusionist")
#Trap him in an illusion
*goto cultistfight
#Trap him in an illusion 2
*goto cultistfight
*elseif(class = "Puppetmaster")
*if(puppetLion)
#Have your puppet lion do whatever
*goto cultistfight
*elseif(puppetCobra)
#Have your puppet cobra do whatever
*goto cultistfight
*else
#Have your puppet rat do whatever
*goto cultistfight
*elseif(class != class2)
*if(class2 = "stealth")
#Strike at the cultist from the shadows
*goto cultistfight
Is that any better? I still doesn’t seem to work though
Right. A choice is one unit, so to make individual options appear or not appear you don’t need extra *choices; instead it’s done with *if statements (or selectable_if, should you want an option to show but be greyed out.) And each option needs to be given its conditions separately, if I recall correctly.
I’m sure this isn’t the only way to do it, but here’s one suggestion you could try, I think:
*choice
*if(class = "Illusionist")
#Trap him in an illusion
*goto cultistfight
*if(class = "Illusionist")
#Trap him in an illusion 2
*goto cultistfight
*if(puppetLion)
#Have your puppet lion do whatever
*goto cultistfight
*if(puppetCobra)
#Have your puppet cobra do whatever
*goto cultistfight
*if ((puppetLion = false) and (puppetCobra = false))
#Have your puppet rat do whatever
*goto cultistfight
*if ((class != class2) and (class2 = "stealth"))
#Strike at the cultist from the shadows
*goto cultistfight
Would that work?
Also, just a thought…in the current form, it seems like this choice, as is, will have a lot of players who only see one option (in which case, it’s not much of a choice, right?). It might be worth considering if a player will have at least two or three options available to them. If not, particularly if you’re planning on hiding additional options rather than greying them out, it might make more sense to redirect according to a player’s class instead of offering a one-option choice.
If it’s not working, you could potentially get around it by using a different *if choice for each option (Don’t know why my spaces aren’t working but you get the idea)
ie:
*if ((class != “stealth”) and (class2 = “stealth”))
*choice
#Strike at the cultist from the shadows
*goto cultistfight
Also, regarding *if / *elseif / *else: they aren’t meant for choices and options; they’re for redirecting. You’ll see them used in a series with *goto, like the example towards the end of this page of the ChoiceScript wiki.
*if, *elseif, and *else is meant for redirection according to a stat, or to allow a player to see only one of a variety of texts according to their stats.
So an example, with *if used in choices and *elseif used to show flavour text and then redirect to a *label would be:
*create character "dormouse"
Which seat do you take?
*choice
*if character = "dormouse"
#I take the dormouse's seat, of course!
*goto sweets
*if character = "march hare"
#I take the march hare's seat, of course!
*goto sweets
*if character = "mad hatter"
#I take the mad hatter's seat, of course!
*goto sweets
*label sweets
You are served with your favourite,
*if (character = "dormouse")
savoury cheese!
*goto theend
*elseif (character = "march hare")
carrot cake!
*goto theend
*else
hat-shaped biscuits!
*goto theend
*label theend
And in your example, it’d need to be *if and not *elseif because it’s used with an option.