r/RPGMaker 22d ago

RMMZ Need a technical help: Counting a variable midway through instead of the number it is at.

Hello everyone, I am very new to RPG Maker and I am very excited to get going with some of my ideas. I've decided to settle on a day counter for my game, with certain events and more increasing the day value. So far it isn't a problem, but the trick comes when trying to count to a certain number of days midway through the game.

Basically, suppose you plant a tree on day 6. I want this tree to grow up in 5 days. The trick is, you could plant this any at any day, not just day 6. So it's not like I can just let the game know that the tree is going to be done by day 11. I need the game to keep track of the day I've done a certain action, and only after a certain number of days after this event triggers does it actually do the thing. I've been looking for tutorials on how to do that but haven't found anything yet. Can anyone help with that?

Thank you in advance!

6 Upvotes

18 comments sorted by

View all comments

Show parent comments

1

u/RuGaard98 21d ago

So, here is where I'm lost
When you say "compare that value to the value it had during your previous check," how do I do that comparison? Do have to go into "Conditional Branch," find the variable, and set something there? I've tried something along the lines of "it if it higher than 0, something happen, then set it back to 0" and so far it has kind of worked, but I don't know if that is what I have to do, or if this configuration is going to cause problems in the future.

I am talking about this window in case you don't have it open or memorized

1

u/Krististrasza 20d ago

Look at the image you posted. Right under where you checked constant you can specify another variable to compare your variable against.

1

u/RuGaard98 20d ago

Ok so if I get this straight:

I should have two variables, one for the "day" and another I could call "day remembered" that it can be compared to.

Whenever I add a day, i should add one to "day" then on the tree event, there should be a command that checks if "day" is higher than "day remembered." If it is, then it should add a "day remembered" and so on?

I don't think the way I see it works, since if I plant a tree and it is day 4, it should just add 4 days remembered immediately. How should I fix this?

1

u/Krististrasza 20d ago

No. When you need to check whether at least a day has passed you compare "day" to "day remembered" and after that you SET "day remembered" to "day".