[Dev] Scope Manager

So I have something called "Scope Manager" in development.

If you would like to try it out you can get it here

It's pretty much a complete plugin at this point, except it only supports one scope: targeting all battlers that are currently in battle.

CXK50p_UwAExJl-.jpg


What are some other scopes that you can think of that would be nice to have?

Note that this plugin is NOT intended support scope changing (eg: switch from one to all, or enemies to allies)

Format is subject to change at anytime.

For example, the current format is a simple

Code:
<scope: all-in-battle />
However, I may change it to something more hierarchical, like this
Code:
<scope: all, alive /><scope: all, dead, allies />
Still not sure whether I want to go that route.
3 random targert and the User c: 
3 random targert and the User c:
Those are the cases where I'm considering combining multiple scopes into one, rather than writing a bunch of separate cases


For example


- one enemy and one ally


- two enemies


- all enemies, and one ally
Certainly a random selection from among enemies or allies. All battlers, enemies or allies who meet a specific condition, like possessing a certain status effect or meeting certain parameter thresholds (like having 50 or greater Mat, or having less than half their MaxHp). Also, a single target from among those who meet that specific condition, as well as a random target from among those who meet that condition.

Being able to weight random scopes would be useful too; for example, a fire-elemental random hit skill that's more likely to hit enemies with a lower resistance to Fire attacks. There could also be a random hit scope that can only target any given enemy once; if an attack with that scope had three targets and there were only two valid targets on the field, the extra would be wasted. A similar scope would be a random target with the most even possible spread: If there are two targets and two enemies, it would target each enemy once. If there were three targets and two enemies, it would target each enemy at least once and a random enemy a second time.

Another possibility would be an attack with multiple targets that are each chosen like a 1 Enemy skill, such that, say, if I'm fighting a Bat and a Minotaur, I could choose to target the Bat and the Minotaur, or just target the Bat twice. Something like that would require two or more hit confirmations, one for each target.

I'm not seriously suggesting you implement all of these: This was mostly brainstorming, lol.
One thing I noticed was that during tests with yanfly's battle core, the "all battlers" skill executed one at a time.


This is because while the target logic was correct, I'm still missing the check for whether it's "for all?" or not.


I'm assuming yanfly uses this to determine how the animation should be processed.

Certainly a random selection from among enemies or allies. All battlers, enemies or allies who meet a specific condition, like possessing a certain status effect or meeting certain parameter thresholds (like having 50 or greater Mat, or having less than half their MaxHp). Also, a single target from among those who meet that specific condition, as well as a random target from among those who meet that condition.
Based on the first suggestion, there is the idea of having a "conditional" scope.


For example, your condition might be


- if the target has a state


- if the target's level that is a multiple of 5


- if the target has less than 50% HP


Those are all conditions that determine whether the action has any effect on the target.


For example, if you think of a "Level 5" skill which does something to anyone with a level that is a multiple of 5 (eg: 5, 10, 15, 20, ... ), there are a couple different ways to describe it.


You could say:

It is a skill that targets everyone whose level is a multiple of 5
Which means your target selection logic will only show the targets that qualify.
This is similar to the "is dead?" scope, which will only allow you to select dead allies.


On the other hand, you could say this:

It is a skill that targets everyone, but only affects those whose level is a multiple of 5
Which is quite different in logic.
This means that "everyone" will show up in the target selection, but during action resolution, only the ones that actually meet that requirement will proceed with the effect.

Being able to weight random scopes would be useful too; for example, a fire-elemental random hit skill that's more likely to hit enemies with a lower resistance to Fire attacks. There could also be a random hit scope that can only target any given enemy once; if an attack with that scope had three targets and there were only two valid targets on the field, the extra would be wasted. A similar scope would be a random target with the most even possible spread: If there are two targets and two enemies, it would target each enemy once. If there were three targets and two enemies, it would target each enemy at least once and a random enemy a second time.
Hmm, I wonder if it would be possible to allow users to define their own "weight" formula, and then the game uses it to determine which targets would be selected randomly.


This would be something interesting to explore, as it would give you an opportunity to learn to turn your requirements into code, without having to code everything.

Another possibility would be an attack with multiple targets that are each chosen like a 1 Enemy skill, such that, say, if I'm fighting a Bat and a Minotaur, I could choose to target the Bat and the Minotaur, or just target the Bat twice. Something like that would require two or more hit confirmations, one for each target.
Potentially with numbers, to show the order that they will be attacked.


If an enemy has been defeated previously, the attacks that were meant for that target will follow the default "smoothing" logic where it picks the next target over.


There was an idea on my patreon post that said you might choose which weapon to use for each attack.


So if you had a fire sword and ice sword, you would decide which weapon you'll use for each attack as well.


This can be an idea to explore further, once we have the 'numbered' attacks.

I'm not seriously suggesting you implement all of these: This was mostly brainstorming, lol.
All ideas are welcome.
Perhaps something like Bravely Default's Twilight or Exterminate, the former killing all foes afflicted by Sleep, and the latter targetting all poisoned foes.

Essentially, using states as a scope manager of sorts, like a target painter for a missile launcher or an artillery cannon or something.
Perhaps something like Bravely Default's Twilight or Exterminate, the former killing all foes afflicted by Sleep, and the latter targetting all poisoned foes.

Essentially, using states as a scope manager of sorts, like a target painter for a missile launcher or an artillery cannon or something.
I've updated my plugin to support this.

Here's my thoughts on how to implement such a skill

1. Use scope "Target all Enemies" - already provided

2. Provide a "scope condition" that requires some formula to be met.

So my scope manager would allow you to say something like

<scope condition> b.isStateAffected(10)</scope condition>Assuming 10 is your sleep state ID.Not as easy to use since you can't just say "state 10 applied" but it enables some new opportunities.

A new dev log is available for anyone that wishes to follow my development on this plugin.

Original thread: https://forums.rpgmakerweb.com/threads/dev-scope-manager.53736/