MZ Having a Balloon Appear Based on Terrain Tag

Hi all.

If the player enters a certain terrain tag, then I would like a certain balloon icon to play only once until the player leaves that terrain tag. I am completely new to coding etc, so any advice will be very much appreciated.

As a practical example - when the player enters water (with its own terrain tag), a selected balloon should pop up and show only once until the player leaves.
I would suggest a plugin like RegionBase by triacontane. You can find it in the MZ install folder:
  • <MZ install folder>/dlc/BasicResources/plugins/official/RegionBase.js
Amongst other things, it lets you trigger an event when entering a region.

[Edit: triacontane released a bug patch, too (2024-01-28). Looks like it fixes airships being able to land on impassable regions/terrains.]

I think some parameters will still show help in Japanese instead of English, in which case:
It seems to be a small omission in the plugin code. I just tried this and it seemed to fix the problem:
  • Open the plugin in a text editor.
  • Find line 155: /*:ja (i.e. the start of the main Japanese plugin header).
  • Scroll down until you see these lines:
    • 194: /*~struct~Record:
    • 280: /*~struct~CommonEvent:
    These should both have the locale code ja after the :, i.e.
    • 194: /*~struct~Record:ja
    • 280: /*~struct~CommonEvent:ja

Alternatively you could do it with a Parallel event:
  • Get Location Info can get the region ID,
  • Use a switch to track whether the balloon has already been shown,
  • Add a wait command at the end because it doesn't need to check every frame.
I would suggest a plugin like RegionBase by triacontane. You can find it in the MZ install folder:
  • <MZ install folder>/dlc/BasicResources/plugins/official/RegionBase.js
Amongst other things, it lets you trigger an event when entering a region.

[Edit: triacontane released a bug patch, too (2024-01-28). Looks like it fixes airships being able to land on impassable regions/terrains.]

I think some parameters will still show help in Japanese instead of English, in which case:


Alternatively you could do it with a Parallel event:
  • Get Location Info can get the region ID,
  • Use a switch to track whether the balloon has already been shown,
  • Add a wait command at the end because it doesn't need to check every frame.
Thank you so much for your answer. I got to this (see screenshots) - it shows the balloon no problem, and I added a sound effect too...however, I would like this to not just be a "once off" thing...every time the player (in this case) enters the water, this must trigger.
If you're doing it with on-touch events, you can set it up so you have 2 events per entrance:
  • The "enter" event is in the water: it shows a balloon and turns the switch on.
  • The "exit" event is on the land: it turns the switch off.
So you can just add "exit" event(s) on the land tiles next to your existing event. 👋
Oh wow, I'm such an idiot! 😩

Thank you so much - I decided to go with the RegionBase plugin - and it works so well! As a thank you...I present to you the result of this labour!

This thread is being closed due to being solved. If you need it reopened, report it to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/having-a-balloon-appear-based-on-terrain-tag.167157/