Yanfly Victory Aftermath and Mog Treasure Popup Battle Bug

Roult

Veteran
Veteran
Joined
Oct 25, 2015
Messages
44
Reaction score
4
Hi,


I use these 3 plugins:

- Yanfly Extra Enemy Drops, Victory Aftermath
-Mog Treasure Popup Battle

but there is an incompatibility.

The problem is that during the loot, I see the different objects (3 which can be the same or different), but during the result, I see only one object or 3 even .

In the item menu, they appear as they should.

Here's a video that shows the problem:


Can you help me?

Thanks
 

Marmit

La vie n'est qu'une toile vierge.
Veteran
Joined
May 1, 2020
Messages
32
Reaction score
2
First Language
English
Primarily Uses
RMMV
I'm not an expert but I believe the problem lies in that you're using plugins by different authours so they're interfering with each other. you might need to get ones that are all from the same authour.
 

Roult

Veteran
Veteran
Joined
Oct 25, 2015
Messages
44
Reaction score
4
yes that's why it's an incompatibility,
I will need a compatibility patch to fix this problem.

It is not possible to use only one plugin author with a large game.
 

Roult

Veteran
Veteran
Joined
Oct 25, 2015
Messages
44
Reaction score
4
The problem has been solved, many thanks to "Ahuramazda" for their help.

Code Changes - You need to edit 3 pieces of script yourself.

Main.js - this is to initialize droprates
Code:
//=============================================================================
// main.js
//=============================================================================

PluginManager.setup($plugins);

window.onload = function() {
    SceneManager.run(Scene_Boot);
    $droppeditems = [] // Added to initialize MOG/YEP VA Drops in an easy to find location.
};

MOG Item Drop plugin - Forced item drops into the above array one at a time for 100% accuracy

Code:
//==============================
// * Initialize
//==============================
SpriteEnemyTrP.prototype.gainDropItems = function() {
    var items = this._enemy._treasure.item;
    items.forEach(function(item) {
        $gameParty.gainItem(item, 1);
        $droppeditems.push(item) // Edit: Added to show exact number of drops.
    });
    console.log("From MOG: " + $droppeditems.length) // Edit: Added to show battle total in console.
};

YEP Victory Aftermath - Forces items from the array above in MOG script to be 100% accurate when dropped in Aftermath. Final line in the code that has // Edit is to reset the Array for the very next battle.


Code:
Window_VictoryDrop.prototype.extractDrops = function() {
    BattleManager._rewards.items = $droppeditems // Edit: Added to force match to MOG drops.
    console.log("YEP Total: " + BattleManager._rewards.items.length) // Edit: Added to show reward total in console. If same as "From MOG: " then is working as intended.
    BattleManager._rewards.items.forEach(function(item) {
      if (!item) return;
      if (DataManager.isItem(item)) this._dropItems.push(item.id);
      if (DataManager.isWeapon(item)) this._dropWeapons.push(item.id);
      if (DataManager.isArmor(item)) this._dropArmors.push(item.id);
    }, this);
    this._dropItems.sort(function(a, b){return a-b});
    this._dropWeapons.sort(function(a, b){return a-b});
    this._dropArmors.sort(function(a, b){return a-b});
    this._dropItems.forEach(function(id) {
      var item = $dataItems[id];
      if (item && !this._data.contains(item)) this._data.push(item);
    }, this);
    this._dropWeapons.forEach(function(id) {
      var item = $dataWeapons[id];
      if (item && !this._data.contains(item)) this._data.push(item);
    }, this);
    this._dropArmors.forEach(function(id) {
      var item = $dataArmors[id];
      if (item && !this._data.contains(item)) this._data.push(item);
    }, this);
    $droppeditems = [] // Edit: Added to reset after battle rewards shown.
};

this is a solution :)
 

41728280

Veteran
Veteran
Joined
May 31, 2020
Messages
240
Reaction score
73
First Language
Chinese
Primarily Uses
RMMV
Can you explain more clearly? Should I save these codes as plug-ins and load them, or add these codes to the codes of these three different plug-ins?
 

Roult

Veteran
Veteran
Joined
Oct 25, 2015
Messages
44
Reaction score
4
Hello,

I add these codes to the codes of these three different plug-ins. :)
 

41728280

Veteran
Veteran
Joined
May 31, 2020
Messages
240
Reaction score
73
First Language
Chinese
Primarily Uses
RMMV
Hello,

I add these codes to the codes of these three different plug-ins. :)
Thank you, the display is now correct!
:biggrin:
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

so... I decided since a park was an area in my game... here's an enemy that's slide with a hand behind it. cause why not.
Hot chocolate and music make studying and note-taking much easier :kaoluv:
Until my hand cramps up from writing too much!
Doing RPG Maker News for 21st September 2021


Malak is still waiting for Dark Deception Chapter 4... This was him yesterday after another sugar crash.
Again, he's fine. He's just bored at this point, considering he's exhausted his entire vacation bucket list.
Am I the only one who files custom resources under specific folders to remember who to credit? :kaoswt2:
1632263519730.png

Forum statistics

Threads
115,270
Messages
1,088,484
Members
149,875
Latest member
BlaireBear1
Top