YanFly Battle AI CORE

● ARCHIVED · READ-ONLY
Started by jinrey 7 posts View original ↗
  1. Hi, i have problem with one script.
    Who can tell me why this script does not work?
    Where is problem?

    <AI Priority>
    User MP% param <= 40% +++ Highest Party MP > 45: SKILL 305, Highest Party MP%
    </AI Priority>
  2. I'm not sure what you're trying to acomplish, but the logic is complety wrong. You should read:
    http://yanfly.moe/2015/10/19/yep-16-battle-a-i-core/

    You could do:

    Code:
    <AI Priority>
    MP% param <= 40%: SKILL 305, Highest Party MP%
    </AI Priority>

    If you want check the user stat can use "user." and "+++" should be "&&" (AND). Also theres no "Highest Party MP" in the list of Yanfly conditions, that's used for targering so I'm sure it will work in conditions.

    I'm away from my PC to test it out and fix it, all I can do is explain a little. Sorry.
  3. What i want is:
    If MP user is smaller than 40% and if MP party player is higher than 45 points user can use skill 305 with a character who highest MP.

    Why is this complety wrong?
    I found the instruction in the plugin:
    Instruction
    ============================================================================

    Multiple Conditions

    ============================================================================



    As of the version 1.11 update, the Battle A.I. Core is now able to support

    multiple conditions. Setting up multiple conditions is relatively simple to

    do and still follows the 'condition: SKILL x, target' format.



    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



    To add multiple conditions, simply insert a +++ between each condition like

    the following examples:



    Switch 1 on +++ Switch 2 on: Fire, Lowest HP%

    Turn 3 > 1 +++ Variable 5 <= 100 +++ Switch 3 on: Ice, Lowest HP%

    Random 50% +++ Highest Party Level > 50: Thunder, Highest HP%



    In the above examples, all the conditions must be met in order for the

    selected skills to be considered for use.



    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



    For conditions that have strict targeting groups, the targeting group will

    end up becoming the combination of all of the strict targeting groups. For

    example:



    STATE === Blind +++ STATE === Fear: Dark, Lowest HP%



    In this example, the enemy will only use the 'Dark' skill on a target that

    is both affected by 'Blind' and 'Fear'. If there are multiple targets, then

    the target with the lowest HP% will become the target the enemy will cast

    the 'Dark' on.



    STATE !== Blind +++ ATK param >= 150: Darkness, Highest ATK



    In the above example, the enemy will use the 'Darkness' skill against any

    target that isn't blinded and has an ATK parameter of at least 150. If there

    are multiple targets, then the enemy will first cast 'Darkness' on the

    target with the highest ATK before casting it on a target with a lower ATK.

    and he uses "+++"
  4. @jinrey Looking through the instructions, +++ seems fine, but it looks like your syntax is a little off. The param format is only for the skill target and "Highest" is a keyword for determining the target, not the condition. With that in mind, try this out:
    Code:
    <AI Priority>
    EVAL user.mp <= 0.4 * user.mmp +++ MP param > 45: SKILL 305, Highest MP%
    </AI Priority>
    The conditions are checked against each possible target, based on the skill's scope. Only targets that meet the conditions are marked as valid. Then the actual target is selected from these valid targets according to the selection criterion (Highest MP% in this case).
  5. Thanks! it works for now. Previously, I had a very similar script but despite this, the opponent steals mana from his allies, despite the fact that the target (scope) could only be the enemy.
    Thanks again and I apologize for my english.

    Can you explain to me a bit clearer how each of the elements of this script works? Because, YanFly's instruction is too difficult for me to understand.
  6. Well, I can try!
    • First condition:
      Code:
      EVAL user.mp <= 0.4 * user.mmp
      "EVAL" tells the game that the condition is in JavaScript code. The code itself means "is the skill user's MP less than or equal to 40% of the skill user's max MP?" The eval is necessary because conditions default to checking the target, but we want to check the user.
      _
    • Second condition:
      Code:
      MP param > 45
      This is a "stat PARAM eval" condition. stat = MP, param is the keyword that tells the plugin what type of condition this is, and eval = "> 45". It will check if the target's MP parameter is more than 45.
      _
    • Skill specification:
      Code:
      : SKILL 305,
      You got this bit correct before, but I'll put it here anyway. Specifies which skill to use! ^_^
      _
    • Target priority:
      Code:
      Highest MP%
      This tells the plugin how to prioritise targets. "Highest MP%" is taken directly from the list of valid targetting types.
    Then in-game it goes like this:
    • Skill 305 targets enemies, so find all enemies that could be targetted.
    • Check the first target against both conditions. If it fails one or more conditions, remove it from the list of valid targets. Repeat this for the other targets.
    • Randomly order the list of targets, then search for the Highest MP% target, prioritising those nearer the top of the list.
    • Use the skill on that target!
    The tricky bit is that you need to work with the very specific wording of the plugin. (Incidentally, your English seems pretty good!)
  7. Thanks, I think I can deal with it now.
    (Google translate helps me a little;) )