Conditional Branch Variable Checking problem

Discussion in 'RPG Maker VX Ace' started by Sepharius, Sep 2, 2016.

  1. Sepharius

    Sepharius Villager Member

    Messages:
    15
    Likes Received:
    1
    First Language:
    English
    I've created a skill that you learn from a book, and you keep reading the book to gain experience for the skill.


    For that, I have created a variable and linked it to one of my characters stats.


    E.g. Skill name = Hypnosis, variable name = Hypnosis, Magic attack changed to "Hypnosis".


    Now before I continue, I am not using scripting so forgive any typos but they don't matter because it's using common events.


    So when I read the book, I get the common event to do this;


    Control Variables: [0001: Hypnosis EXP] += Random No. (1...4)


    Change Parameters: [Player], MAT + Variable [0001: Hypnosis EXP]


    That works perfectly.


    My problem is a conditional branch that levels up the skill if you have enough experience. It's instantly failing despite me having enough EXP.


    Here's the script:


    Conditional Branch: Variable [0001: Hypnosis EXP] >= 10


     @> (Basically level up the skill)


     ELSE: (Fails)


    It's taking me directly to the fail despite Hypnosis EXP being 17, it's driving me nuts.


    Any suggestions?

    1.png

    2.png

    3.png

    4.png

    5.png
     
    Last edited by a moderator: Sep 2, 2016
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    27,525
    Likes Received:
    6,150
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    please give screenshots instead of typing the contents only - you're missing half the event properties in your description, including very important properties.


    that said, two possible problems come to mind immediatly:


    1) where do you update the variable 001?


    2) does some plugin use variable 001 as well? because plugins take precedence in such cases and you need to use another variable


    3) when exactly is that conditional branch checked? we need to see the whole events, that's why screenshots are better.
     
    #2
    Sepharius likes this.
  3. Sepharius

    Sepharius Villager Member

    Messages:
    15
    Likes Received:
    1
    First Language:
    English
    Added the pictures, sorry about that.
     
    #3
  4. Andar

    Andar Veteran Veteran

    Messages:
    27,525
    Likes Received:
    6,150
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    I think you mixed up your conditional branch levels somewhere.


    The first conditional branch is checking "hypnosis level 1".


    If that is false, the else branch checks for "hypnosis level 3"


    But I don't see any check for "hypnosis level 2", and I don't see where those switches are controlled.


    That is what I would check first, because if they're off then the common event can't work at all.


    Additionally, you have a problem with your editor. I strongly advice to make a backup of your project and deinstall the editor, delete the folder where it was installed, and completely reinstall it.


    Because if the trigger is set to none in a common event, the condition should be blank in the editor, simply because a conditional switch is only needed for autorun and parallel.


    That you have a switch visible there means that something is messing around with the editor, and that might have caused problems in your game as well
     
    #4
    Sepharius likes this.
  5. Sepharius

    Sepharius Villager Member

    Messages:
    15
    Likes Received:
    1
    First Language:
    English
    Oh man, that can't be good. 


    I should've never bought from Steam, thanks.


    As for the Hypnosis level switches, they're fine as I've tested them properly. 


    It's the variables that are the problem, it keeps saying "You failed the test" when I attempt them.


    Thanks for trying though.
     
    Last edited by a moderator: Sep 2, 2016
    #5
  6. Andar

    Andar Veteran Veteran

    Messages:
    27,525
    Likes Received:
    6,150
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    That is the steam version? There have been four or five people with such an error (conditions visible without being active) in about four years, and they all had the standalone so far. That by the way is why no one ever could pinpoint the source of the editor problem, it is too rare.


    But if you have the steam version, then this is most probably caused by a background program interfering, because much more people use the steam version than the standalone (myself included) and this is the first time I heard about such an effect on the steam editor. That is because the steam version has been regularly available at 85% off several times a year and in several humble bundles for as low as 10$, while the standalone on this site rarely got a sale...
     
    #6
    Sepharius likes this.
  7. Sepharius

    Sepharius Villager Member

    Messages:
    15
    Likes Received:
    1
    First Language:
    English
    Yep, I was a sucker. Same for MV...


    Btw I've identified the problem. 


    Change Parameters: [Player], MAT + Variable [0001: Hypnosis EXP]


    This, right here.


    Every time I do that, I thought it would add the randomly generated number.


    It added the whole total LOL.


    So if Hypnosis EXP was 11, MAT was 11 and it generated a random addition of 4 for Hypnosis EXP, then it would add 15 to 11 instead of 4.


    Seems like I'll need another variable to act as a set number.


    Just to make sense, here's the fix: 


    Control Variables: [0003:Gamble] = Random No. (1...2)


    Control Variables:[0001: Hypnosis EXP] += Variable: [0003:Gamble]


    Change Parameters: [Player], MAT + Variable [0003: Gamble]
     
    Last edited by a moderator: Sep 2, 2016
    #7

Share This Page