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

[制作教程] [MV] Simple Radius effect Dimming Flashlight and Batteries

[复制链接]
累计送礼:
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 天前 | 显示全部楼层 |阅读模式
    Simple Radius effect Dimming Flashlight and Batteries

    So some will find this trivial, but thought I'd post to help out the newer members. I'm a novice myself with eventing but this works, so if you see something that might work nicer and cleaner... please feel free to add in some screenshots to show the rest of the class!

    For this project I'm simply using Galv's Visrange plugin for MV get it ---->  HERE
    Once you have it installed and have read over the help files, we are ready to begin *cracks knuckles*

    First thing you need is a common event that when the player "uses" the flashlight (or Torch as I have it) item the system knows what to do with it. Inside the Common event we are going to set up some variables to set.  So lets set those up! Follow along with the image that i have inserted. I have it numbered and highlighted.
    fig 1
    [/url]
    1) go to any event window and select Control Variables. When you click it it will open the window you see for step 2.
    2) Select the populate box to bring up the window in step 3.
    3) Name your variables.... make sure you remember which is named which because you may need to call on the data that will be  stored on these numbers later. In this case i used 3=Zoom, 4=Opacity, and 5=Battery Life

    Now that you have your variables named you can use them to start setting some initial data for the system to pull when the player uses the Torch. Make sure you have made both the Torch and the Batteries in the item section of the Database.

    The torch will look like this
    Spoiler: Torch Item
    [url=https://forums.rpgmakerweb.com/attachments/screenshot-2020-10-16-095114-png.164057/]
    NOTE: My Occasion says always because I have a custom menu that pops up outside the default main menu. You will want that to be set to Menu Scene unless you have a custom menu system.
    The batteries... Like this Spoiler: Battery ItemThe scope on both are not really all that important so don't worry about that part.

    Now lets go back to that Common Event list and start telling the item what to do when the player uses it.

    First don't forget we want it to be dependent on Batteries for the charge so we are going to use Conditional branches with Else selected. Under the first condition we want to take those variables and make sure we set some starting values to them (See Fig 1 - 4 and 5) The numbers can be tweaked to what ever you want, this is just to show you the HOW of it. Make sure you have the Zoom, and Opacity set... add in atint screen if you want to give another level of immersion, don't forget to put a value to the Battery Life.
    Once you have number values set for each variable, don't forget to do a change itemcommand, and take a battery away from the players inventory, or else they will end up with unlimited recharges and that's not fun!!

    Throw in a Switch now to indicate the second Common Event that controls the dimming to start/stop> I named it Charged.

    In the Else portion, we want to tell the system what to do if the player DOESN'T have the D battery. In this case something like : "Its dead Jim." (yeah i had to) or "This item can't be used"

    Your Common event for the Torch Item should look like... Spoiler: This
    Next we will make a Common Event that will trigger a PARALLEL Event (we want parallel  because it will be a real time event and auto run will halt all activity until the commands have run their course.) We want it to activate when the switchCharged is ON so at the top make sure to change your settings to reflect the command.
    In the contents we want to reflect a gradual decrease of the values we set in the first common event. The wait times can all be tweaked one more to suit your means for your game. But the important thing is it will be a looping event. We want to indicate that the Variable to focus on is Battery Life. It can not go lower than 0 so we want to be sure to tell the system.. if the battery life is 0 then the loop will break and continue to additional commands once it has. Now you might be wondering why did you bother making the Zoom or Opacity variables if the focus is on Battery Life?!!  Well because now as the system is being told to Loop til Battery Life = 0.... the values for the other two will be decreasing in the background. Well we need to actually set the decrease in values for the system to execute. This is done by setting the Variables from SET to SUB  (See Fig 1 - 4) and then setting a number value for the variable to decrease (See Fig 1 -5)

    Once that variable value hits 0 we need to tell the system what to do. Its much like a Conditional Branch, just in a more gradual way. The desired effect is to have the screen revert back to how it would be if the Torch was never used to begin with. Also be sure to change the ChargedSwitch to OFF.

    Your Common event for the Torch dimming should look like... Spoiler: ThisThere is a lot more that can go here especially if you have a battery indicator like i have in my final version (i posted the png images on my >>>[url=https://forums.rpgmakerweb.com/index.php?threads/gothicvoid-s-additions-new-animated-doodads.110577/post-1129412]graphics thread<<<) If someone wants the full battery indicator event just let me know and I can post the windows a post in this thread.

    Now.. transferring maps...
    We want it so that if the player leaves the map, the torch will stop ticking down the Life number. We also want to be sure that when the player returns to a map that is dark that, IF there is still a number stored on the Battery Life Variable, the player can still utilize the "charge". I accomplished this by including it in the transfer event to the map.
    Again we are going to use Conditional branch. Inside a conditional branch... with an Else. Confusing right? Well if you map it out, you want a set of commands that tell the system what to do:

    1)when they have a torch
    2)when they have a "charge" left
    3)when they don't have a torch

    so lets start.
    Here is where we will also call on the Visrange as per the plugin help file I shared above from Galv.

    First off, Lets start with if the player has the Torch. What do we want to happen. Well does the torch have battery life left? Does the player even WANT to use the torch if so?
    That means we need an IF the party has Torch as the main Branch, nested (Branch in side a branch) with a battery life check.
    Each branch needs the commands you want the system to preform just as you did before for the Common Event earlier. I also added in the Show Choices to ask the player if they do indeed want to use the Torch. There is a lot more that can go here. The content is up to you. This is just once more.. the HOW of it.

    To save some text and my carpal tunnel, See the shots below how to set it up


    Spoiler: Transferring Branches
    Once more all values can be tweaked to your own liking. Also NOTE.... make sure on the exit transfer event from the map that you turn off the Switch we used (Charged) and the Visrange plugin.
    It might look like Spoiler: This
    [url=https://forums.rpgmakerweb.com/attachments/screenshot-2020-10-16-115304-png.164069/][/url]

    Hope this helps someone.... and again if there is something I missed or something that needs added... let me know!!

    Happy making!


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-14 14:28 , Processed in 0.069318 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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