Conditional branch using 2 variables (Solved, nvm)

● ARCHIVED · READ-ONLY
Started by CrazyCrab 3 posts View original ↗
  1. Hi  everyone,

    I'm a bit stuck right now, as I need to set up a conditional branch that checks if variable X is bigger than (variable Y+variable Z) and I'm not sure how to do it. I'm guessing it needs to be a script call of some sort, but I really don't know how to structure it or anything.

    I'd be really thankful if someone could briefly explain to me how this can be done - perhaps there is a function like that and I'm just blind.

    Thanks!

    EDIT Never mind, figured it out...

    For those interested:

    it's Script (3rd page)...

    # Basic Conditional Branch
    if ($game_variables[Y]+$game_variables[Z]) < $game_variables[X]
    # do stuff
    else
    # do stuff
    end

    Thanks to http://forums.rpgmakerweb.com/index.php?/topic/25759-script-call-collection-for-vxace/
  2. That works perfectly fine assuming you get the syntax correct each time.  If you don't want to mess around with Ruby syntax, simply set a "holder variable" (let's call it Variable W) equal to Variable Y (using Control Variables), add Variable X to it (Control Variables), and finally compare Variable W to Variable X in a Conditional Branch.
  3. @Wavelength :

    That is interesting, but I'm curious about where Variable Z comes in?