Original Source
- Original title: TAA_EnemyDrops v1.0.1
- Original author: taaspider
- Original date: August 2, 2021
- Source thread: https://forums.rpgmakerweb.com/threads/taa_enemydrops-v1-0-1.139155/
- Source forum path: Game Development Engines > RPG Maker Javascript Plugins > JS Plugin Releases (RMMZ)
Summary
TAA_EnemyDrops - v1.0.1 Created by taaspider This plugin is compatible with both MV and MZ. Terms of Use
Archived First Post
Created by taaspider
This plugin is compatible with both MV and MZ.
Terms of Use
Any plugins developed by taaspider are free for use for both commercial and noncommercial RPG Maker games, unless specified otherwise. Just remember to credit "taaspider".
Redistribution of parts or the whole of taaspider plugins is forbidden (which also includes reposting), unless it comes from the official website (linked within the post). You are allowed to edit and change the plugin code for your own use, but you're definitely not allowed to sell or reuse any part of the code as your own. Although not required to use my plugins, a free copy of your game would be nice!
Introduction
This plugin aims to give the developer more control and flexibility when setting up loot drops from enemies. With it you can set advanced rules to influence drop probability, determine the number of times a specific item can be dropped and how probability increases/decreases after each drop, which means a second drop can be more or less likely to happen. You can also influence probability with a variable, so that drop rate can be affected without much work.
As of most of my plugins until now, EnemyDrops can be configured either through an external JSON file, plugin parameters or enemy note tags. It's up to the dev to select the method he's most comfortable with! Also, for those who use an external JSON file, you have the option to use a single file for both TAA_EnemyLevels and TAA_EnemyDrops, centralizing enemy setup in a single place for both plugins (and maybe others in the future).
There's a huge list of possible comparisons and conditionals to compose a drop rule, be sure to read the help file thoroughly to check on all possibilities!
Features
- Use either an external JSON file or the Plugin Manager to setup conditional drop rules for each enemy, or create a default global rule to apply to drop settings done through the engine database.
- Share the JSON file with other plugins from the TAA liberary (typically TAA_Enemy* plugins, like TAA_EnemyLevels), so you can concentrate all enemy config data in one place.
- Create a "stop clause", where if a specific condition is not met, the plugin interrupts rule processing and discard any following rules for that drop.
- Select from a huge variety of conditional clauses to customize enemy drops to your liking, raging from the default random condition to checking party inventory, enemy settings, battle history, and others!
Screenshots
How to Use
WARNING: This plugin requires RPG Maker MV 1.5.0 or above! Please make sure your RPG Maker MV software is up to date before using this plugin. You don't need any specific version if you're using MZ.
First of, download the plugin here. There's a lot of conditionals you can use while setting up drop probability that I won't cover in this post, so I advise a good reading on the help file before using this.
You can also test the plugin using my sample demo project. It was built with MV, but you can open it with MZ as well (just open the game.rmmzproject file and you're good to go).
To use a JSON file, be sure to select this option in the Datasource Type parameter.
The File parameter inside the JSON Config parameter determines which file will be read to load drop configuration. Regardless of using a dedicated file or sharing the file with other TAA plugins, EnemyDrops data must follow this basic structure:
[
{
"id": <enemy ID>,
"drops": [
{
"item": <item id / name (without blank spaces)>,
"armor": <armor id / name (without blank spaces)>,
"weapon": <weapon id / name (without blank spaces)>,
"type": <drop type>,
"base": <base drop chance>,
"amount": <drop amount>
"iterationEffect": {
"type": <type code>,
"attenuation": <attenuation value>
},
"conditions": [
<conditional clause 1>,
<conditional clause 2>,
...
]
},
{
...
},
...
]
}
]
You can customize the object's tags as you wish using the next parameters.
IMPORTANT:
- <enemy ID> must be a valid enemy ID in the database, and must be unique in your JSON file. More than one entry for the same id can (and will) generate errors.
- <item id> should be replaced either by the item id from the database, or its name. If you choose to use an item name, be sure to surround it with quotes and remove any blank spaces. For example: an item named Big Potion can be referenced here as "BigPotion". You need at least one object from item, armor or weapon for each rule, but it is not necessary to have all three present.
- <armor id> should be replaced either by the armor id from the database, or its name. The same instructions given above for item names are applied. You need at least one object from item, armor or weapon for each rule, but it is not necessary to have all three present.
- <weapon id> should be replace either by the weapon id from the database, or its name. The same instructions given above for item names are applied. You need at least one object from item, armor or weapon for each rule, but it is not necessary to have all three present.
- <drop type> defines what the drop rules refer to. It has four possible values:
- "item": only the item object is effectively dropped (if conditions are met). If this type is set, the "item" object must be present.
- "armor": only the armor object is effectively dropped (if conditions are met). If this type is set, the "armor" object must be present.
- "weapon": only the weapon object is effectively dropped (if conditions are met). If this type is set, the "weapon" object must be present.
- "all": any item, armor or weapon object present is effectively dropped (if conditions are met). At least one of the drop objects must be present ("item", "armor", "weapon")
- <base drop chance> is a value between 0 and 100 and represents how likely the drop is to happen. It is a percentage value, and the higher it is, the more likely it succeeds.
- <drop amount> is the number of times the item / armor / weapon should be dropped when conditions are met. You can define how drop chance applies for multiple item / armor / weapons instances with the iterationEffect object.
- <type code> is a numeric value representing one of three possible behaviors:
- 0: Shared probability. That means that the drop chance is tested a single time for all items. If it pass, all items are dropped. If it fails, none are.
- 1: Repeat probability. That means that each item has its own chance of being dropped, but the same probability is applied to each one of them.
- 2: Attenuate probability. That means that for each item instance evaluated, drop probability for the next one is reduced/increased by the <attenuation value>. This applies individually to items, armors and weapons. So if a drop rule is set to drop 2 of each, the conditional rules calculate the initial probability for the first item, armor and weapon, but the second of each one of them is attenuated.
- <attenuation value> is a number between -100 and 100 and represents how much to attenuate (or increase the chance) of a second drop when the drop amount is greater than 1 and <type code> is set to 2.
- <conditional clause> are evaluation clauses, as described in the section "Conditional Clauses".
Also keep in mind that if the plugin TAA_EnemyLevels is present and enabled, TAA_EnemyDrops is forced to use the same datasource type. If EnemyLevels is set to use an external JSON file, EnemyDrops will need to use the same file with all settings bundled together. If it is set to use the Plugin Manager, EnemyDrops will need to be set through the Plugin Manager as well.
Enemy note tags can be used regardless of both plugin configs!
To start a conditional drop note block, add the following pattern to your enemy note box:
- <item type> is either 'item', 'armor' or 'weapon', and determine which type of item may be dropped after evaluating drop probabilities.
- <item reference> is an item, armor or weapon ID (depending on what <item type> is set to), a variable referencing an ID (using the v[n] format) or the dropped object name without blank spaces.
- <value> is an integer. When used with the 'amount' property it must be positive and higher than zero. For the attenuation settings it can assume a negative value.
- <type code> must be one of three values:
- 0: Shared probability. That means that the drop chance is tested a single time for all items. If it pass, all items are dropped. If it fails, none are.
- 1: Repeat probability. That means that each item has its own chance of being dropped, but the same probability is applied to each one of them.
- 2: Attenuate probability. That means that for each item instance evaluated, drop probability for the next one is reduced/increased by the <attenuation value>. This applies individually to items, armors and weapons. So if a drop rule is set to drop 2 of each, the conditional rules calculate the initial probability for the first item, armor and weapon, but the second of each one of them is attenuated.
- If the 'amount' property is not present, the plugin will assume the drop rules apply to a single object unit.
- Both 'amount' and 'attenuation' are optional parameters and can be omitted.
Here's a few examples:
Engine Settings
Chance Processing
Drop Rate Variable
Returns 0 if chance processing is set to run at enemy death, or 1 if set to run at battle end.
$gameSystem.edUpdateChanceProcessing(option)
Chance chance processing settings. option can be either 0 to run at enemy death, or 1 to run at battle end.
$gameSystem.edUseEngineSettings()
Returns true if engine drops are kept, or false if they are set to be discarded.
$gameSystem.edEnableEngineSettings()
Enables the Engine Settings parameter, so that engine drops are kept with conditional drops.
$gameSystem.edDisableEngineSettings()
Disables the Engine Settings parameter, so that engine drops are discarded and only conditional drops are considered.
Manage when drop processing takes place. If can be set to run either at each individual enemy death, or all enemies together at battle end.
Engine Settings
Manage how the plugin handles drops configured through the default engine configs. If enabled, any enemy drops configured through the engine will run as set, and conditional drops are added to this result. If disabled, only conditional drops are considered.
- Version 1.0.1:
- Fixed a bug that could cause game crash while preparing plugin indexes on game boot;
- Fixed a bug that would cause the max amount of drops of an item to always be applied, ignoring the chance calculations;
- Fixed a bug that would cause the amount of drops to be ignored, and never drop more than one item. This scenario would happen only when using the Plugin Manager as datasource;
- Version 1.0.0:
- Fixed a bug on default drop rules;
- Refactored a bit of code to allow easier future plugins compatibility;
- Version 0.9.0:
- Beta release;
Features Mentioned
- Use either an external JSON file or the Plugin Manager to setup conditional drop rules for each enemy, or create a default global rule to apply to drop settings done through the engine database.
- Share the JSON file with other plugins from the TAA liberary (typically TAA_Enemy* plugins, like TAA_EnemyLevels), so you can concentrate all enemy config data in one place.
- Create a "stop clause", where if a specific condition is not met, the plugin interrupts rule processing and discard any following rules for that drop.
- Select from a huge variety of conditional clauses to customize enemy drops to your liking, raging from the default random condition to checking party inventory, enemy settings, battle history, and others!
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadLicense / Terms Note
Terms of Use Any plugins developed by taaspider are free for use for both commercial and noncommercial RPG Maker games, unless specified otherwise. Just remember to credit "taaspider". Redistribution of parts or the whole of taaspider plugins is forbidden (which also includes reposting), unless it comes from the official website (linked within the post). You are allowed to edit and change the plugin code for your own use, but you're definitely not allowed to sell or reuse any part of...
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...