oasis-b

Docs / Map and world

LW_Pathfinding

Map and world
RPG Maker MV and MZ pathfinding plugin

Events and the player find their way around walls, to a tile, to another character, or follow someone.

Story & World Essentials ($9.99)Full Collection ($19.99)

Needs LW_Core (LWZ_Core in MZ) above all Living World plugins in the Plugin Manager. It's included in every pack.

Characters who find their way around the wall.

Highlights

Ideas for your game

Works well with

LW_CutsceneLW_RegionRulesLW_Overpass

Introduction

Requires LW_Core.

MV's own "move toward" gives up after a few tiles and walks into the first wall. This plugin searches the whole way (A*), so a guard finds the player through a maze and a villager walks around the market stalls.

If the goal is taken or can't be entered, the character stops on the nearest free tile next to it and turns towards it. If something steps into the way, it waits a moment and searches again. When there is no way at all it gives up after a few tries, so a waiting event never hangs. A forced move route always comes first.

Targets

player       the party leader
this         the event that runs the command
12           event ID 12
Guard        the event named "Guard"

Plugin Commands

LW_Path who x y              walks to tile x,y
LW_Path who to target        walks next to a character
LW_Path who follow target    keeps following a character
LW_Path who stop             stops walking
LW_WaitPath who              the event waits until who has arrived

Example: LW_Path Guard to player, then LW_WaitPath Guard.

Script Calls

character.lwPathTo(x, y)
character.lwPathToCharacter(other, follow)
character.lwPathBusy()                 true while walking
LW.findPath(character, x, y, nextTo)   list of directions or null

Terms of Use

See TERMS_OF_USE.txt in the download. Short version: use it in as many of your own games as you like, free or commercial. Edit it for your game, but keep this header. Don't share or resell the plugin files on their own. Name oasis-b in the credits of your game.

Changelog

Version 1.0.0 - 2026-11-21 - First release.

Plugin commands in MZ

In MZ these come as Plugin Command in the event editor, with fields to fill in. Old MV text commands from copied events keep working.

Walk To Tile

Walks to a tile, around everything in the way.

  • Who: player, this (the running event), an event ID or an event name. Default: this.
  • X (number) Default: 0.
  • Y (number) Default: 0.
  • Wait (boolean): The event waits until the walk is done. Default: false.

Walk Next To

Walks next to another character and turns to it.

  • Who: player, this (the running event), an event ID or an event name. Default: this.
  • Target: player, this, an event ID or an event name. Default: player.
  • Wait (boolean): The event waits until the walk is done. Default: false.

Follow

Keeps following another character until Stop.

  • Who: player, this (the running event), an event ID or an event name. Default: this.
  • Target Default: player.

Stop Walking

  • Who: player, this (the running event), an event ID or an event name. Default: this.

Wait For Arrival

The event waits until this character has arrived.

  • Who: player, this (the running event), an event ID or an event name. Default: this.

Introduction

Requires LWZ_Core.

MZ's own "move toward" gives up after a few tiles and walks into the first wall. This plugin searches the whole way (A*), so a guard finds the player through a maze and a villager walks around the market stalls.

If the goal is taken or can't be entered, the character stops on the nearest free tile next to it and turns towards it. If something steps into the way, it waits a moment and searches again. When there is no way at all it gives up after a few tries, so a waiting event never hangs. A forced move route always comes first.

Targets

player       the party leader
this         the event that runs the command
12           event ID 12
Guard        the event named "Guard"

Plugin Commands

Walk To Tile         walks to tile x,y
Walk Next To         walks next to a character
Follow               keeps following a character
Stop Walking         stops walking
Wait For Arrival     the event waits until that character has arrived

"Who" and "Target" take player, this (the running event), an event ID or the name of an event on the map. Walk To Tile and Walk Next To can wait on their own.

Script Calls

character.lwPathTo(x, y)
character.lwPathToCharacter(other, follow)
character.lwPathBusy()                 true while walking
LW.findPath(character, x, y, nextTo)   list of directions or null

Terms of Use

See TERMS_OF_USE.txt in the download. Short version: use it in as many of your own games as you like, free or commercial. Edit it for your game, but keep this header. Don't share or resell the plugin files on their own. Name oasis-b in the credits of your game.

Changelog

Version 1.0.0 - First release for MZ.

Get it

LW_Pathfinding is in these packs. Every pack comes as an MV and an MZ download at the same price and needs no other plugin collection. Tested in RPG Maker MV 1.6.2 and MZ 1.10.0 games on Windows, macOS and Linux and in current browsers.

Story & World Essentials ($9.99)Full Collection ($19.99)
← LW_OverpassLW_ForegroundLayer →