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

[制作教程] Random Loot Boxes

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

    连续签到: 2 天

    [LV.7]常住居民III

    4446

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 4 天前 | 显示全部楼层 |阅读模式
    Do you want your powerful bosses or event enemies to give your player a little something extra?
    Maybe a little item that will distribute a random reward to the player upon opening from their inventory?
    Then uh, this might be the guide for you.

    In many MMORPG's, many bosses drop boxes that contain random gear and items. In RPGMaker (I've only managed to do this in MV, I don't know if this works as well in the other engines), it is very possible to replicate this effect using Common Events.

    First, enter your database.
    Spoiler






    Next, go into your Items tab and create the item you wish to give the random reward. For the sake of this tutorial, I shall call mine Reward Box, though it can be called whatever you like.
    Spoiler






    Next, set the item type and etc to how you see fit. You likely don't want this item to be used in battle, so I recommend setting it to Menu only. If you want the player to have the ability to sell the box, give it a price. Set the scope to none if you wouldn't like to play an animation when they open your box.

    Spoiler






    Next, we will need to make a Common Event for the box to use when the player opens it. Locate the Common Event tab in your Database and make a new event.

    Spoiler






    Now for the fun part. We are going to assign a variable to our box. Click the empty common event field as if you were making any normal event, and select "Control Variables." Next make a new variable. For the sake of maintaining organization, I like to name my variables after their trigger. So I will name mine Reward Box.
    Spoiler: Selecting Control Variables

    [img]http://blob:http://imgur.com/6fa0af4e-9f61-457a-8bbd-8fe46a15ae99[/img]
    Spoiler: Naming the Variable

    Once you have your variable made and selected, click okay. Next, go under Operation and make sure the operation is on "set."
    Then go to Operand and select random. This will be what generates the item given randomly. Lets say we want to give out 4 items, since in cpu language 0 is still counted as a number, we would select 0-3 if we wish to distribute 4 items. Alternatively you could select 1-4 but for the sake of this tutorial, we will use 0-3.

    Spoiler






    Click "Ok" and return to the event page. On the next line, add a Conditional Branch. Now set the condition for the branch to be your variable. Be sure that "Variable = x" where X represents what item will correspond to the number stored in the variable. For the very first one, we will select 0 as this will be the first item distributed. Copy and paste this branch adding 1 to the constant each time until you have 0-3 as shown below.
    Spoiler





    Spoiler: When the Conditional Branches are set up properly:

    Now for the final part of the common event. In each If: branch, add some text saying something like "You've obtained (Item name)!" and then have it give the player the item!
    Spoiler






    Next, we need to go back to our item in the Items tab. Select "Effects", other and Common Event. Select the common event we just made.
    Spoiler





    Next, just make the enemy drop the box and you're done

    Spoiler








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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-14 14:21 , Processed in 0.064628 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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