Jump to content
Braveh

I really need help! ;n; MAJOR PROBLEM.

Recommended Posts

I really need help. I have a major problem! I have made a custom hunger/thirst bar using variables and such...and okay here is what happens: My thirst or hunger will go down and I'll try to eat or drink and it won't fill it up, and the hunger /thirst won't go down any more either. Here are some screenshots: 

 

 

post-13487-0-32793100-1356971041_thumb.png

post-13487-0-26388500-1356971052_thumb.png

post-13487-0-06856400-1356971062_thumb.png

post-13487-0-92194800-1356971075_thumb.png

post-13487-0-45602500-1356971085_thumb.png

post-13487-0-86465900-1356971094_thumb.png

post-13487-0-64884800-1356971112_thumb.png

Share this post


Link to post
Share on other sites

Referring to your third screenshot with the common event, Get Water,

if the character's thirst isn't 50, 100, 150, 200, or 225, their thirst won't be changed.

Thirst increases in increments of 25. So if your thirst was 25, 75, 125, 175, 250, etc., and you took a drink, your thirst wouldn't change.

Is that the problem?

 

If you don't want to have it so the Thirst Variable doesn't go above 225 or below 0, then have it so if Variable 16, Thirst, is  greater that 225, it becomes 225, and if it's less than zero, it becomes zero.

Edited by Audrey

Share this post


Link to post
Share on other sites

But, it'll stop working correctly not right away, but rather after you've played the game for about 5-10 minutes. At first it works...but then it doesn't. Would that work? 

Share this post


Link to post
Share on other sites

Help? I'm sorry if I'm impatient....but it is a really bad problem. It works perfectly fine at first...but then, after 5-10 min. It doesn't work at all. 

Share this post


Link to post
Share on other sites

Braveh, please do not double post within 72 hours.

Share this post


Link to post
Share on other sites

I might not be able to get to this til tomorrow, what with the New Years, but if you can wait I can take a look at what you're doing and create a more efficient system out of it.

Share this post


Link to post
Share on other sites

Well I'm not sure if this warrants a whole system. Yours is basic enough that I can just point you to the answers.

 

I'll make a demo of my system that does the same thing as yours, but in a more efficient manner. You can learn from it! :3

 

http://dl.dropbox.com/u/5536575/Hunger%20%26%20Thirst.exe

 

Now I'll explain the things in your screenshot you should improve.  I actually am not sure why you're getting the problem you are.

 

First for your common event, "Get Water" get rid of ALL those conditional branches.

 

Just put.

 

Set Variable: Thirst = 0

 

Cause that's all you're really doing in your screenshot.

 

Next, for your food, you don't have to make a new common event for every item.

 

Instead make just one blank common event that does nothing.

 

For food items, set the damage to "HP Recover" and use this formula:

 

$game_variables[15] >= 25 ? $game_variables[15] -= 25:$game_variables[15] = 0;100

 

Let me explain:

 

$game_variables[15] >= 25 ?

 

Is Game Variable 15 (Your hunger variable in your screenshot) greater than or equal to 25 ?

 

If it is,

 

$game_variables[15] -= 25

 

We subtract 25 from our hunger variable (#15) and that's our new variable number.

 

:$game_variables[15] = 0

 

Else ( : ) if our hunger variable (#15) is less than 25, we set our hunger variable to 0.

 

Finally we have ;100, which is our HP recovery amount. Set variance to 0. If you want it to recover 500 HP just put ;500.

 

Make the common event it points to the blank common event that does nothing. This makes sure we can use the item even if we're at max hp.

 

Now you can clear up a BUNCH of common events and just use this formula.

 

I also saw your thirst and hunger common event that counts up hunger and thirst over time. Parallel processes can lag your game if there's too many, so I turned them into one very neat system:

 

78016239.png

 

I noticed your hunger and thirst waits were just in increments that could be split into 500s.

 

700+800 = 1500

1000 + 1000 = 2000

 

Every 3rd 500 is 1500.

Every 4th 500 is 2000.

 

The modulo command (%) works like this.

It divides a number, then gives us the remainder.

 

Things dividable by 2 are even. Not dividable by 2 are odd.

 

It counts @counter, which is just a variable. I don't want to go into detail, but it does work.

You should be able to plug it righti nto your game and it'll function.

 

You can also now decrease hunger by numbers other than 25s. Like 35s. Kill the slime in the demo to find fish, which reduces by 35.

 

Those are the snags I saw, and making these changes shouldn't be a problem unless it's in some other event.

Share this post


Link to post
Share on other sites

Okay, thanks :) I have one question though, I have  bar that shows the hunger and thirst on screen, how would I do that? 

Share this post


Link to post
Share on other sites

The same way you have been, but instead of using == (Is Equal To) use (Is Greater than or Equal To) and make sure the order is always least to greatest.  I also suggest putt a 5 frame wait at the end to ease the parallel processing power.

Edited by Titanhex

Share this post


Link to post
Share on other sites

Okay! :D Thank you very much! :D

 

Edit: Tried it out, and it works marvelously! 

Edited by Braveh

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted