[VX Ace] Trouble with Hime choice options script

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
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
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,715
Reaction score
7,365
First Language
German
Primarily Uses
RMMV
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
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
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
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,555
Reaction score
3,808
First Language
English
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.
 
Last edited by a moderator:

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
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
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,555
Reaction score
3,808
First Language
English
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.
 
Last edited by a moderator:

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
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? ^^
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,555
Reaction score
3,808
First Language
English
Are those line breaks an issue? They're strings so they should be ok even if you split it on multiple lines.
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Yeah, Hime, the line break makes the option doesn't work properly, in fact, the next mistake is showed

 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,715
Reaction score
7,365
First Language
German
Primarily Uses
RMMV
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!)
Why do you want to combine those two scripts?


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...
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,555
Reaction score
3,808
First Language
English
Yeah, Hime, the line break makes the option doesn't work properly, in fact, the next mistake is showed

If you have things like this

cond1 && cond2Make sure they look like this

Code:
cond1 &&cond2
Instead of this

Code:
cond1&& cond2
The order of the line break matters. Operators need to go with the argument on the left.So this is OK

Code:
"v[47] == 0 &&v[51] == 0 &&v[55] == 0 &&v[59] == 0"
 
Last edited by a moderator:

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
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
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,555
Reaction score
3,808
First Language
English
I might know why.


In the configuration there's something called "scroll choices"


Set it to false. Does it solve the problem?
 

S.Court

Veteran
Veteran
Joined
Oct 17, 2012
Messages
394
Reaction score
98
First Language
Español
Primarily Uses
RMVXA
Yes, it does!

Ok, thanks a lot Hime... This post can be closed, the doubt is totally solved now
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I will be streaming RPG Maker demos very soon
Not. Enough. TIME.
Ami
--- Cheating ---

Hero: I can't Stand this! (Activate Infinite HP, Stats 999)
Game Police: Hold right there!
Hero: What happened,sir?
Game Police: You're under arrest because Using Cheat in the Game,illegally!
(Handcuffing the Hero)
Hero: Huh???
Game Police: You have the Punishment to Not be in this world: 6 Months
Hero
: (Shocking) WHAT???
Need advice that should be adjusted
Some local cursed and attacked me because I said children should learn copyright....

Forum statistics

Threads
103,131
Messages
997,496
Members
134,607
Latest member
Hade
Top