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
219
Reaction score
118
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

Figured I would start posting what I am working on here. Anyways, a quest system plugin I have been working on:
20mgjmZ.png


What features would yall like to see in a quest system?
Playing my game to improve my game. (Totally not procrastinating)
Hope he recovers fast :|
Looks like it's functional:
It's a common thing to forget eating &drinking while you are working concentrated, right?
If I had discovered RPG-Maker before moving together with my girlfriend, I'd have died of dehydration a long time ago.

Forum statistics

Threads
112,500
Messages
1,068,726
Members
146,176
Latest member
Spooky_frog
Top