Battle Formation[Beta]

Discussion in 'JS Plugin Releases (RMMV)' started by Lecode, Nov 22, 2015.

  1. Lecode

    Lecode (─‿‿─) Veteran

    Messages:
    490
    Likes Received:
    646
    First Language:
    French
    Primarily Uses:
    N/A
    Battle Formation 1.0
    By Lecode

    Introduction
    This plugin adds the possibility to create battle formations with defined positions and bonuses.

    (Beta)

    I know that currently the plugin isn't fully compatible with Yanfly's ones.

    I plan to make a patch.

    Screenshot

    [​IMG]

    Files

    Plugin

    BattleFormations.json

    Dependencies

    MVCommons

    LeUtilities

    How to Use

    There are a lot of parameters so make sure to check them.

    And see the detailed help:

    Setup
    • Download the plugin and save it as LeBattleFormation.js
    • Place it via the plugin manager under MVCommons and LeUtilities
    • Get the file BattleFormations.json and place it in your project Data folder
    • Make sure to set the default formation via the parameters

    Create a formation
    The file BattleFormations.json purpose is to hold all created formations. So, to create a new formation you'll need

    to modify this file.

    Let's analyse the file with just one formation:

    [{ "name": "Equilibred", "unlock": "true", "hide": "false", "size": 5, "positions": [ [525,310], [565,350], [610,275], [635,310], [660,345] ], "bonus": [ ["def 10%"], ["def 10%"], ["atk 10%"], ["mat 10%"], ["mcr -20%"] ], "partyBonus": ["atk 6%","def 6%","mdf 6%"]}]The file starts with [ and ends with ]. The whole file is an array. Do not remove them.

    Creating a new formation consists of adding some code inside this array.

    That code follows a special pattern as you can see below.

    { "name": NAME OF THE FORMATION, "unlock": CONDITION TO UNLOCK BY DEFAULT, "hide": CONDITION TO HIDE BY DEFAULT, "size": MAX PARTY MEMBERS IN BATTLE FOR THAT FORMATION, "positions": [ [X1,Y1], [X2,Y1], ... [XN,YN] <= WITHOUT COMMA HERE (last element) ], "bonus": [ [BONUS_A1,BONUS_A2,BONUS_A3...], [BONUS_B1,BONUS_B2...], ... [BONUS_Z1,...] <= NO COMMA HERE (last element) ], "partyBonus": [BONUS_1,BONUS_2,BONUS_3...] <= NO COMMA HERE} <= NO COMMA IF IT'S THE LAST FORMATIONStrings for "unlock" and "hide" are evaluated and must return a boolean ( true or false ). You can set for example:

    "unlock": "$gameParty.members().length >= 2",to enable that formation only if there are 2 or more actors in the party.

    "positions" and "bonus" returns an array.

    In the case of "positions", this array must contains the coordinate of each member as an array ( [x,y] ).

    Make sure that the number of coordinates is equals to the "size" of that formation. Obviously.

    Same for "bonus". This array is also composed with arrays, which the number is equals to "size" value.

    See below to see how to configure the bonuses.

    I suggest you to examine the pre-made formations in the file to understand better the syntaxe.

    Setup Bonuses
    Each array inside the "bonus" array contains one or more strings. See this example:

    "bonus": [ ["mhp 15%"], <= BONUS FOR THE FIRST MEMBER ( +15% MAX HP) ["atk 20%","mat 20%"], <= BONUSES FOR THE SECOND MEMBER ( +20% ATK and 20% MAT ) ["def -15"], <= ... ( -15 flat DEF ) ["mmp 80"] <= ... ( +80 flat MAX MP )],The string pattern is: "key value" or "key value%".

    Keys are simply used stats in the Game_Battler class:

    mhp:     Max HP

    mmp:    Max MP

    atk:       Attack

    def:       Defense

    mat:      Magic attack power

    mdf:      Magic attack power

    agi:       Agility

    luk:       Luck

    hit:        Hit rate

    eva:      Evasion rate

    cri:        Critical rate

    cev:      Critical evasion rate

    mev:     Magic evasion rate

    mrf:       Magic reflection rate

    cnt:       Counter attack rate

    hrg:       HP regeneration rate

    mrg:      MP regeneration rate

    trg:       TP regeneration rate

    tgr:       Target rate ( I don't know exactly what is the purpose of that stat...)

    grd:      Guard effect rate

    rec:       Recovery effect rate

    pha:      Pharmacology ability

    mcr:      MP cost rate

    tcr:       TP charge rate

    pdr:      Received physical damage rate

    mdr:     Received magical damage rate

    fdr:       Received floor damage rate

    exr:       Experience rate
    Same process for "partyBonus".

    "partyBonus": ["atk 6%","def 6%","mdf 6%"]Finnaly, make sure to add a comma to the } thing if it's not the last formation.

    [{ "name": "Harmony", "unlock": "true", "hide": "false", "size": 4, "positions": [ [560,320], [630,275], [655,310], [680,345] ], "bonus": [ ["mhp 15%"], ["pdr 15%"], ["mdr 15%"], ["rec 15%"] ], "partyBonus": ["eva 10%"]}, <== COMMA{ "name": "Mentor & Apprentice", "unlock": "$gameParty.members().length >= 2", "hide": "false", "size": 2, "positions": [ [525,310], [635,310] ], "bonus": [ ["mhp 10%","pdr 400%","mdr 20%"], ["exr 100%"] ], "partyBonus": ["exr 20%"]} <=== NO COMMA]

    Credit and Thanks
    - Lecode

    Author's Notes
    I plan to add some features in the future, or maybe anothers plugins to give more sense to this,

    like an AOE Manager plugin.
     
    Last edited by a moderator: Nov 29, 2015
    #1
    RetroBoy, 99potions, Cvrtis and 15 others like this.
  2. Sera

    Sera Veteran Veteran

    Messages:
    80
    Likes Received:
    16
    First Language:
    English
    Three questions:

    1) Would there be any way to apply the default battle formation to the enemy party as well?

    2) Would there be any way to split the party into two 'rows', and make the battlers in the back row immune (not invincible but unselectable) to certain skills?

    3) Would there be any way to make the 'Formation' command compatible with Bobstah's Battle Commands plugin? I'd like to make it a command exclusive to battler #1, which is contained within the 'Fight/Escape' menu (which is bypassed in my game).
     
    Last edited by a moderator: Nov 22, 2015
    #2
    lukenukeas and Lecode like this.
  3. kranasAngel

    kranasAngel Wanderer Veteran

    Messages:
    122
    Likes Received:
    41
    First Language:
    English
    Primarily Uses:
    RMMV
    This is really cool
     
    #3
    Lecode likes this.
  4. gokuby

    gokuby Veteran Veteran

    Messages:
    96
    Likes Received:
    14
    First Language:
    German
    Primarily Uses:
    N/A
    Thanks soo much or that one!

    Will test it later extensively!
     
    #4
    Lecode likes this.
  5. Lionheart_84

    Lionheart_84 Veteran Veteran

    Messages:
    470
    Likes Received:
    42
    First Language:
    Italian
    Fine!!! thank you!!! I was expecting a lot from!!!

    A demo???
     
    Last edited by a moderator: Nov 22, 2015
    #5
    Lecode likes this.
  6. MaxLionheart

    MaxLionheart Veteran Veteran

    Messages:
    91
    Likes Received:
    28
    Location:
    Québec
    First Language:
    French
    Good job man! Very interesting plugin!
     
    #6
    Lecode likes this.
  7. Guardcraft Games

    Guardcraft Games Thoughtful Veteran

    Messages:
    36
    Likes Received:
    54
    Location:
    Dark Continent
    First Language:
    English
    Great plugin! Been waiting for this since you announced it!  BD  Keep up the good work!
     
    #7
    Lecode likes this.
  8. Ryuk

    Ryuk Veteran Veteran

    Messages:
    59
    Likes Received:
    12
    First Language:
    French
    Primarily Uses:
    RMMV
    Great Plugin ! It's possible to have symbol and main bind for Yanfly MenuManager?
     
    Last edited by a moderator: Nov 22, 2015
    #8
  9. Radis3D

    Radis3D Just a Devilz Veteran

    Messages:
    172
    Likes Received:
    33
    Location:
    Surabaya, East Java, Indonesia
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Lecode finally....

    finally you finish it.. *big hug*

    sankyu

    edit:

    may you or some one make a demo? :3
     
    Last edited by a moderator: Nov 22, 2015
    #9
  10. gekigengar

    gekigengar Villager Member

    Messages:
    23
    Likes Received:
    5
    First Language:
    English
    This is very amazing! though, I am having a few issues..

    Bug & feedback report :

    1. Pressing Formation, and cancelling the action will freeze the selection menu.

    2. Is not fully compatible with Yanfly's Battle Engine Core.

    3. How do I enable the battle formation Info bonus text? (It is not visible when I tested it.)

    4. Is there a way to change/review the default formation on a non-battle menu?
     
    Last edited by a moderator: Nov 22, 2015
    #10
  11. Ghost of Christmas Kloe

    Ghost of Christmas Kloe Ghost of a Princess Seagull Veteran

    Messages:
    1,504
    Likes Received:
    913
    Location:
    Somewhere...
    First Language:
    English
    Primarily Uses:
    N/A
    Cool but I would ask if there is a way to use it without MVCommons or LeUtilities since its rather alot of plugins to add to get one thing working.

    Also that it 

    which would be a rather big problem for lots of people.
     
    #11
    Lecode and Blue001 like this.
  12. Lecode

    Lecode (─‿‿─) Veteran

    Messages:
    490
    Likes Received:
    646
    First Language:
    French
    Primarily Uses:
    N/A
    No. You'll need to do that manually.

    Currently, no. You can't give immunity as bonuses. But you can use mdr and pdr.

    Don't know. I'll try.

    I don't know how this plugin works but I'll try.

    Why ? The JSON file contains all pre-made formations.

    You just need to download that file + the plugin and open the formation menu or test a battle.

    Seems like the first one is related to yanfly battle engine.

    I'll make a patch.

    There isn't any bonus text window in battle, for now.
     
    Last edited by a moderator: Nov 22, 2015
    #12
  13. Ryuk

    Ryuk Veteran Veteran

    Messages:
    59
    Likes Received:
    12
    First Language:
    French
    Primarily Uses:
    RMMV
    Thank you !
     
    #13
    Lecode likes this.
  14. ArkDG

    ArkDG Veteran Veteran

    Messages:
    143
    Likes Received:
    45
    First Language:
    portuguese
    Would you make a row system based on this?
     
    #14
    Lecode likes this.
  15. Lecode

    Lecode (─‿‿─) Veteran

    Messages:
    490
    Likes Received:
    646
    First Language:
    French
    Primarily Uses:
    N/A
    Probably, but certainly during the holidays, only. :/
     
    #15
    ArkDG likes this.
  16. Villhelm

    Villhelm Veteran Veteran

    Messages:
    53
    Likes Received:
    30
    First Language:
    English
    This looks excellent Lecode!

    One suggestion for a future update, would it be possible to add state IDs to the list of possible bonuses (specifically I'm trying to make Cover/Substitute a formation-specific mechanic).
     
    #16
    Lecode likes this.
  17. Ryuk

    Ryuk Veteran Veteran

    Messages:
    59
    Likes Received:
    12
    First Language:
    French
    Primarily Uses:
    RMMV
    My question was confuse, i wanted to know if you created a script line to call "Formation Menu" ^^ like This.commandFormation.bind(this)
     
    #17
  18. gekigengar

    gekigengar Villager Member

    Messages:
    23
    Likes Received:
    5
    First Language:
    English
    Another bug, ask character to attack, then cancel, then change formation.

    After changing formation, characters are supposed to skip a turn, but instead, the character that are asked to attack before will still launch their attacks.
     
    #18
    Lecode likes this.
  19. Lecode

    Lecode (─‿‿─) Veteran

    Messages:
    490
    Likes Received:
    646
    First Language:
    French
    Primarily Uses:
    N/A
    Changed the status of the plugin to Beta, the time to make a patch for yanfly's plugins and at least add

    more bonuses. (immunity, states, skills)
     
    #19
  20. Emmych

    Emmych forever rotting in the shamecube, floating eternal Veteran

    Messages:
    1,009
    Likes Received:
    209
    Location:
    VanIsland
    First Language:
    Anglais~
    Hey, this is neat!  Would you consider adding in things like unlocking certain skills/skill menus depending on what position you're in?  Like, someone in slot 1 could use the Magic command, someone in slot 2 could use Skills, etc.?
     
    #20

Share This Page