Conditional Branch: Check if a stat is high enough?

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

    In my current game the stats are supposed to be useful outside combat, with luck (Charm in my game) giving you additional conversational branches and attack (Power) letting you move heavy things, intimidate etc.

    The thing is that having planned all of this I didn't realize that there is no conditional branch like that, as in test actor 1's luck etc.

    Is there a way to do this without heavy scripting?

    Thanks! :)
  2. You don't need custom scripts in script editors although you'll need some "light" script codes if you use conditional branch to do that. For example:

    Conditional Branch: If (Script)"$game_actors[actor_id].luk > constant"

      Do something

    Else

      Do something else

    Branch end

    Conditional Branch: If (Script)"$game_actors[actor_id].atk > constant"

      Do something

    Else

      Do something else

    Branch end

    $game_actors[actor_id] is the game actor with id actor_id, luk is luck, atk is attack and constant is a number set by you.

    Errors may occur if that game actor isn't currently in the party though(and crashes will certainly occur if that actor never joined the party), so you may want to check for this first :)
  3. What DoubleX suggested is the quickest way to do it (and usually the way I do it).

    However, the easiest and safest way doesn't require any code at all.  Use the Control Variables event command to set a variable equal to Game Data: Jimmy's LUK (or other stat), then use that variable in a conditional branch.
  4. I am searching this to MV. I am trying to check if the actor 1 SPD is high than than the enemies party total SPD divided by the number of enemies and, or if is high than the all other enemies of allies. But i don't know the correct syntax. Some one can help?


    EX:


    If: (script) actor 1 spd > enemie party


     do


    else


     do


    Note: I know that i shoud ask this in the MV section. But i reads vx ace in the top to late. SORRY.
  5. @CaliburnAltais Please don't hijack other people's topic with your questions, but make your own topic for your own answer.


    Additionally, I suggest you don't use script commands, but use the control variable command to get and calculate the values.


    Also closing for necroposting