Using Drop Item sets to control an enemy’s drops

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,082
First Language
English
This tutorial explains what Drop Item Sets are and how they can be used to create unique conditions for obtaining item drops from enemies.

Required

Script: Drop Item Sets

What is it?

A "Drop Item Set" (or simply, "drop set") is an object that manages drop items.

It describes

-What drops can be obtained from an enemy, and

-What conditions must be met to obtain these drops

A single enemy can have multiple drop sets, each with different items and different conditions. This allows you to control when and how conditions are dropped based on any type of conditions that you can imagine.

How to create a drop set

It is easy to create a drop set. Simply note-tag an enemy with

<drop-item set>drops: 1, 2, 3priority: 1condition: your_formula</drop-item set>
`drops` specifies which drop items will be assigned to that set. The numbers are based on the enemy's list of drop items, 1 being the first drop item on the list (ie: Potion). You can assign the same drop multiple times to a set, allowing the player to receive the same item multiple times.

`priority` determines the order that drop sets are checked. When a battle is won, the game will pick one valid drop set to reward drops from. Higher priority sets are checked before lower priority sets, so you can use the priority to determine which sets should be checked first.

`condition` is used to determine whether a drop set is valid. A drop set is valid only if the condition is met. If there is no condition, then it is valid. The condition is any valid ruby formula that returns true or false. There are special variables available for your formulas; refer to the script for more information.

Example: Quest Drops

Suppose you are designing a quest where you are asked to collect some Slime Pudding that are dropped by Slime monsters. You want these slimes to be regular monsters in a dungeon that you can encounter at any time, but you also want the slimes to drop the Slime Pudding only when the quest is activated (Switch 14 is ON)

You have decided that the slimes will drop two items normally: Potions, and Hi-Potions. You also want these slimes to drop the puddings with a 100% droprate when the quest is active.

So here are the slime's drops and their droprates:

1. Potion - 50%2. Hi-Potion - 25%3. Slime Pudding - 100%The slime has a 100% chance to drop the pudding, which means if you have to collect 20 puddings, then you only have to find and defeat 20 slimes. However, if the pudding has a droprate of 100%, how can you control it so that they only drop when Switch 14 is ON?Using Drop Item Conditions

A nice solution is to use Drop Item Sets and attach conditions to them. You can create two groups of drops: the first group is the normal drops that you receive whenever you defeat a slime. The second group is used when the quest is activated. Here is a possible setup

Group 1: Potion, Hi-Potion

<drop-item set>drops: 1, 2priority: 1</drop-item set>Group 2: Potion, Hi-Potion, Slime Pudding
Code:
<drop-item set>drops: 1, 2, 3priority: 10condition: s[14] == true</drop-item set>
There are two things to notice in our setup.First, is the priority. When the quest is active, we want to receive slime puddings whenever a slime is defeated. Because the drop sets are checked in order of priority, we want the second group to be checked first so that the game doesn't randomly choose the first group that doesn't have any pudding.

Second, is the condition. In our second group, we have the condition that Switch 14 must be ON. This means that if switch 14 was not ON (ie: the quest hasn't started, or is finished), then we will never receive Slime Puddings from the slimes because the second drop set will never be picked.

This example assumes you can only collect Slime Pudding from Slime enemies, but you can use the same setup to have multiple enemies drop Slime Pudding easily. For example, maybe you have five different Slime-type monsters and you want all of them to drop Slime Puddings when the quest is active.

Closing words

As demonstrated above, drop item sets allow you to accurately describe what drops should be available under certain circumstances. By using powerful formulas, you can create a variety of unique events in your game that could not be done before without putting a lot of effort into finding workarounds.
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,008
Reaction score
11,345
First Language
English
Primarily Uses
RMVXA
Once again you come up with something that will save us hours of slog and frustration.  Thank you.
 

ultimagicka

Villager
Member
Joined
Oct 15, 2012
Messages
29
Reaction score
8
First Language
English
Primarily Uses
RMMV
  This is sweet! Once again the Master of Functionality has stepped in and made the task of game making more productive and more importantly way less stressful. Excellent job.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Karen: Hi, I have a condition that prevents me from wearing a mask. :)

Employee: Can you tell me what it is?

Karen: >:(
Feeling a little overwhelmed... There are so many things to do.
- Building a simple website for portfolio
- Setup *******
- Manage social media
There are so many things inside of these tasks :(
Meet the cute little ghost, FhooFhoo. :kaopride:
If anyone here is looking for another high-potential RPGMaker game--besides She Dreams Elsewhere--be sure to follow Lawmage Academy. Good social media presence will take that game far.
Lol, I was about to write a small tutorial and realized it would belong to the MZ section ....that does not exist yet.

Forum statistics

Threads
99,575
Messages
966,825
Members
131,231
Latest member
Bektos
Top