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

[制作教程] Hunger, Thirst, Sleepsystem without Scripting

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

    连续签到: 2 天

    [LV.7]常住居民III

    4461

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 前天 13:00 | 显示全部楼层 |阅读模式
    Auf Deutsch bitte:
    http://www.youtube.com/playlist?list=PLl1I2bD1AHDVtcwPU13xe4odZP6UTa6g_
     
    Difficulty:


     
    In this Tutorial I’ll show you how to make the HUD for my Hunger, Thirst, Sleepsystem:
    For beginners this tutorial could be a bit difficult to understand, because of that you should have used the maker for a while and be familiar with variables, switches and pictures.
    You can use this tutorial for each maker from Enterbrain. The event commands are the same or similar.
    The first thing you’ll do is open your grafic program (in my case Photoshop) and open a new document with the measurements of one screen of your RPG maker in my case 544 x 418 pixel:

    Then you’ll make a rectangle in the upper left corner and fill it with any colour:

    After that you’ll fill the rectangle with a pattern that you like (right click on the square and choose fill space):

    If you like you can make a relief (right click on the layer and choose Filloptions):

    Then you’ll take your rubber tool and erase the place for the bars. You can hold Shift for straight lines:

    They should beginn and end at the beginning and ending of the 32 pixel squares of the maker.
    Then make a new layer and draw the bars. They should be as long as the places you made before. In my case 5 fields = 160 pixel. That’s important for later.

    Make each bar on a new layer. You can give them beautifull colors with the the gradient in the filloptions:


    Make sure that each bar is on a separate layer.
    Now you should place some Icons on the HUD. I took them from the custom VX Ace icon set.
     

     
    Load it in your graphic program and copy and past it on your HUD
    Now save the HUD, and the three single bars separately as a PNG. You can save it directly in your game’s picture folder.
     
    The first thing you should do is to import your HUD and your bars in your maker with the resource manager if you didn’t save it already in your pictures folder:

    First of all we need to make a common event with the following settings: We’ll call this common event later.

    Now we will set the Predefinitions for our system: the first thing we’ll set are the maximum deficits:
    Why -160? You remember that our bars are 160 pixels long. If our bars are full the picture is set to position X:0 and Y: 0 If the bars are empty then they must be 160 pixel more left. The left part of our coordinate system is minus. Because of that -160.
    Repeat that for thirst and sleep:

    Because we want to behave the three bars differently we need to set three more variables for the steps (for hunger, thirst and sleep).
    Repeat that for thirst and sleep.

    Now we can put in our grafics. Important is that the higher the picture number the higher is the layer of the picture. Because of that we need to put the HUD of the upper most layer (in this case 4):
    With the position X:0 and Y:0 the pictures will be in the upper left corner. Repeat that for the other three pictures. Remember to give each of them a new number. The HUD picture must have the highest number.

    The first common event is now finished. And we can move on with the second with the following settings:

    Now we have to setup how our bars will behave. With each step the hunger, thirst and sleep needs will increase. Because of that we set the variable difference hunger on the value of the steps:

    Of that variable we must subtract the steps the player has made:

    Because each bar should behave different we’ll devide the variable through a different figure for hunger, thirst and sleep. (in this case 4)

    Our system needs to have the variable fixed in another variable because of that we’ll create the variable Hunger2. Otherwise our system won’t work properly.

    In this step we will subtract the variable Difference hunger of the variable Hunger:

    Now it should look like so:

    Repeat that for thirst and sleep.

    Remember to divide the through different numbers.
    Now our pictures should be able to move so we can setup this:
    We name a variable Y for the Y value. Because it will be 0 there is now need to give that variable a value. You can only name it and put it in for the Y value. Repeat that for thirst and sleep as well:

    Now we need to ensure that the varables won’t exeed their limit (upper and under):

    Now click the free line inside the conditonal branch an insert the following:

    Repieat that for thirst and sleep.
    Now we make this conditional branch again for the lower part:


    Repeat that again for thirst and sleep.
    This should look like so.

    Now we are nearly finished with the second common event. We only need to tell the maker what should happen when the bar is empty (in our case -160 our deficite max.)
    If our hunger is less or equal to our deficite maximum we’ll die.

    If you like you can insert a message, this message should be above the Game Over command.

    Repeat that for thirst and sleep:

    And that’s it for this common event. Now we have only left to activate the switch no. 1 and to call our predefinition common event.
    Make on the map where you like to start the hunger thirst and sleep system a new event: on the first page:
    Set this page on autorun.


    This self switch switches to the secon page.
    This page must have the trigger of Action button and as a condition the self switch A.
    Now our Hud will function.
    But we still need items to refill our storage.
     
    First you need to create a new item. Go in your database on the tab Items. In this example I’ll make a small water bottle which decreases thirst about 50%. It’s nearly exact the same for hunger, thirst and sleep. Let’s start:We’ll create the common event later.
    Name the item as you wish (in my case “little water bottle”) and select an icon (doubleclick on the field the window with the icons will open. Select the one you wish and click OK.). Then give it a description like: “decreases thirst about 50%”. Item type is normal, give it a price as you like. It should be consumable – so set the consume to yes. Scope must be none and Occasion should be on always – except you wish it different. In the part of Invocation you need to do nothing as well as in Damage.
    But we need to insert a common event in Effects: Now we’ll create this common event:
    Switch to the tab Common Event in your Database and do the following: Name the common event as you wish and let the Trigger on “None”. Set the variable Steps thirst to the amount of steps.

    Then increase the variable Thirst about the half (in this case 80 (160 / 2 = 80)) Please remember that our bars are 160 pixel long.

    Now we need a conditional branch to check if the variable thirst is greater than 0 to ensure that the number never exceeds the 0. Otherwise our system woudn’t work anymore.
    Uncheck “Set handling when conditions do not apply” (the else case).
    In that conditional branch you have to insert that the variable Thirst is set to 0, if the condition is true:

    Under the conditional branch you have to set the variable Thirst2 to the value of variable thirst,to ensure that the bar won’t go every time full again.

    And that’s it for this common event:

    Now we can call this common event in the items. Go back to the tab Items and doubleclick in the effects part  under “Kind” to open the following window:

    Switch to the last tab “Others” and put in the common event we’ve created before.
     
    .
    Now you can build in the items in your game. You’ll need for each item an common event except 2 or more items do exactly the same. Here’s an example for bread. 
     
    It’s the same for sleep with the according variables and common events.


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-14 16:52 , Processed in 0.128155 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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