[VX Ace] Trouble with Hime choice options script

Discussion in 'RGSSx Script Support' started by S.Court, Nov 29, 2014.

  1. S.Court

    S.Court Veteran Veteran

    Messages:
    394
    Likes Received:
    97
    Location:
    Colombia
    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
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,437
    Likes Received:
    6,488
    Location:
    Germany
    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
     
    #2
    S.Court likes this.
  3. S.Court

    S.Court Veteran Veteran

    Messages:
    394
    Likes Received:
    97
    Location:
    Colombia
    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: Nov 30, 2014
    #3
  4. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,061
    Location:
    Toronto
    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: Nov 30, 2014
    #4
  5. S.Court

    S.Court Veteran Veteran

    Messages:
    394
    Likes Received:
    97
    Location:
    Colombia
    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
     
    #5
  6. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,061
    Location:
    Toronto
    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: Nov 30, 2014
    #6
  7. S.Court

    S.Court Veteran Veteran

    Messages:
    394
    Likes Received:
    97
    Location:
    Colombia
    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...

    [​IMG]

    Can you help me with this one, please? ^^
     
    #7
  8. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,061
    Location:
    Toronto
    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.
     
    #8
  9. S.Court

    S.Court Veteran Veteran

    Messages:
    394
    Likes Received:
    97
    Location:
    Colombia
    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

    [​IMG]
     
    #9
  10. Andar

    Andar Veteran Veteran

    Messages:
    28,437
    Likes Received:
    6,488
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    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...
     
    #10
  11. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,061
    Location:
    Toronto
    First Language:
    English
    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: Nov 30, 2014
    #11
  12. S.Court

    S.Court Veteran Veteran

    Messages:
    394
    Likes Received:
    97
    Location:
    Colombia
    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
     
    #12
  13. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,061
    Location:
    Toronto
    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?
     
    #13
    S.Court likes this.
  14. S.Court

    S.Court Veteran Veteran

    Messages:
    394
    Likes Received:
    97
    Location:
    Colombia
    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
     
    #14

Share This Page