- Joined
- Dec 18, 2013
- Messages
- 490
- Reaction score
- 659
- First Language
- French
- Primarily Uses
- N/A
Battle Formation 1.0
By Lecode
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
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 needto 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
"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:

