Conditional Choices [ACE]

Ice444

Villager
Member
Joined
Sep 10, 2015
Messages
5
Reaction score
1
First Language
English
Primarily Uses
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)
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
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.
 

Ice444

Villager
Member
Joined
Sep 10, 2015
Messages
5
Reaction score
1
First Language
English
Primarily Uses
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.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,546
Members
137,835
Latest member
yetisteven
Top