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
32,355
Reaction score
8,081
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,564
Reaction score
3,872
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,564
Reaction score
3,872
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...

10818937_967138049981815_2062135443_n.jpg


Can you help me with this one, please? ^^
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,872
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

10815721_967194259976194_1471554157_n.jpg
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,355
Reaction score
8,081
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,564
Reaction score
3,872
First Language
English
Yeah, Hime, the line break makes the option doesn't work properly, in fact, the next mistake is showed

10815721_967194259976194_1471554157_n.jpg
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,564
Reaction score
3,872
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
 

Latest Threads

Latest Posts

Latest Profile Posts

Dragonfly3116 wrote on Redweaver's profile.
i need to ask do you mind sending me a link to tutorial town an legend of ancients Please My new Email is necroboy1973@gmail.com
I Am A Member On The Site Here As Well If Your Still teaching Let Me Know Thanks Joseph
Added store elements.
44JtdpE5n4jQMFkSi7pACW.png

2uqvqT3uCWxcXAhlyZokxg.png

The next step will be to start making props (including distillers).
I just saw one of SigmaSuccor's RPG Maker news videos, it mentioned one of my plugins. Now I kind of wish I'd made a demo project for it, having nothing in that segment but a scroll down the code feels a little underwhelming given what the plugin COULD do. Except I suck at making demo stuff, and my testing project isn't fit for that. :(
Ok, to prepare for the GMTK Game Jam, I'm trying to make a game with the theme "The Cat's out of the Bag" in about 48 hours. I'd make a forum post with a question, but I don't have the time!
Worked over a week on a new BGM, and I'm finally happy with it.

Here are some screenshots of the area it will be used in
EzLHppdVIAMY7DP


EzLHpqsVIAEZ7jt

Forum statistics

Threads
110,516
Messages
1,053,886
Members
143,606
Latest member
peachdev
Top