- Nov 15, 2015
- Reaction score
- First Language
- Primarily Uses
Interesting! I was actually thinking about doing something similar (making actors corresponding to each enemy and just summoning them to the battle field in the enemy's place). Would there be a way to make the enemy regain its senses and return to the battle as an enemy though?Basically, I created 2 skills/states
Charm - Repaired charm function. On Player-Controlled Allies, it forces them into "AI" controlled, and swaps the enemy/ally arrays.
So what this means is according to the game system, The Enemy Units are the player's allies, and vice-versa. IIRC, this required alot of coding to make sure it worked.
I had to modify everything that said something along the lines of
var party = user.battler().isEnemy() ? this.enemyEntities() : this.allyEntities();
and replace it with
var party = TBSAiManager.prototype.getAlliesOf(user.battler(), true);
Npt to mention I had to replace the getAlliesOf and getEnemiesOf functions to determine the proper arrays.
As for "Brainwashing"
This was more complicated,
As it is, there was no way to "undo" the AIControlled on enemy entities, nor do they have a command array of sorts.
So the way it works is it clones the enemy entity, using a tag I created called [CloneID] which tells the system which ActorID the enemy should be cloned as. Then it completely erases the enemy entity, and drops in an Actor with the same exact Stats.
Obviously this causes issues unless you make sure to never use duplicates of the same enemy in battle.
On Allies, this functions exactly like "Charm" so there's no issue there.
I'm actually using 0.77 Base, not the 0.77.2 version, however, I did take some fixes from it, such as the fixed counter system, but thats when I discovered the issue.
In 0.77's base code for processCounterAttack()
It doesn't take into consideration the "Cursor"
Basically when an enemy hits you with an attack, the cursor is now placed on player character, and by default, the player is not in the array of enemies. What this means is the Character performing 'forceAction' is not allowed to perform a counter on their own cell.
But when I took the code from 0.77.2B, it seemed to have worked fine.
One thing to note, is that Counter's DO NOT apply to battle parties with more than the default 4
Since my game had 5 characters always, the 5th character would not counter,
So I wrote a plugin that raised the max battle party members to a user-defined number through the plugin manager.
At this point I have
Offensive Counters - Counters with an Offensive Skill
Defensive Counters - Counters with a Defensive Skill (Such as a barrier, retreat, etc)
Support Counters - Counters with a Support Skill (Such as Heal, Atk/Def up, etc)
Elemental Counters - Counters a specific Element - When done, this will allow countering certain attacks. (like counter a fire spell with Ice/water)
Physical Counters - Counters that 'counter" with a Physical attack
Magical Counters - Counters that 'counter" with a Magical attack
Also, Every character has a maximum number of counters that I modified the Yanfly Counter Control for, to have each character have a maximum counter number, which is reset each turn. I had to implement this CounterLimit when I realized units that can counter, will counter counter-attacks.