Limit actors allowed in a yanfly row.

Hey there all. I have been having some trouble figuring this one out and it had been a while so I thought I would ask the community. So, my idea is to have a "Pet slot" This would be a fifth person in battle that can only be animal styled actors. I plan on using a row from yanflys rows plugin to be a pet only row.

The problem I have come across is that I want there to be only 1 pet allowed at a time. I was hoping I could limit the amount of actors allowed in a specific row to 1 but there doesn't appear to be any way to do that. It seems like there could be many possible ways to achieve this from my row limit idea to limiting the amount of a certain class or state allowed in battle but all the methods I have attempted have not had any, apparent to me, ways to make this work.

I'm hoping to get fresh eyes on the problem that may see something I am missing or have some ideas on how to make this work. My project uses rpg maker mv version 1.6.2 and I have all the yanfly plugins available if any others are needed. I look forward to hearing from the community on this one.

Big thanks for taking a look. Take care all.
So, I am working on a similar mechanic in my own game, and my buddy and I are working out a solution. (He is much more proficient in JS than I am.) The way we're looking at approaching it is a variation/extension of Yanfly's Party System that will either (A) restrict the slot to a particular class (in your case, "pet" could be a class) or (2) create a slot when you've summoned your pet, put that actor in the slot, then remove it after the battle or when KO'd. We're thinking that will work, in theory. Once we've tested it out, I'll be happy to share it!

Meanwhile, perhaps SRDude's SummonCore might get you a work-around. It hasn't really worked for me because it may be conflicting with some of my other plugins, but may you could give it a try and see if it works for you: http://sumrndm.site/summon-core/
@BlueBomber000 Srd's plugin is close but doesn't quite work for me either. I would love to give the plugin you guys are creating a try though. When it's ready of course. It sounds like what your creating would be just what I need. I really hope you guys get it working, can't wait. 🙂
Moved to: Javascript/Plugin Support
Though this was moved to the javascript/plugin forum if anyone has any ideas on how to make this work with eventing please share your thoughts. All my attempts to make this work were through big complicated events that almost worked and I still think there may be a way to make it work without plugins or scripts.

If @BlueBomber000 is able to complete the plugin he is working on that would be amazing but I can't put all my chips in that bag. In case it doesn't work I would still need to figure out a method of making this work

So if anyone has any ideas on how to event or possibly a script command the 1 pet idea I would still love to hear your thoughts.

@Kes sorry I posted this in an unpleasing area. I didn't realize I needed to focus on one small aspect of my request.
Really surprised nobody's figured this out after 5 years of people asking. Many of us would be eternally grateful if someone could figure out how to put a limit on the number of actors that can be in the same row.
sounds more like an issue needing an expansion on yanfly party system instead of row formation.
right now it can lock specific actors to be in the party.
but it sound like you just want party slot 5 to only be accessible to specific actors (pets). correct?

if you only have 4 human characters available at a time this would be easy, just lock those 4 to always be required in the party. if 1 leaves/joins party due to story event would just use plugin commands to change party size and locked actors.
this way the only party member you could change freely is the pet member.
<edit>
this can also be done locking the pet member if the pets are only changed through eventing.
or if ALL party member changes are done purely through eventing.
<\end edit>

issue would only occur if you have more then 4 human characters in the party roster and both humans and pets can change freely.
like if you have 10 humans and 20 pets.
this would require a new plugin that makes party member slot 1-4 only usable by actors 1-10.
while party member slot 5 can only be used by actors 11-30
Really surprised nobody's figured this out after 5 years of people asking. Many of us would be eternally grateful if someone could figure out how to put a limit on the number of actors that can be in the same row.

I was looking for a way to force a leader character to have at least 1 ally in the front row, when I came across this post. Luckily for you, I got it to work with a passive state that's going to help with your issue. Here's the code, which will not apply for your situation.
Spoiler: Passive that appears if nobody is in the front row
JavaScript:
<Custom Passive Condition>
var allies = $gameParty.battleMembers();
for(var i=0; i<allies.length; i++) {
  if(allies[i].row()===1) {
    condition = false;
  }
}
</Custom Passive Condition>

Now how do you make it work for your situation?
First of all, we need a variable that's going to store what you want to count. var count = 0;
Then, we need to check every ally in battle, and adapt to how many they are. We'll count, using the 5th line, how many are in row 2 (as specified in line 4).
JavaScript:
var count = 0;
var allies = $gameParty.battleMembers();
for(var i=0; i<allies.length; ++i) {
  if(allies[i].row()===2) {
    ++count;
  }
}
Now on to the condition. Let's say we want to apply a passive state to all allies if there's at least 3 allies in the row specified above. That's a number you can change in the 1st line.
JavaScript:
if (count>=3) {
  condition = true;
} else {
  condition = false;
}
Together now, in a passive condition. Put that in a state's notes:
JavaScript:
<Custom Passive Condition>
var count = 0;
var allies = $gameParty.battleMembers();
for(var i=0; i<allies.length; ++i) {
  if(allies[i].row()===2) {
    ++count;
  }
}
if(count>=3) {
  condition = true;
} else {
  condition = false;
}
</Custom Passive Condition>
Now get Auto Passive States (free). In the plugin settings, set the state as a passive for all actors (or absolutely everybody if enemies also have this restriction).
In the state's traits, seal any skill that would put the potential wearer in the row they shouldn't be able to occupy anymore.
Or just <Row Lock> before / after the passive condition tags if you don't want the state's wearer to move at all while the state is active.

@jglag , please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/limit-actors-allowed-in-a-yanfly-row.117005/