设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 92|回复: 0

[制作教程] Using Drop Item sets to control an enemy’s drops

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    前天 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    4454

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    22915
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    28263

    灌水之王

    发表于 7 天前 | 显示全部楼层 |阅读模式
    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.


    本贴来自国际rpgmaker官方论坛作者:Tsukihime处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/using-drop-item-sets-to-control-an-enemys-drops.15878/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-14 15:38 , Processed in 0.139688 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表