ACHTUNG: Für alle die des Englischen nicht so mächtig sind habe ich es hier noch einmal auf Deutsch hochgeladen: http://rpgmakervxace.de/board64-tutorials-ressourcen/board42-tutorials/
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).
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 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.
Now our Hud will function.
But we still need items to refill our storage. This we will make in the third and last part of that tutorial.