Conditional Choices [ACE]

I am having a script issue, I believe this is the place to post questions like this:


I am using Fomar0153's More Choices script. It is simple and easy to understand and edit. My goal is to make a conditional choice dialogue such as 


Choices:


    Do nothing


    Break Door if variable > x


    Pick Lock if variable == y


    Knock on the door


Fomar0153's script is adequate to do this (which I am thankful for) but because each choice is added onto a stack via pushing if a condition is met the choice is never pushed onto the stack.


$game_message.choices.push("Choice_1")
$game_message.choices.push("Choice_2") if $game_switches[1]
$game_message.choices.push("Choice_3")
$game_message.choices.push("Choice_4")
$game_message.choices.push("Choice_5")


Choice 2 is only added to the stack if $game_switches[1] is true. HOWEVER if it is NOT added to the stack, Choice 3 BECOMES Choice 2 (because it is the 2nd choice in the stack). When using index (or the option the player chooses) in a conditional branch after the choice dialogue all the options slide based on what was added (or not added) to the stack.


My Question is: How do I have conditional choices without having the stack slide like this? Is there some way someone could show me? I thought if I had another variable set to how many choices were given and then compared to how many choices were removed via the conditions I could find a value that could still be used for conditional branches, but sadly I could not figure this out.


I know it is popular to suggest "use this mega script that does all these awesome things" but honestly I prefer the simplicity of this script. If it is possible, I would like to continue using this script or something similar without needing to adopt a bigger and more complicated script. 


Thank you very much for your help.


(edit, linked to script pastebin)
you might want to check out Tsukihime's scripts, she wrote a script for choice options and conditions and you might want to use that as an example to see how it could be done.
Thank you for the reply Andar. 


I will try to learn what I can from Tsukihime's Choice Options, but is there anyone that would be willing to explain what I need to do or help fill the gap of what I am using compared to what Tsukihime's script achieves? I do not intend to re-invent the wheel but I would like to learn from what I vaguely already understand. 


The problem is that I don't seem to be able to understand Tsukihime's code very well. Even though this script is relatively simple in comparison to some of their ambitious ones. 


I had planned on this project I started to be a learning exercise and because of that I would like to have a basic understanding of what is happening. Hopefully I do not appear ungrateful for your help. I just wanted to clarify my end-goal a little more.
You approach the issue from the wrong side.


Instead of checking it's index, you should check it's name (that is always unique, right?).


So, where that variable is set in the script, you should add this line (above the alias method call):


$game_variables[ID] = $game_message.choices[index]


Replace the ID with the ID of the variable you want to store the answer.


Now, after a choice selection, you can check for the string you enter for your choices.


So, instead of checking for a number, you will check for a text.


Using the little example you have shown in your opening post, you can enter this in a conditional branch using the "Script" option:


$game_variables[ID] == "Choice_1" # True if player selects "Choice_1"
$game_variables[ID] == "Choice_2" # True if player selects "Choice_2"
$game_variables[ID] == "Choice_3" # True if player selects "Choice_3"
$game_variables[ID] == "Choice_4" # True if player selects "Choice_4"
$game_variables[ID] == "Choice_5" # True if player selects "Choice_5"


Again, replace the ID with your variable ID you used above.


With this, you should be able to check for the correct choices without any issues.

Original thread: https://forums.rpgmakerweb.com/threads/conditional-choices-ace.69216/