RMMV - Consume item per step on world map.

CG24324

Villager
Member
Joined
May 16, 2021
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hey guys, pretty new to RPG Maker, but I've been finding it pretty intuitive and simple to do what I need.

I'm making a game in a similar vein to Oregon Trail, so a bit of sim-elements inside the RPGM engine. So far, I've been able to implement things pretty simply.

I'm planning on having a "food" item in the game, that depletes while traveling, and stays the same while in towns/interiors.
One thing that I'm a bit confused on how to accomplish is the food situation, and how to have the party consume it while traveling on the world map.

I think the best bet would be to have the party consume a set amount of food per-step on the map. And maybe, if possible, give the player the ability to specify the rate at which it's consumed.

Thing is, I'm not too sure on how to accomplish this. Any help would be appreciated. I'm still rather new to RPGM as well, so please explain things as simple as possible. I'm picking it up pretty fast, but I'm still a bit green.
Thanks!
 

Htlaets

Veteran
Veteran
Joined
Feb 1, 2017
Messages
243
Reaction score
121
First Language
English
Primarily Uses
There are a few ways, I'll just go for an easy one.

First, make a common event that loads the player's current region ID, X coordinate, Y coordinate, mapID etc. (you really only need X and y for this, but long term having all those helps) and call it regionid or something.

Next, at the start load those values up for the player's starting position and then have a separate pair of variables named something like "Old_X and Old_Y" load in the current player X and Y variables (make them equal to the player X and Y variables, not the game data. These will be your reference data to check against new data.

Next, make a parallel event. This parallel event will do the following in this particular order:
1. regionID common event we talked about
2. Check player X vs the Old_X If player x doesn't equal Old_X, then the player has moved so you can remove an item and do whatever else you need to do if they have no item.
3. check Player y vs the Old_y, same as above.
4. Finally, make Old_X = player x again and do the same for Y.
This will basically catch whenever the player moves.
 

CG24324

Villager
Member
Joined
May 16, 2021
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMMV
There are a few ways, I'll just go for an easy one.

First, make a common event that loads the player's current region ID, X coordinate, Y coordinate, mapID etc. (you really only need X and y for this, but long term having all those helps) and call it regionid or something.

Next, at the start load those values up for the player's starting position and then have a separate pair of variables named something like "Old_X and Old_Y" load in the current player X and Y variables (make them equal to the player X and Y variables, not the game data. These will be your reference data to check against new data.

Next, make a parallel event. This parallel event will do the following in this particular order:
1. regionID common event we talked about
2. Check player X vs the Old_X If player x doesn't equal Old_X, then the player has moved so you can remove an item and do whatever else you need to do if they have no item.
3. check Player y vs the Old_y, same as above.
4. Finally, make Old_X = player x again and do the same for Y.
This will basically catch whenever the player moves.
Yeah all of that makes sense and seems pretty sound. I've implemented all of those as common events.

Here's what I have so far.
I think I've done them right. It's a bit hard sometimes to remember the order things execute with how things are presented in this.

Where should I have all of this execute though?
Should I make an event on the world map that makes the XY variables = to the Old_XY variables?
Do I make another event on the map that runs parallel to do the hunger stuff?
Or does all of this run on the player?

Thanks for your help so far, sorry I'm a bit slow on the uptake.

*Edit*
Speaking of being slow on the uptake. I seem to have forgotten to make the oldX/Y = x/y after the player moves. Just pretend that's in the images.

*Edit edit*
Actually, looks like I think I've figured it out.
Apparently the editor has a way of tracking steps already. So I took the same principle and just checked the steps instead. Works like a charm!
 

Attachments

  • CommonEvents.jpg
    CommonEvents.jpg
    274.3 KB · Views: 5
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

Fire-Emblem Style Level Up System, Boost on Class Change, And Animated Arrows | RPG Maker News #115

Why keyboards don't sleep? Because they have two shifts.
I realized a while ago my game was toooo big in scope. even now I wonder am I trying to do too much by myself. and that's after completely changing the format of the game.
Last week at SLC. Cali awaits. TBH I love SLC more than SF.
Back home now. I had a good time, but I had a checkup this morning so I had to come home for that. Now I'm just waiting for my therapist meeting tomorrow...
Decided to work on Wishful Wanda today. Since it's a BFB spinoff game, I decided to make the Huang brothers
Easter eggs! I'm actually pitching this to the BFDI team, btw.

Forum statistics

Threads
113,939
Messages
1,078,538
Members
148,045
Latest member
gamegialap
Top