Skill Restrictions for inactive party members

Hello. I have several skills in my game that are usable outside of battle for healing, but these skills can be used by party members even if they are not in the active battle party. Obviously, this presents a problem because you can have inactive members provide healing even though they are not fighting.

I use Yanfly's Skill Core plugin to solve this problem partially. By using a Custom Requirement notetag on a skill, I can make the skill unusable if the party member is not in the active battle party with $gameActors.actor(x).isBattleMember() to check if actor x is in the active party.

However, I have a handful of skills that can be used by two different party members. Using the note tag will not work because the skill should be usable if either of the party members are in the active party but this means that the other person who has this skill can use it, even if they are not in the active party.

For instance, "Cure" can be used by actors 3 and 5. I can restrict Cure so that it is only usable if actor 3 is in the active party, but this means that actor 5 cannot use it even if she is in the party. I could restrict Cure so that either actor 3 or actor 5 must be in the active party, but now if actor 3 is in the party, actor 5 can use Cure even if not in the active party.

I was wondering if there was a way to restrict skills using a note tag like this for actors or classes. Or is there another possible solution someone might have?
what do you have your reserve members for?

The entire engine is intentionally structured that way because it assumes that the reserve members accompany you through the world and thereby are always able to use their skills on the map.
Changing that is not always easy (as you've found out for yourself), but there are ways around this.
However we need to know what you want the player to be able to do with the reserve members - only with that info we can determine how best to restrict or allow what.
what do you have your reserve members for?

I use Yanfly's Party System to manage the party. There are 8 playable characters in my game but you can only use 4 at a time: the option to change the party formation is disabled, so the player cannot change party members whenever they want, only at specific times. With Yanfly's Party Manager, the reserve party members must be in the party in order for them to appear in the party screen.

I suppose a possible workaround would be this: whenever the player has an opportunity to change party members, the event runs normally and opens the party screen, allowing the player to choose which of the 8 characters they want. Once the screen closes, the event would then run a check for each party member to see if they are in the active party; if not, they are removed from the party completely. Then, when the player has an opportunity to change the party again, the event that opens the party screen will start by running a check for each party member to see if they are in the party; the ones not in the party are added so that they appear in the party screen. The event should also remove all equipment from outgoing party members as well.

I can make the workaround outlined above work but it would just require a lot of changes to existing events. I'd like to find a simpler and more elegant solution before resorting to that, though.

Edit: Changed my post a bit at the beginning so that I actually answered your question.
I think instead of defining a specific actor in your notetag, you can use user instead so that it checks whoever uses the skill.

Code:
user.isBattleMember()

Not sure if it will work on your case but for Yanfly's plugins, user is usually usable.
Changed my post a bit at the beginning so that I actually answered your question.
no, it didn't answer my question - unless you want to tell me that you use the reserve members for nothing.

If that is the case, then I would suggest to completely remove yanfly's party manager and completely remove the reserve members from the party, replacing both the formation screen and the party manager screen with a specific party map.

One example on how to solve this:
1) you create an item "tent" that calls a common event "tent".
2) the common event stores current position and map, switches off followers and then transfers the player to a camp-map.
3) on the camp map, you have one event for every possible party member - with a switch controlling if that party member has been found yet or not. Talking to that event will give you the option to add or remove the corresponding actor to or from the party.
4) additionally there needs to be an exit event that checks the size of the party - it refuses to let you leave if you have too many actors in your party (more than battlemembers). if your party is small enough you get transfered back to the stored position where you used the tent item.

No need to carry reserve members around if you don't want the player to use their skills.
I think instead of defining a specific actor in your notetag, you can use user instead so that it checks whoever uses the skill.

Code:
user.isBattleMember()

Not sure if it will work on your case but for Yanfly's plugins, user is usually usable.

Yes, this works perfectly. Thanks!

no, it didn't answer my question - unless you want to tell me that you use the reserve members for nothing.

If that is the case, then I would suggest to completely remove yanfly's party manager and completely remove the reserve members from the party, replacing both the formation screen and the party manager screen with a specific party map.

One example on how to solve this:
1) you create an item "tent" that calls a common event "tent".
2) the common event stores current position and map, switches off followers and then transfers the player to a camp-map.
3) on the camp map, you have one event for every possible party member - with a switch controlling if that party member has been found yet or not. Talking to that event will give you the option to add or remove the corresponding actor to or from the party.
4) additionally there needs to be an exit event that checks the size of the party - it refuses to let you leave if you have too many actors in your party (more than battlemembers). if your party is small enough you get transfered back to the stored position where you used the tent item.

No need to carry reserve members around if you don't want the player to use their skills.

This is originally what I was doing, then when I saw Yanfly's Party Manager, I thought it was a simpler and easier way to accomplish the same effect without all the eventing. The only that stuck out to me was of course, that all the characters had to be in the party in order for them to appear in the party change screen. This didn't seem to be an issue for quite some time... until I realized the inactive party members could still use their skills. However, both this method and using a note tag to restrict the skill for inactive party members works. Thank you for the replies.

Original thread: https://forums.rpgmakerweb.com/threads/skill-restrictions-for-inactive-party-members.110042/