Question on using Region ID

Dimanda

Villager
Member
Joined
Feb 21, 2017
Messages
15
Reaction score
12
First Language
English
Primarily Uses
RMMV
I am really trying to understand how to make region id more effective, so my question is can you use region
id to allow a player to collect things? Basically I want to make a region lets say 7 blanketed across water locations
so a character can walk up to the water with a jar and collect water, with out having to event every water tile.
I feel that this should be done without having to have a plugin.
 

Hyouryuu-Na

Sapphire Sodium
Veteran
Joined
Jun 15, 2017
Messages
960
Reaction score
2,245
First Language
Not English
Primarily Uses
RMMV
It can be done.
Make a parallel event and insert this condition check (script):
Code:
$gamePlayer.regionId()==7 && Input.isTriggered('ok')
This will check if player is in region 7 and if they pressed enter. If this is true, collect water.
Note, I use MV but script calls should be more or less the same for both MV and MZ so I think this might work.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
Make a parallel event and insert this condition check (script):
bad idea - too many parallel processes increase the lag of the game, and there is no need to go scripting for something as simple as this.

@Dimanda
make the jar an item, and have that item call a common event.
in the common event, use two control variables to get the current player position
then use get location info with those two variables to get the region ID of the current tile into a third variable.
then conditional branch to check if that region ID is the one with water, if yes then gain the water.
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,531
Reaction score
1,424
First Language
English
Primarily Uses
RMMV
I think what they're after is to be able to *walk up* to water, not actually be on a water tile, in order to fill their jar. I'd do it this way (which is a lot how I made the fishing system for my game:

First, add the following code as a micro-plugin of sorts:

Code:
    Game_Map.prototype.facingTerrainTag = function()
    {
        var x = $gamePlayer.x;
        var y = $gamePlayer.y;
        var d = $gamePlayer.direction();
        if (d === 2) y += 1; // down
        if (d === 4) x -= 1; // left
        if (d === 6) x += 1; // right
        if (d === 8) y -= 1; // up
        return this.terrainTag(x, y);
    };
Next, in your tilesets, set the terrain tag (you know, that 0-7 number nobody seems to use for anything, ever?) to something besides 0 on any tile that's primarily water. For the sake of this example, let's go with "1".

Now, create an item (as mentioned above that is your water-collection jar, and have it call a common event when used. In this common event, have a conditional branch that uses the following script call as its condition:

Code:
$gameMap.facingTerrainTag() === 1
Now, just put your water jar fill instructions inside that branch and you're good to go. In the else, you can tell the player "you need to be facing a body of water!" or something.
 

Dimanda

Villager
Member
Joined
Feb 21, 2017
Messages
15
Reaction score
12
First Language
English
Primarily Uses
RMMV
Thank You everyone. I can also see a lot of potential for these.
@Aesica Yes this is what I was looking for. I appreciate this alot.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
in such a case you can use control variables and facing checks in the common event I mentioned to change the coordinated for checking the region ID on the adjacent tile.
Although that makes the common event much longer and much more complex and should only be done if you really don't want to mess with scripts.
 

Dimanda

Villager
Member
Joined
Feb 21, 2017
Messages
15
Reaction score
12
First Language
English
Primarily Uses
RMMV
@Andar Yeah I actually played around with your idea, I don't mind having long or complex common events, as I'm not a programmer and any time I can get around programming while creating my game
is a big plus. by the way I have been reading your tutorial, I'd love to bend your ear sometimes.
 

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,706
Reaction score
2,213
First Language
English
Primarily Uses
RMMV
A "region common event" plugin is pretty much a requirement for every project as far as I'm concerned. I don't think I've ever created a game without needing one of these as they're just so useful and things like you need here is exactly why. My recommendation would be to go this route. It'll save you a lot of effort and you'll likely find many other uses for it.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,447
Members
137,820
Latest member
georg09byron
Top