MV [SOLVED] Victor Engine - Toogle Target help with damage split

Hello, everyone!

I'm in need of some help with Victor's Toogle Target plugin.

When I was installing it, I noticed it had the option to split the damage between all the selected targets (you can switch between one target to all with a notetag in the item or skill).

This is mostly true, since it applies to battles perfectly. But it doesn't when you use the item or skill through the Items or Skills menus, and that can be an issue when using healing spells or items that can target all the allies.

I've made sure to use the proper notetags in the item and skills, that are the next ones:
Code:
<toggle scope>
<split damage>

The link to the original plugin is here (version 1.02):
VE - Toogle Targets plugin download

I was wondering how could I do to make the spells and items to split the damage as well when used through the Items or Skills menus. Victor doesn't seem to be so active anymore, so I can't ask him directly.

Any guesses on what could I do? Or if it is possible to add or edit the plugin so it works that way?

Thanks in advance!
Bumping this.
Bumping this again.
i havent tested it, but try running this as a plugin directly beneath victor's
Code:
Game_Action.prototype.applyGlobal = function() {
        VictorEngine.ToggleTargets.applyGlobal.call(this);
        this._splitDamageValue = $gameParty.inBattle() ? BattleManager._targets.length : SceneManager._scene.itemTargetActors().length;
    };
i havent tested it, but try running this as a plugin directly beneath victor's
Code:
Game_Action.prototype.applyGlobal = function() {
        VictorEngine.ToggleTargets.applyGlobal.call(this);
        this._splitDamageValue = $gameParty.inBattle() ? BattleManager._targets.length : SceneManager._scene.itemTargetActors().length;
    };

Thank you for sharing this plugin.

However, after applying it beneath Victor's plugin, it doesn't seem to work at all, and the heal is still the same without being devided with the characters selected. I only have installed the Basic Module, Toogle Target, and your patch plugins in an empty project.
didnt notice it was in an IIFE. just to be sure, go to line 281 and change it from
Code:
this._splitDamageValue = $gameParty.inBattle() ? BattleManager._targets.length : 1;
to
Code:
this._splitDamageValue = $gameParty.inBattle() ? BattleManager._targets.length : SceneManager._scene.itemTargetActors().length;
if it doesnt work ill look into it when i get home


Edit: actually, i can see it now
try this as the patch instead
Code:
    Game_Action.prototype.makeDamageValue = function(target, critical) {
        this._splitDamageValue = $gameParty.inBattle() ? BattleManager._targets.length : SceneManager._scene.itemTargetActors().length;
        var value = VictorEngine.ToggleTargets.makeDamageValue.call(this, target, critical);
        if (this._splitDamageValue > 1) value *= this.makeAllDamageValue();
        if (this.item().splitDamage)    value /= this._splitDamageValue || 1;
        return Math.round(value);
    };
didnt notice it was in an IIFE. just to be sure, go to line 281 and change it from
Code:
this._splitDamageValue = $gameParty.inBattle() ? BattleManager._targets.length : 1;
to
Code:
this._splitDamageValue = $gameParty.inBattle() ? BattleManager._targets.length : SceneManager._scene.itemTargetActors().length;
if it doesnt work ill look into it when i get home

Tried replacing the default line in the Line 281 with yours, but unfortunatelly, still no luck with the Heal being split between the four actors in the party in the menu.

I shall await your news as soon as you have time to look into it closely.

Thank you very much for your help in advance!
Tried replacing the default line in the Line 281 with yours, but unfortunatelly, still no luck with the Heal being split between the four actors in the party in the menu.

I shall await your news as soon as you have time to look into it closely.

Thank you very much for your help in advance!
yeah, i had JUST edited that message 🤣
let me know how above works and if it doesnt ill look at it in the evening
yeah, i had JUST edited that message 🤣
let me know how above works and if it doesnt ill look at it in the evening

Thank you very much! It works now, and the damage is truly spilt between the four characters of the party in the menu!

Since I'm gonna use this plugin alone with Yanfly's Target Core and Selection Control (that already have formulas to split the damage in the battle alone), I'm making some changes in VE's plugin to avoid any conflicts (aka, removing all the references to the battle scene, which, so far, has worked).

If it is not much to ask, is there something on your patch that I should keep in mind to edit / remove that references the battle scene?
i dont think anything in the patch would need to change, but i cant say much about compatibility between the yanfly plugins and victor's in general. there quite a bit of overlap and im not sure if everything would work properly together. be sure to test out the basic features
i dont think anything in the patch would need to change, but i cant say much about compatibility between the yanfly plugins and victor's in general. there quite a bit of overlap and im not sure if everything would work properly together. be sure to test out the basic features

Thanks for the answer, I'm looking into it, and I think I got it working.

But sorry to bother you again, because when testing the default plugin (without modifications on a test project) with your patch, I noticed something weird going on with how the damage or heal is split.

I have the Heal spell set to restore exactly 200 HP between the 4 characters in the party when selecting them all.

However, when I select all the party members, and heal them, the spell only restores 25 HP to each one. Call me crazy, but I don't think that is the correct math for the damage or heal split. ^_^U

Shouldn't it be like 50 HP points for each character in a party of 4 allies?

I was trying fo figure out if there was something wrong with the parameters on the patch, but I do not know enough coding to see if there's something amiss.
I was trying fo figure out if there was something wrong with the parameters on the patch
what are the parameters set to? the default parameter that sets the "all damage rate" or whatever it was called is 50%, which would result in 25 instead of 50
what are the parameters set to? the default parameter that sets the "all damage rate" or whatever it was called is 50%, which would result in 25 instead of 50

Ah! Okay, got it! I had that parameter in the plugin as 50%, instead of 100%.

That did the trick. Thank you very much!

Original thread: https://forums.rpgmakerweb.com/threads/solved-victor-engine-toogle-target-help-with-damage-split.179841/