Affection system for pairing up party members

So, there are plenty of tutorials out there for affection systems, but none I've found that do the specific things that I'm looking for. I can figure out at least some of what I have to do, but there are a few things that are stumping me. 

What I want is for party members to gain mutual affection depending on how often they battle together. So if I have eight characters total, and four that can participate in battle at any one time, the characters engaging in a particular battle would all have their affection towards each other increase at the end of that battle.

I know that I'd want a separate variable for each character pairing. What I can't figure out is how to check which characters were in a battle, and adjust the relevant variables accordingly.

I'd also like to have an equippable accessory that boosts affection gain for all pairings that include the character equipping the item.

I realize some of this is likely to be super basic stuff that I've just failed to figure out on my own, but could someone point me in the right direction?
Hey

The details of the solution depends on how you deal with your party. Do you have members in reserve? Or are all members who battle the full roster of members in your party at any given time? Either way the idea is similar.

Here is my suggestion:

1. Use Yanfly's Base Troop Event.

2. In the first Troop, set up a common event page (you can make one for each character even to make it less messy)

3. In this event you will basically set the condition to Turn 1 and the Span to Battle so it only happens once in battle.

4. Start with a condition that the character who will gain (Lets call him X) is in the battle party (or just party there are no reserves)

     - this can be done with a script call that checks battlers ID

5. Then on the next line do another condition checking for the first Actor (Let's call him Y)

6. Then on the next line do another conditional checking if X is equipped with or has learned a skill that increases affection boost

Here is a rough idea of what the logic would look like:

if X is in battle party if Y is in battle party if X is equipped with Affection Booster Variable XY += 2 else Variable XY += 1 end branch else end branch if Z is in battle party if X is equipped with Affection Booster Variable XZ += 2 else Variable XZ += 1 end branch else end branchend branchHope that helps!

~ Dinhbat

Original thread: https://forums.rpgmakerweb.com/threads/affection-system-for-pairing-up-party-members.25994/