Hello, I have a trouble, I'm using Himework's script called "Choice options" (http://himeworks.com/2013/03/choice-options) and I'm trying to disable an option, well this happens:
The condition is if variable 47 is equal to 0, so I made this condition
disable_choice(1,"$game_variables[47] == 0")
It doesn't work, the choice is still usable if variable 47 is equal to 0
BUT If I use the same condition for hide_choice command, it DOES work
hide_choice(1,"$game_variables[47] == 0")
The choice one is hidden if the variable is equal to 0, but it's not disabled if I use the same condition for the disable_choice command
Any idea about what could be happening? Thanks
[VX Ace] Trouble with Hime choice options script
● ARCHIVED · READ-ONLY
-
-
Look into the script description itself - in the website description, Hime made an error. Probably forgot how exactly the script works when she rewrote the tutorial.
------------------------------------------------------------------------------ ** Reference The following options are available Method: disable_choice Effect: disables choice if condition is not met Usage: Takes a string representing a boolean statement. For example, "$game_actors[1].level > 5" means that the condition will only be selectable if actor 1's level is greater than 5.You see that tiny "NOT" that I bolded?The script does exactly what it is intended to do - NOT disable when condition is met.
You need to negate your condition for it to work with that version of the script -
Ohhh, so that's how it works! Pretty interesting
So, If I make it like this:
disable_choice(1,"$game_variables[47] > 0") (not using negative numbers for this variable)
It should work, right? I'll test it in a couple of hours
Edit: Tested and still unsolved,
disable_choice(1, "$game_variables[47] > 0")
disable_choice(2, "$game_variables[51] > 0")
disable_choice(3, "$game_variables[55] > 0")
disable_choice(4, "$game_variables[59] > 0")
I made the script call exactly like this, and it doesn't work -
The expected behavior is that when the formula you provide is true, then the choice would be disabled.
This is intuitive, because you are specifying a condition that would disable the option.
I just tested it.
disable_choice(1, "true")This disables the first choice.It may have initially been the opposite (ie: when I first wrote the script), but I likely changed it at some point since it made no sense. I will update the script's description to reflect actual use
I also tested your condition.
disable_choice(1,"$game_variables[47] == 0")When var 47 is 0, choice 1 is disabled.When it is not 0, it is enabled. -
Hi Hime! Well, sorry, but I tried as you said and it's not disabling any option, even if the condition is true or false
-
Sounds like the issue is not related to the choice options script if "true" doesn't work.
Create a new project and see if it works. -
Ok, I detected the trouble, it was as simple as the order of the scripts I'm using ATB: Choice options script made by Modern Algebra (http://rmrk.net/index.php?topic=47593.0) I had to put it BEFORE your script, otherwise it won't work the disable function (but the hide option function works properly... Odd!)
Ok, I hope you don't mind but I still have a trouble: I need to disable two options of this way:
-Option 1 is disable if Variable 42 is equal to Variable 60 and if Variable 41 is equal to 0
-Option 2 is disable if Variables 47, 51, 55 and 59 are all equal to 0
Of course, I got the conditions
Option 1: v[42] == v[60] && v[41] == 0
Option 2: v[47] == 0 && v[51] == 0 && v[55] == 0 && v[59] == 0
But the conditions are too long to be taken by the script...

Can you help me with this one, please? ^^ -
Are those line breaks an issue? They're strings so they should be ok even if you split it on multiple lines.
-
Yeah, Hime, the line break makes the option doesn't work properly, in fact, the next mistake is showed

-
Why do you want to combine those two scripts?Ok, I detected the trouble, it was as simple as the order of the scripts I'm using ATB: Choice options script made by Modern Algebra (http://rmrk.net/index.php?topic=47593.0) I had to put it BEFORE your script, otherwise it won't work the disable function (but the hide option function works properly... Odd!)
Modern Algebra's Choice Option already has commands for disabling or hiding choices.
OK, those are all based on switches and aren't as comfortable as Tsukihime's conditions, but if the scripts clash too much it might be easier to write something that sets those switches according to the wanted conditions... -
If you have things like thisYeah, Hime, the line break makes the option doesn't work properly, in fact, the next mistake is showed
cond1 && cond2Make sure they look like this
Code:Instead of thiscond1 &&cond2
Code:The order of the line break matters. Operators need to go with the argument on the left.So this is OKcond1&& cond2
Code:"v[47] == 0 &&v[51] == 0 &&v[55] == 0 &&v[59] == 0" -
Ok, it works now, now I need to find a way the Modern Algebra Script and yours work properly together... Well, this or finding another script lets me arrange the option in columns without screwing the disable option (I put this script above yours, but now the column option is not working at all)
Ok, solved trouble, thanks for everything -
I might know why.
In the configuration there's something called "scroll choices"
Set it to false. Does it solve the problem? -
Yes, it does!
Ok, thanks a lot Hime... This post can be closed, the doubt is totally solved now