[release]Battle AI Core TGR extension

Discussion in 'JS Plugin Releases (RMMV)' started by ramza, Jul 11, 2016.

  1. ramza

    ramza Lunatic Coder Veteran

    Messages:
    481
    Likes Received:
    252
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    Hey all. I just made a quick and dirty little script to add TGR as a valid param for Yanfly's BattleAICore.


    What it does:

    • Allows the option of using TGR to determine a target, when using the param option.
    • Enemies using this param will target the actor with the TGR that matches the param check. (highest or lowest)
    • I'm not sure if enemies have a TGR rate, so if it's used to determine an ally, it might not work



    How to use it:

    • When you are setting a target for an action in the AI, use either highest or lowest, and TGR (as if you were doing HP or MP, or another parameter).

    Example:


    TGR.PNG


    In the above example, if the random check doesn't pass, it will always attack the target with the lowest TGR.


    What is TGR, and why do I care?

    • TGR is RMMV's built in 'threat' system. A higher value makes you more likely to be targeted by the default AI.
    • Without an ability to take TGR into account, the only way to use it is to have the enemy randomly attack through the AI plugin.
    • This addon allows you to get it to function more like it was originally intended. You can set 'dumb' enemies to target your high TGR tank, while smarter enemies may target lowest TGR support characters. Attacks that don't specify a target will, by default use TGR to determine the target, as the default AI would in the same situation.



    Terms of use:

    • Abide by the terms of yanfly's plugins.



    View attachment YEP_X_BattleAITGRAddon.js
     
    Last edited by a moderator: Jul 11, 2016
    #1
  2. kovak

    kovak Bloodmancer Veteran

    Messages:
    1,239
    Likes Received:
    1,538
    Location:
    I'm from the Hu3
    First Language:
    PT - EN
    Primarily Uses:
    RMMV
    So this is a kind of Enmity like system, right?
     


    But now i have those questions:

    How can i ncrease TGR during combat?
    Will it reset at the end of combat?
    If not, how do i clear it up?
     
    Last edited by a moderator: Jul 14, 2016
    #2
  3. ramza

    ramza Lunatic Coder Veteran

    Messages:
    481
    Likes Received:
    252
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    This is a very basic enmity system. Enemies will still act randomly, so there will be occasions where they don't attack the highest TGR actor, using the default AI, anyway. But using this add-on, you can set them to always attack the highest TGR actor as a default, so it could be used pretty well for a tank/threat/enmity system.


    TGR is an SP-Parameter that all actors have a default value of 1 (or 100%). Traits on classes or actors can increase or decreases this value by multiplying it's base value by a percentage. If the trait gives TGR + 150% the value will be 1.5 or 150% for example. States can also modify this, and you can use it with yanfly's autopassive states plugin to set passive abilities that increase TGR on the actor who knows them, or you can make custom states that increase the value over time.


    Depending on how long these states last, the effect could also be removed after battle, of course.


    You can also make use of something like action sequences, to possibly add TGR rate to an actor after an attack, or add states that do that. There's a lot you can do with TGR that hasn't really been touched before, as far as I can tell.
     
    #3
  4. kovak

    kovak Bloodmancer Veteran

    Messages:
    1,239
    Likes Received:
    1,538
    Location:
    I'm from the Hu3
    First Language:
    PT - EN
    Primarily Uses:
    RMMV
    It would be good if you add this in the help section of your plugin and a basic formula of how to make skill add TGR cuz i'm still figuring out how to do it :<

    I think many people will feel lost too since they may not have a good experience with formulas.


    I know i can use a.gaintgr for this, but dunno if i can reset it at the end of battle :v
     
    Last edited by a moderator: Jul 15, 2016
    #4
  5. ramza

    ramza Lunatic Coder Veteran

    Messages:
    481
    Likes Received:
    252
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    You already know more about using it than I do. All I really knew about it was that I was using it for a passive state on my tank classed actors to make enemies more likely to hit them. When I started using yanfly's AI plugin, that stopped happening, so I made made this add-on to give me back that functionality. Any other uses for it are something to developer will have to come up with themselves.
     
    #5
  6. kovak

    kovak Bloodmancer Veteran

    Messages:
    1,239
    Likes Received:
    1,538
    Location:
    I'm from the Hu3
    First Language:
    PT - EN
    Primarily Uses:
    RMMV
    I was checking some plugins here and i've found that TGR is related to TP Regen


    TGR.jpg
     
    #6
  7. whoami

    whoami Villager Member

    Messages:
    13
    Likes Received:
    5
    Thanks for the plugin, ramza. I didn't realize I needed this, but now it seems really useful!


    @kovak You may want to read the "How To Set Traits" section of the MV manual. You can create a state that raises TGR (Target Rate), and have a skill that inflicts that state in battle. Hit F1 when running MV to access the manual.


    TGR (TarGet Rate) is different from TRG (Tp ReGen). You've already found Yanfly's excellent documentation on ex-parameters , but you might also want to read Yanfly's explanation of sp-parameters.
     
    #7
    kovak likes this.
  8. kovak

    kovak Bloodmancer Veteran

    Messages:
    1,239
    Likes Received:
    1,538
    Location:
    I'm from the Hu3
    First Language:
    PT - EN
    Primarily Uses:
    RMMV
    It's confusing D:


    TGR, TRG...looking for the help file didn't helped me at all :v

    I've made a state, but i can't make it stack lel

     
     
    Last edited by a moderator: Jul 15, 2016
    #8

Share This Page