Hunger, Thirst, Sleepsystem without Scripting

Nefertari83

Writer
Veteran
Joined
Sep 19, 2012
Messages
121
Reaction score
38
First Language
German
Primarily Uses
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.
 
Last edited by a moderator:

Sit-Amun

Warper
Member
Joined
Aug 1, 2012
Messages
3
Reaction score
1
First Language
German
Primarily Uses
Thanks for sharing this great tutorial with us. :)

And a special thanks for linking the German version. :D
 

RafelTNT

Warper
Member
Joined
Jun 9, 2013
Messages
1
Reaction score
0
First Language
Portugues
Primarily Uses
Hi plz make a video tutorial because just the photos are too confusily

thx
 

Dian Cecht

Warper
Member
Joined
Feb 21, 2013
Messages
3
Reaction score
0
First Language
German
Primarily Uses
Thanks for the great tutorial. Well explained and easy to follow.

As I was playing around with it, I wondered if there was a way to add a bar which goes in the opposite direction.
(from empty to full) used for fever or stuff like that.

I couldn't get it to work, though. And I can't figure out how to do so.
The bar just fills itself instantly which causes death due to the "game over" trigger point set to 0.
This has to do with the "Fever" variable value being at 0, but if I set it to -160 the variable doesn't respond to changes anymore.

If you have the time, I'd appreciate your help 'cause I think I maybe overthinking the whole problem :D

~Dian
 

ninja716

Warper
Member
Joined
Jul 1, 2013
Messages
2
Reaction score
0
First Language
Danish
Primarily Uses
It looks really good! but there is just one thing im confused about, in which common event do  i put the different picture or variables?
 

ninja716

Warper
Member
Joined
Jul 1, 2013
Messages
2
Reaction score
0
First Language
Danish
Primarily Uses
Nvm! i was just confused abit but it got worked now! Thanks alot man! :D
 

Momo_Mccloud

Crusader
Veteran
Joined
Aug 16, 2013
Messages
94
Reaction score
6
First Language
C++ & HTML
Primarily Uses
Splendid! and also Its my first time seeing new modification without scripts!
 

Nitrouspeach

Warper
Member
Joined
Dec 29, 2013
Messages
4
Reaction score
0
First Language
Dutch
Primarily Uses
Awesome tutorial, a bit difficult (for a newbie like me) but i will get the hang of it. Awesome work  :rock-left:
 

Nitrouspeach

Warper
Member
Joined
Dec 29, 2013
Messages
4
Reaction score
0
First Language
Dutch
Primarily Uses
first i would like to thank you for your amazing tutorial on the hunger stat, it was just what i needed.

I adapted it to a gasmask/oxigen hud.

But i want to pauze the event when the player enters a bar and when he exits it needs to start again (from were it was paused). Do you perhaps have any idea were i could find this, or how to do this? I've searched the forum(s) but cannot find it. Is it even possible?
 

Nefertari83

Writer
Veteran
Joined
Sep 19, 2012
Messages
121
Reaction score
38
First Language
German
Primarily Uses
You're welcome.

To pause this Common Event just turn the switch (001 HungerDurstSchlafSystem in the video) which activates the Common Event OFF. You might as well want to erase the pictures. And show them again when the player exits the bar.
 

BigJoshieC

Rip Van Winkle III
Member
Joined
Dec 21, 2013
Messages
18
Reaction score
0
First Language
English
Primarily Uses
Great tutorial. Thanks for this!
 

CrypticCuddler

Free Hugs
Member
Joined
Jan 6, 2014
Messages
456
Reaction score
21
First Language
English
Primarily Uses
@Cleo 

I can't seem to find your english youtube channel, or any english videos, I just wanted to clarify if you had any or not, I would totally understand 

if you didnt but I love how clear your walkthrough is on how to do this and would love to read/see more.
 

Nefertari83

Writer
Veteran
Joined
Sep 19, 2012
Messages
121
Reaction score
38
First Language
German
Primarily Uses
@CrypticCuddler

Thanks for your nice comment.

My Youtube Channel is German, because it's my mothertongue. I've already made 2 English Videos: http://www.youtube.com/playlist?list=PLl1I2bD1AHDUD7udWQLmCE8z8SBEeFPkJ

I can make other Tutorials in English, but I can't guarantee for perfect English. I might have a German accent and might use German figures of speech. What kind of tutorials would you like to see?

I'm glad that you like my tutorial.
 
Last edited by a moderator:

Najir

Veteran
Veteran
Joined
Apr 17, 2012
Messages
37
Reaction score
2
First Language
english
Primarily Uses
This is exactly what i was looking for, thank you for the tutorial.Also is it alright if i give you credit in games i use this in?
 

Nefertari83

Writer
Veteran
Joined
Sep 19, 2012
Messages
121
Reaction score
38
First Language
German
Primarily Uses
I'm glad you can use my system in your game. It would be nice if you'd give me credit.
 

Tigersong

Furry Fellow
Veteran
Joined
Oct 22, 2012
Messages
452
Reaction score
44
First Language
English
Primarily Uses
I have a quick question about this tutorial. Is there any way I could set up a "fatigue" meter that goes down when the player dashes? So basically, it keeps lowering while the dash key is being pressed, and if it falls to 0% the player can't dash until it refills.
 

Nefertari83

Writer
Veteran
Joined
Sep 19, 2012
Messages
121
Reaction score
38
First Language
German
Primarily Uses
I'll try to make a tutorial for that. But I have to look for the script command to toggle the dashing function.

In the meantime you could use this script of TinyMine: http://rpgmaker-vx-ace.de/board9-rpg-maker-vx-ace-lite/board18-scripts-rgss3-ace/board62-script-datenbank/746-dash-script-rennfunktion/

Edit 30.03.14:

I've asked my scripting tutor and he gave me that scriptlet:

Paste that as a new script

Code:
class Game_Player < Game_Character  alias old_dash? dash?  def dash?    return false if $game_switches[id] # instead id put the id for the switch in the brackets.    old_dash?  endend
 
Last edited by a moderator:

Tigersong

Furry Fellow
Veteran
Joined
Oct 22, 2012
Messages
452
Reaction score
44
First Language
English
Primarily Uses
Thank you, Cleo. Please take your time, as I'm not currently working on a deadline. :)
 

Archeus

A little bit of everything...
Member
Joined
Feb 15, 2014
Messages
5
Reaction score
0
First Language
swedish
Primarily Uses
Thanks alot for this! It works very well! But just one question: is there anyway to make the food bar and everyting else go down even if you stand still? Because i have to move around for it to go down.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

does there exist a word for a state of being that is between "living" and (not "dead", but ...) "not living" .... does that make sense, or do I just sound like Im high for something :[ ?
Hope you are all fine today~
Moderators, you must have so much patience to be able to deal with everything. I mod in a server of sorts and today we just got a message, which, despite it's helpful constructive criticism, basically stated that all of the mods were jerks and that was the only reason our server was unlikeable. So, thank you, for having patience. You are appreciated! :kaoluv:
Haired slime? Trying some different styles of art. Maybe I can make some resources with this new kind of painting.......

Forum statistics

Threads
105,742
Messages
1,016,053
Members
137,425
Latest member
brassykibbles
Top