Help with stats!

Hiya, a pretty specific issue here,
In my choicscript game, I give players the option to choose how they did on their written exams, thus setting their “wit” stat prematurely, before they can choose the rest of them.

The issue is, if they chose “outstanding” as their wit stat (setting it %+20), it would allow them to choose another “outstanding” stat. Let me explain…
I have already created *selectable_if variables before choosing your stats that aren’t wit, so you can’t have “outstanding” strength, but when the time comes to choose your bad stats, you can still select strength. Didn’t want that, so I put some *selectable_if and *if commands.

So, now, I wanted to create some variables, possibly temp ones, that would make it so that if you chose “outstanding” wit in the first screen, the entire scene where you could choose another “outstanding” stat would not even appear…but I can’t do two *if commands, first of all, and second of all, the variables I created won’t even work (I tried to make a variable like “goodwit” and put *if before dialogue to make it so that it wouldn’t show up, but it just won’t do it.).

So, sorry for the stupidly long question, but it’s a tad crucial to the game. I can’t supply code ATM because my computer doesn’t have wifi, but if needed I will upload pictures later.

Thank you so so much,

Mhnn, could you copy your code maybe, so we can see how you tackled things so far?
There’s a couple of approaches to this (selectable if a stat is below X or if a counter is at Y), but it’s easier to help when we can see the code so far.

If I’m understanding this correctly, you’re saying that you want mutually exclusive options in a choice menu but Choicescript won’t let you have zero ‘fixed’ options in the menu. If so, there is a way around that. I used a variation of the following bit of code to deal with such an issue. The choice menu treats the @{} construct as a fixed menu item. You’d need to set a variable (called choose in the example) to whatever option the player chose, then it’ll provide a menu option that matches.

    #@{choose menu text for option 1 | menu text for option 2 | menu text for option 3}
        *if (choose = 1)
            *goto option1
        *elseif (choose = 2)
            *goto option2
            *goto option3

I think this is it! I will definitely test it out, woo!! Thanks so much for your time, I’ll let you know how it works out!

I’ve just now got a chance to test this, but I am quite new to choicescript…is it ok if you expand a bit more on this to make it just a bit easier to understand? I figured maybe inputting this code and playing it would help, but I’m still having a bit of trouble.
Thanks so much!

1 Like

They haven’t added the @{} construct to the help pages yet.

@{parameter string1 | string2 | string3}

Briefly, ‘parameter’ is a variable. If it’s set to 1, it prints string1, if set to 2 it prints string2, etc., based on the positions of the strings in the construct. The separators between the strings are vertical bars. The ‘parameter’ variable must be between 1 and the number of options following it (in other words, it doesn’t start with zero!).

In the bit of code I posted, you set the ‘choose’ variable to a value which matches whatever string you want printed as a menu option from that @{} construct (1-3 in the example) and the following if statements just go to a suitable label. So you’d create a label for each option in the @{} construct.

It’s just a fancy way of having mutually exclusive menu options since Choicescript doesn’t allow us to have every option potentially hidden by an IF statement.

Hope that’s a bit clearer :slight_smile: It’s tougher to explain than it is to use once you get your head around it.


The official announcement of that multireplace is here.

But in short, here’s how the code works

*rand var 1 3
@{var yo|hi|heh}

*set zz true
@{zz This variable is true, yo!|Nah, it's not set to true. False}

Way clearer now, though I’m definitely playing around with this before I implement it haha. Coding newbie here.
Thank you loads!!!

Thanks loads! The link will definitely come in handy : )