RPG Maker MZ — Tricks & Tutorials

A working reference for this project — on-screen enemy behavior, mapping, event logic, and the custom art/data tools in this folder. Type to filter.

No tricks match that search.

On-screen enemies

Enemy "home" zone — region leash Easy EventsMoveCore

Goal: an enemy chases the player but can't leave its area. The cleanest version needs no scripting — just a painted region + one comment tag.

  1. In the map editor, switch the drawing layer to R (Region) and paint a region ID — say 10 — over every tile the enemy is allowed to stand on (the room, the clearing, etc.).
  2. Place your enemy event. In its active page, add a Comment command containing:
<Move Only Region: 10>

The engine now refuses to move that event onto any tile that isn't region 10 — a hard wall, regardless of what its move route asks for. (For several allowed regions: <Move Only Regions: 10, 11>.)

  1. Set the event's Autonomous Movement to Approach, with a Speed/Frequency that feels fair.

Result: it paths toward the player inside region 10 and stops dead at the boundary the moment the player steps out. Paint the region generously — a tight leash feels twitchy.

Telegraph the boundary so the rule reads instantly: make the home tiles look distinct (a rug, a fenced yard, a pool of light). When the enemy halts at the edge and turns back, that's a free teaching moment.

Distance leash + return-home Medium Vanilla

Goal: the "MMO aggro" feel — chase if you're near its den, otherwise walk back home and lose interest. Best for a single notable enemy.

  1. Give the enemy a second page that turns on when it spots you (see Sight detection below), or just run this on a Parallel Process page.
  2. Store the home tile once. On first run, save the event's start position to two variables (e.g. HomeX, HomeY) and flip Self Switch D so it only stores once.
  3. Each loop, branch on distance. In a Conditional Branch → Script:
const e = $gameMap.event(this.eventId());
const d = Math.abs(e.x - $gamePlayer.x) + Math.abs(e.y - $gamePlayer.y);
d <= 6;   // true = player is within 6 tiles → chase
  • If true → Set Movement Route (this event): Move toward Player.
  • Else → Set Movement Route: Move toward HomeX/HomeY; when it arrives, restore its facing and clear the chase self-switch.
Variables are global, so this exact recipe doesn't scale to a screen full of enemies (they'd share HomeX/HomeY). For many enemies, use the region leash above — or use the EnemyLeash plugin below, which stores home per-event and handles return/deaggro automatically.

EnemyLeash plugin — drop-in chaser Easy Plugin

Goal: everything the two recipes above do — sight, chase, leash containment, walk-home/deaggro — from a single comment tag, with the home stored per-event so it scales to a whole screen of enemies. Lives at js/plugins/EnemyLeash.js; place it below VisuMZ_1_EventsMoveCore.

Tag any event's page with a Comment command. The bare tag uses the plugin's default Sight/Leash params:

<Leash>

Add any of these on extra comment lines to tune that specific enemy:

<Leash>
<Sight: 6>
<Leash Range: 8>
<Home Region: 10>
<Chase Speed: 4>
<Return Speed: 3>
<Sight Needs Facing>
<Sight Needs LOS>
<Sight Shape: diamond>
<Give Up Balloon>
<Lose Sight Delay: 30>
  • Sight = detection radius; Leash Range = how far from spawn it pursues before giving up.
  • Home Region confines it to a painted region (combine with or instead of range).
  • Sight Needs Facing = only sees what's in front (stealth-able); Sight Needs LOS = walls block vision.
  • State machine: idle → chase (on sight, if you're within leash of home) → return (walks home when it loses you or you flee the leash) → idle.

For cutscenes/branches: thisEvent.isLeashChasing() and forceLeashAggro(). Respects the plugin's PauseDuringEvents and optional DisableSwitch.

Live demo: the $Slime in the DEBUG map (EV001) is tagged <Leash> <Sight: 6> <Leash Range: 8> <Sight Shape: diamond> <Give Up Balloon> — walk into its sight to see it chase and leash.

Sight detection — two-page enemy Medium Vanilla

Goal: the enemy idles/patrols until it notices you, then chases. A two-page event is the clean mental model.

  1. Page 1 (no conditions): idle or patrol movement. Add a Parallel or Autonomous check that flips Self Switch A ON when the player is within range (reuse the distance script above).
  2. Page 2 (condition: Self Switch A ON): set Autonomous Movement to Approach and add your <Move Only Region> comment so the chase still respects the home.
  3. To let it give up, flip Self Switch A OFF when the player gets far away again.
EventsMoveCore also offers proximity-activation tags such as <Activation Region: 10> and activation-distance options — check its help PDF if you want sight handled without a parallel loop.

Touch-to-battle, gone after winning Easy Vanilla

Goal: bumping the enemy starts a fight; winning removes it so it isn't there when you walk back.

  1. Set the event Trigger to Event Touch (enemy walks into you) or Player Touch.
  2. Command list: Battle Processing → on Win branch, Control Self Switch A = ON (or Erase Event for just this map visit).
  3. Add a Page 2 with condition Self Switch A ON and nothing on it — the defeated enemy now shows as empty/gone.

Use Erase Event for "respawns if I leave and return"; use a Self Switch for "stays dead."

Mapping & layout

Greybox before you draw Workflow

Block out every room with placeholder tiles and get the whole flow walkable before final art. Layout is nearly free to change while grey and painful to change after you've painted it. Test the entire critical path first; pretty it up second.

Beat the "too big" trap Design

Default room sizes feel right in the editor and cavernous in play. A bedroom can be 8×6 and feel more real than 15×15. Rule of thumb: if crossing an empty stretch takes more than ~2 seconds, shrink it or put something in it. Empty floor is dead air.

Passability & the ★ (star) flag Core

In Database → Tilesets, each tile gets a passage setting:

  • passable, blocked.
  • = drawn above the character — treetops, sign tops, anything you walk behind.
  • Arrow (□) settings allow one-directional passage (great for ledges/counters).

Wrong star flags are why players clip through walls or get pinned on flowers. Check this when a new tileset "looks wrong" in play.

Region IDs are free metadata Core

The R layer paints invisible 1–255 IDs onto tiles. Beyond the enemy leash, use them for: enemy spawn zones, footstep-sound areas, "no-encounter" safe tiles, terrain-tagged scripting. They cost nothing — lay them down as you build so the data's there when you want it.

Unlockable shortcuts & one-way doors Design

A door that only opens from one side turns tedious backtracking into a satisfying loop — cheap to build, big payoff. Implement as an event: locked page → on use/condition, flip a self-switch to the "open" page that transfers or removes the barrier.

Safe transfers between maps Core

  • Place transfer tiles at natural edges (doorways, map borders).
  • Set the arrival direction so the player faces into the new room.
  • Don't land the player on top of another event.
  • Run world-graph.html to see your whole map web and catch dead ends / unreachable maps. (Regenerate with node tools/world-graph.js.)

Never trap the player Gotcha

The classic soft-lock: a cutscene drops you somewhere with no walkable exit, or a "Through OFF" event boxes you in. Test that every area can be left, especially after cutscenes that move the party. Keep a debug transfer handy while building.

Events & logic

Self-switches & pages — the core pattern Core

An event's pages are read top-to-bottom; the engine runs the highest page whose conditions are all met. Self Switches (A–D) are per-event flags, perfect for "this chest is now open," "this NPC already talked," "this enemy is dead." Pattern: do something on Page 1 → set Self Switch A → Page 2 (cond: A ON) shows the new state. This single idea covers ~80% of event logic.

Parallel vs Autorun vs Autonomous Core

  • Autonomous Movement: how an event wanders on its own (Fixed/Random/Approach/Custom).
  • Autorun: runs immediately and freezes the player until it ends — for cutscenes; always end it (e.g. flip a self-switch to a blank page) or you lock the game.
  • Parallel: runs in the background while the player moves — for ongoing checks (sight, timers).
Many parallel events on one map = lag. Prefer one manager event running a single parallel loop over dozens of tiny ones.

Common Events for reused logic Core

Writing the same event chain twice? Move it to a Common Event and call it. Great for repeated interactions, shared cutscene beats, or skill side-effects (your project already reserves common events from skill notetags like <StudyEvent: N>).

Flavor / examine events for mood Design

EarthBound, Omori, and Look Outside feel alive because almost everything can be examined and says something. A plain bookshelf that prints one weird line does more for atmosphere than a beautifully drawn empty hall. Budget "examine" events as a worldbuilding resource — small, strange, specific.

Preview dialogue before you paste it Tool

message-previewer.html renders Show Text the way MZ will — control codes (\C \I \N \P \V \G \{ \}), line wrap, font sizing and window position — using this project's real font, icons, text colors and typewriter sound (all auto-loaded). It warns when a line is too wide, when you've written more lines than the window shows, and when a control code is mis-typed. Draft and sanity-check dialogue here, then paste the text into the event.

Art & asset workflow (this folder's tools)

Tight CSP → MZ art loop Workflow

With HotSpriteReload.js enabled, edit a PNG in Clip Studio, re-export over the project file, then in the running playtest press F8 — graphics reload instantly, no relaunch, game state preserved. (Default key; configurable in Plugin Manager.)

Validate tileset sizes before import Tool

Wrong-sized sheets slice wrong and glitch silently. Drop a sheet into tileset-validator.html, pick its slot (A1–A5, B–E), and it tells you the exact px size you should export at, plus draws the autotile-block grid.

Keep colors cohesive Tool

palette-extractor.html pulls a unified palette from your existing art, exports a swatch strip (load it into CSP and eyedrop) or a .gpl, then flags off-palette pixels in any new asset so the hand-drawn look doesn't drift.

Sprite-sheet layout & preview Tool

  • csp-template-generator.html — make a correctly sized guide overlay (grid + foot anchors) to draw under in CSP.
  • sprite-slicer.html — drop a character sheet and scrub the real MZ walk cycle (frames 0,1,2,1) to check it before it touches the editor.

One enemy → a rogues' gallery Tool

enemy-variant-generator.html takes one hand-drawn enemy and spins out hue-shifted / tinted variants so a single "thug" becomes a whole roster. Pairs with the on-screen enemy tricks above.

Preview autotile stitching Tool

autotile-assembler.html shows how an A2/A3/A4 block stitches into edges and corners using MZ's real autotile tables — sanity-check a drawn block before importing.

Data & custom systems

Notetag cheat-sheet + linter Tool

RPG Maker reads notetags case- and whitespace-sensitively, so a mis-typed key fails silently. node tools/notetag-tools.js lints all your custom tags (catching typos, wrong targets, bad references) and regenerates notetag-cheatsheet.html, a searchable list of every custom tag, where it goes, and an example.

Quick custom-notetag refresher Reference

A few you'll reach for often (full list in the cheat-sheet):

<Pronouns: she/her>            (Actor)
<Basic Attack Animation: 7>     (Actor or Enemy)
<Auto State: 19>                (Actor)  — auto-applies a state at low HP
<Auto State Threshold: 0.5>     (Actor)  — HP rate that triggers it
<Attack SE: name>               (Weapon / Actor / Enemy)
Put actor-only tags on the actor, not the class — MZ actor.meta doesn't inherit from class meta, so they silently do nothing on a class. The linter flags this.

See the whole game's shape Tool

node tools/world-graph.js parses every map's transfer events into a draggable node graph (world-graph.html): green start, blue reachable, amber dead end, red unreachable. The fastest way to spot a broken or orphaned area.