Any way to scramble options in a choice?

Hi, I’m working on a combat engine that gives the player the opportunity to use attacks if they have learned them and if the attack is open at the time. (Stronger attacks pop up less often). Most attacks are simple damaging attacks, with no extra effects, though we are working on this. Because of this, all the player needs to do is choose the bottom-most attack above wait, unless they see Audacity, Imitate, Step back, or First Aid. What we need is a way to scramble all options but wait. Thanks for helping us out!

1 Like

Yes, there’s a few ways you could do this, but do you really need to? Isn’t the player going to see the different option and choose it anyway? The ways I can think of are all overly complicated, involving the random command and a lot of if statements.

Personally I’d look for a way to just work around your current problem. Is it actually a bad thing that they know what option is the best? Especially if it’s only showing up when they’ve learned it and even then not always? Won’t they recognise it’s different anyway. I think you may be overthinking things.

First, let me begin with it generally being a very bad idea. If your players are making the same choice again and again, and have to recheck that they’re selecting the one they want every time, or misclicking because it’s badly ordered (and if it’s unclear what the choices do, that’s bad), it’s just going to get them to dislike your game and quit. And it still doesn’t fix the problem, because there’s still one choice that is objectively better, it just becomes a matter of memorizing which one that is, rather than having it obviously displayed.

It would be much better to look at the game design itself, and differentiate the attacks so that they have actual affects, having just one basic attack option that determines the damage. (If you really want to alter the #choices, you can just have it display the best one available with a single #choice, displaying a ${variable}.)

Now if you’re still intent on doing it, we run into the technical problem. ChoiceScript will always display the choices in the order they are, so you’re going to have to duplicate #choices with identical *gotos and have it select one based on a random number. For example, lets say we have #Attack and #Run, and want it to randomly pick which shows up first. If we use something like this:

*create attack_choice_above_or_below_run
*rand attack_choice_above_or_below_run 1 2
  *if (attack_choice_above_or_below_run = 1) #Attack
  *if (attack_choice_above_or_below_run = 2) #Attack

Also, I think to get it to be truly random, each new choice increases the required numbers of #choices exponentially (the next one would have to be put above and below each #Attack).


I think Godfeather is probably right. Thanks you guys for helping us out! I
think you’re also right Reaperora. I’ll just leave it the way it is.