RMMV HELP! Is there a way I can force a DROP on a battle?

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
265
Reaction score
43
First Language
English Spanish
Primarily Uses
RMMV
I have a mini game on my game that one of the rewards might be extra drops. Right now, I have a custom message that says that some items have been gained and then I add those items. But, what i want to do, is that those items appear in the drop list in the victory aftermath. So is there a way I can force those drops to appear in that section?

THNX!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,134
Reaction score
618
First Language
English
Primarily Uses
RMMV
Someone else might have a recommendation that's free; the only plugin I'm familiar with that would make the items appear as normal loot does in the aftermath, is Yanfly's Extra Enemy Drops.

There are conditional notetags you can use to add items if a certain condition is met during the battle (such as they succeed in the game and you set a switch). It's not one of his free plugins, however.
 

Sword_of_Dusk

Keyblade Master
Veteran
Joined
Sep 13, 2015
Messages
374
Reaction score
413
First Language
English
Primarily Uses
RMMV
I don't know if it will work in conjunction with Victory Aftermath, but you can give this a try.
 

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
265
Reaction score
43
First Language
English Spanish
Primarily Uses
RMMV
Thank you, but im in no need of a plug, I need to know how to FORCE a drop during battle. Like a script call. something like " $data.armor[23].addToDrop()" or something like that.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,474
Reaction score
14,817
First Language
English
Primarily Uses
RMMV
Why aren't you just setting the drop items on the enemy?
 

Sword_of_Dusk

Keyblade Master
Veteran
Joined
Sep 13, 2015
Messages
374
Reaction score
413
First Language
English
Primarily Uses
RMMV
Additionally, what exactly is your mini game?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,814
Reaction score
14,623
First Language
English
Primarily Uses
RMVXA
Or better yet, why is the drop not set to 100% drop on the enemy, or 1/1? That forces a drop guaranteed.
 

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
265
Reaction score
43
First Language
English Spanish
Primarily Uses
RMMV
Hi @bgillisp and @Shaz, let me explain:

Enemies has their drop set up to whatever. Items may drop or wont. But there is this mini game where one prize is to have an enemy drop x2 (of the current troop enemies). So that prize drop is independent of the actual drop rate of the troop enemies. But what I really want, my objective here is to have that drop prize listed on the aftermath screen, where all the drop are announced.

So, this is where You get an extra item , taken from the drop list from an enemy of the troop: (@Sword_of_Dusk, it is a chest minigame)
1.jpg

Then, I have a common even where I tell the player that he got an extra item and I give it with the ad item command:
2.JPG


But, I dont want to do it that way, I want that item to appear here:
3.jpg


So, I want to have a way (Im guessing meddling on the $gameTroop.makeDropItems() or BattleManager.makeRewards() methods to manipulate the reward list while processing, so my item appears on the aftermath loot.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
42,474
Reaction score
14,817
First Language
English
Primarily Uses
RMMV
I'm just not understanding why you are trying to do this via script / script call, when the Enemies tab already has everything you need.

If it's just that this enemy does something different during the mini game, can't you create a duplicate of this enemy with the altered drop items and use it in a new troop just for this mini game?
 

Sword_of_Dusk

Keyblade Master
Veteran
Joined
Sep 13, 2015
Messages
374
Reaction score
413
First Language
English
Primarily Uses
RMMV
I'm honestly not sure you should change up what you have now. You explicitly tell the player what they got from the minigame, which is a good thing. Throwing it at the battle end might make them believe they got nothing from the minigame at all, and just got lucky with drops.
 

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
265
Reaction score
43
First Language
English Spanish
Primarily Uses
RMMV
@Shaz , I dont think it does. Forget about drops, mini game, etc etc. I need to add items to the drop aftermath screen. Regardless if the monsters drop their items or not. If the simple enemy tab can do that, help me understand how.

@Sword_of_Dusk, There is a tutorial on how the minigame is played and all the rewards they can, there would be confusion to the player, hopefully =).
 

JGreene

Veteran
Veteran
Joined
Oct 24, 2015
Messages
452
Reaction score
360
First Language
English
Primarily Uses
RMMV
Himeworks extra drops plugin that @Sword_of_Dusk linked is able to use conditions like switches and variables to add the drops to the Victory Aftermath screen (they are compatible). As far as telling the player they got extra drops, maybe it would be easier to have the mini game picture pop up during the battle and then leave it up to the player to determine exactly what those extra drops were. If they play enough, it will become easier to determine what the reward is (if it's something special).
 

ZenVirZan

Villager
Member
Joined
May 13, 2020
Messages
19
Reaction score
27
First Language
English
Primarily Uses
RMXP
The item, gold and EXP rewards are only calculated right before the victory screen is shown, and it's based on the raw enemy data. Without using plugins to modify the functions prior to the victory screen, you can't modify the rewards without changing the underlying enemy data (which isn't a good idea anyway).

I've written a little script that can force a specific item to drop using variables. Place in your plugins folder with the filename "ExtraDrop.js" and configure the variables in the script parameters. Before the fight occurs (or even just before the battle finishes) modify the variables you linked to contain the item ID, item kind and item count of the item you wish to force the drop for.

Make sure to reset any or all of the variables back to zero after the battle to prevent the item(s) from continuing to drop.
JavaScript:
/*:
* @plugindesc Allows a battle to end with a guaranteed specific item as a battle reward.
* @author ZenVirZan
*
* @param Bonus item ID variable
* @type variable
* @desc The variable ID containing the bonus item ID.
* Will be skipped if the variable's value is 0.
* Default: 0
* @default 0
*
* @param Bonus item kind variable
* @type variable
* @desc The variable ID containing the bonus item kind.
* 1 = item, 2 = weapon, 3 = armor
* Will be skipped if the variable's value is 0.
* Default: 0
* @default 0
*
*
* @param Bonus item count variable
* @type variable
* @desc The variable ID containing the count of the item to add.
* Will be skipped if the variable's value is 0.
* Default: 0
* @default 0
*/
(function() {

    var parameters = PluginManager.parameters('ExtraDrop');
    var bonusItemIdVariableId = Number(parameters['Bonus item ID variable'] || 0);
    var bonusItemKindVariableId = Number(parameters['Bonus item kind variable'] || 0);
    var bonusItemCountVariableId = Number(parameters['Bonus item count variable'] || 0);
  
    var _Zen_Game_Enemy_makeDropItems =
        Game_Enemy.prototype.makeDropItems;
      
    Game_Enemy.prototype.makeDropItems = function() {
        var items = _Zen_Game_Enemy_makeDropItems.call(this);
        var varItemId = $gameVariables.value(bonusItemIdVariableId);
        var varItemKind = $gameVariables.value(bonusItemKindVariableId);
        var varItemCount = $gameVariables.value(bonusItemCountVariableId);
        if (varItemId > 0 && varItemKind > 0 && varItemCount > 0) {
            for(var i=0; i < varItemCount; i++){
                items.push(this.itemObject(varItemKind, varItemId));
            }
        }

        return items;
    };
})();
 

Magusalfador

AKA VaroClaw
Veteran
Joined
Jun 15, 2014
Messages
265
Reaction score
43
First Language
English Spanish
Primarily Uses
RMMV
@ZenVirZan THANK YOU!! This is exactly what I need, now my reward shows on the screen I want.


Appreciate it!
 

Latest Threads

Latest Profile Posts

All right, so lesson learned. No more complicated battle systems for me.
Whew, just finished a whirlwind of deadlines. Finally a tiny break. You know...I should go update my 2020 banner now.
image_2021-06-16_153010.png

Why are barrels to difficult? xD I feel like i Barrel...y made it....eh EHHH!? :p
Bluh... glad this present heatwave is coming to a close...
Look what I found, it was my first ABS.

This project was never completed because I had lost the computer where it was stored.

Forum statistics

Threads
112,279
Messages
1,067,053
Members
145,905
Latest member
Hanayura
Top