[VX Ace] Trouble with Hime choice options script

● ARCHIVED · READ-ONLY
Started by S.Court 14 posts View original ↗
  1. 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
  2. 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
  3. 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
  4. 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.
  5. 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
  6. 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.
  7. 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? ^^
  8. Are those line breaks an issue? They're strings so they should be ok even if you split it on multiple lines.
  9. Yeah, Hime, the line break makes the option doesn't work properly, in fact, the next mistake is showed

    10815721_967194259976194_1471554157_n.jpg
  10. Piers said:
    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...
  11. Piers said:
    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"
  12. 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
  13. I might know why.


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


    Set it to false. Does it solve the problem?
  14. Yes, it does!

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