An open library of RPG Maker MZ plugins, powered by the community.

PGMZ - The Community-Driven Plugin Library for RPG Maker MZ

MZ plugins

NRP Map Travel - NRP_MapTravel.js

Plugin desc : v1.07 Implement a map selection & transfer screen.

License :
・Copyright: Retained
・Commercial Use: Allowed
・Modification: Allowed
・Redistribution: Allowed
・Details: See Download Page / In-plugin documentation

Author : Takeshi Sunagawa (http://newrpg.seesaa.net/)

Website : https://github.com/NewRPGProject/MZMV_Plugin/blob/main/NRP_MapTravel.js

Desc page : http://newrpg.seesaa.net/article/484927929.html

Download Page : https://raw.githubusercontent.com/NewRPGProject/MZMV_Plugin/main/NRP_MapTravel.js

File name : NRP_MapTravel.js

Help of plugin :

Implement a screen to transfer to the selected spot.
 * ※This function is equivalent to so-called fast travel.
 * 
 * ◆Main features
 * - Correspondence between the field and atlas to display each spot.
 * - Atlas image can be output from the editor.
 * - Can be directed by common event.
 * - Can be added to the menu screen.
 * - The icon can be displayed next to the spot name by switching it.
 *  For example, it can notify the spot where an event is occurring.
 * - Can be used as a simple atlas if movement is prohibited.
 * 
 * To avoid confusing you, I'll say no first.
 * In this plugin, terms are used with the following meanings.
 * 
 * - Map: The stage of the game. Data corresponding to MapXXX.json.
 * - Atlas: A map in a general sense,
 *          a diagram to know the location and terrain.
 * - Field: A map that corresponds to an atlas and is the parent of spots.
 * - Spot: A spot that is a child of the field (mostly town and dungeon).
 * 
 * Basically, I'm assuming that you want to map fields to spots,
 * but you can create a movement screen
 * that maps a town to facilities, for example.
 * 
 * -------------------------------------------------------------------
 * [Usage]
 * -------------------------------------------------------------------
 * Since this is a plugin with a lot of settings,
 * I will explain it in stages.
 * I will start with a method that does not use atlas.
 * 
 * ◆Basic
 * First, register to SpotList in the plugin parameters.
 * 
 * - SpotName
 * - TransferMapId
 * - TransferX
 * - TransferY
 * 
 * ...and other information.
 * 
 * Also, if you specify "ListingSwitch",
 * the spot will not be displayed until the switch is turned on.
 * 
 * Now you can run the plugin command.
 * ※No parameters need to be specified.
 * A simple spot selection & move screen can be achieved.
 * 
 * ◆Transfer Direction
 * However, the above alone is tasteless
 * without any player transfer direction.
 * So add a direction by calling the common event.
 * 
 * - TransferCommonEvent
 * - MapIdVariable
 * - XVariable
 * - YVariable
 * 
 * Set each plugin parameter above.
 * ※All of these are normal parameters, not in SpotList.
 * 
 * In this case, you need to describe the player transfer process
 * by yourself in the specified common event.
 * The coordinate information will be stored in the variable specified
 * in parameters, so please specify the destination in that variable.
 * 
 * After that, you can add your own direction
 * as you like in the event command.
 * You can also do something unusual, such as sending the user
 * to a different location if the transfer fails.
 * 
 * ◆Display Atlas
 * The atlas corresponding to the field can be displayed,
 * and each spot can be displayed as a point (symbol) on the atlas.
 * 
 * First, you need to prepare an atlas image.
 * The easiest way to do this is to select the map you want
 * to create an atlas for in the map tree,
 * and right-click and select "Save as Image" to output it.
 * Register the prepared image as a picture in the "FieldMapList"
 * and link it to the map ID.
 * 
 * You can also process the atlas by yourself
 * or create it completely by yourself.
 * The size of the atlas is also free,
 * as long as the proportions are correct.
 * 
 * ◆Display Spots on Atlas
 * If the coordinates on the field are set in
 * "TransferMapId", "TransferX", and "TransferY",
 * the spots will be displayed as symbols on atlas at this point.
 * 
 * The problem is when the destination is not a field,
 * such as in a town.
 * In this case, you need to enter the coordinates corresponding
 * to atlas for each spot.
 * 
 * - FieldMapId
 * - FieldX
 * - FieldY
 * 
 * Set each of the above items.
 * 
 * If you do not want the symbols to be displayed
 * from the start of the game, set "PointSwitch" to switch them.
 * You can use any switch with the same number as "ListingSwitch".
 * 
 * ◆Display of Current Location
 * Displaying the player's current location
 * on atlas is surprisingly difficult.
 * 
 * If the player is on the field, it will just refer to
 * the current coordinates, but if the player is in a spot
 * such as a town or dungeon, it will not.
 * 
 * Therefore, the coordinate information of the field
 * needs to be kept by you even when you are in the spot.
 * First, set the following items in the plugin parameter FieldMapList
 * to determine the variables to be retained.
 * 
 * - CurrentMapIdVariable
 * - CurrentXVariable
 * - CurrentYVariable
 * 
 * This plugin provides the following two automation methods.
 * 
 * 1. Retain the coordinates when the player is transferred
 *    from the field to the spot.
 * However, this does not apply when a player is transferred
 * from spot to spot due to an event.
 * The coordinates of the first spot you enter will be retained.
 * 
 * Also note that if you temporarily transfer a player
 * to the field during the staging of an event,
 * it will be targeted by this process.
 * 
 * 2. When a player is transferred to a spot,
 *    the coordinates for atlas are acquired.
 * The judgment whether it is a corresponding spot
 * is done by "TransferMapId".
 * If it is not enough, it can be added to "LocationUpdateMapId".
 * 
 * It is impractical to register all maps that belong to a spot.
 * Only maps that may be transferred from outside are sufficient.
 * 
 * ※If you want to register a spot that will not be displayed
 *   on the atlas, such as a dungeon, leave "TransferMapId" blank,
 *   and then set only "LocationUpdateMapId".
 * ※This function does not work for spots added
 *   with the "AddSpotList" plugin command for MZ. Please note this.
 * 
 * If you want to stop the automatic acquisition function
 * described above, you can also switch it by using the plugin parameters.
 * 
 * You can also set the values to the above variables manually,
 * without getting them automatically.
 * Please be flexible depending on the situation.
 * For example, there is a way to share the coordinates
 * with the escape coordinates from the dungeon.
 * 
 * -------------------------------------------------------------------
 * [Plugin Command MZ]
 * -------------------------------------------------------------------
 * ◆SceneStart
 * Display the spots selection screen.
 * It can also be used purely as atlas by specifying display-only.
 * 
 * It is also possible to add your own list by specifying "AddSpotList".
 * 
 * -------------------------------------------------------------------
 * [Plugin Command MV]
 * -------------------------------------------------------------------
 * ※No distinction is made between individual capital letters.
 * 
 * ◆SceneStart
 * > NRP.MapTravel.SceneStart
 * 
 * It will also be display-only in the following.
 * > NRP.MapTravel.SceneStart true
 * 
 * -------------------------------------------------------------------
 * [Terms]
 * -------------------------------------------------------------------
 * There are no restrictions.
 * Modification, redistribution freedom, commercial availability,
 * and rights indication are also optional.
 * The author is not responsible,
 * but will deal with defects to the extent possible.
 * 
 * @------------------------------------------------------------------
 * @ Plugin Command
 * @------------------------------------------------------------------
 * 
 * @command SceneStart
 * @desc Display the spots selection screen.
 * 
 * @arg AddSpotList
 * @type struct<Spot>[]
 * @desc An additional portion of the spot list to be displayed.
 * Bind to the plugin parameter SpotList.
 * 
 * @arg ReadOnly
 * @type boolean
 * @desc Player transfer is prohibited.
 * Intended for purely atlas use.
 * 
 * @arg HideCommonList
 * @type boolean
 * @desc It does not show the common spot list, but only the additional ones.
 * 
 * @arg DefaultIdentifier
 * @type text
 * @desc Initial selection spot for the cursor, corresponding to TransferIdentifier.
 * 
 * @------------------------------------------------------------------
 * @ Plugin Parameters
 * @------------------------------------------------------------------
 * 
 * @param SpotList
 * @type struct<Spot>[]
 * @desc This is a list of spots to be displayed.
 * Please include the display conditions.
 * 
 * @param FieldMapList
 * @type struct<FieldMap>[]
 * @desc This is a list of fields to be displayed as atlas.
 * Please register map IDs and images.
 * 
 * @param SymbolList
 * @type struct<Symbol>[]
 * @default ["{¥"SymbolId¥":¥"-1¥",¥"Memo¥":¥"Current Location¥",¥"SymbolImage¥":¥"¥",¥"BlinkPeriod¥":¥"60¥",¥"Opacity¥":¥"255¥",¥"<NoImage>¥":¥"¥",¥"SymbolColor¥":¥"rgb(0, 255, 255)¥",¥"SymbolRadius¥":¥"8¥"}","{¥"SymbolId¥":¥"0¥",¥"Memo¥":¥"Selected Spot¥",¥"SymbolImage¥":¥"¥",¥"BlinkPeriod¥":¥"¥",¥"Opacity¥":¥"128¥",¥"<NoImage>¥":¥"¥",¥"SymbolColor¥":¥"rgb(255, 0, 0)¥",¥"SymbolRadius¥":¥"12¥"}","{¥"SymbolId¥":¥"1¥",¥"Memo¥":¥"Each Spot¥",¥"SymbolImage¥":¥"¥",¥"BlinkPeriod¥":¥"120¥",¥"Opacity¥":¥"510¥",¥"<NoImage>¥":¥"¥",¥"SymbolColor¥":¥"rgb(255, 255, 255)¥",¥"SymbolRadius¥":¥"5¥"}"]
 * @desc A list of symbols (Each Spot, Selected Spot, and Current Location) that are displayed on atlas.
 * 
 * @param <TransferCommonEvent>
 * @desc Related to common events that are executed when transferring players.
 * 
 * @param TransferCommonEvent
 * @parent <TransferCommonEvent>
 * @type common_event
 * @desc A common event to be executed after spot selection.
 * Execute the player transfer within this event.
 * 
 * @param MapIdVariable
 * @parent <TransferCommonEvent>
 * @type variable
 * @desc This variable is used to store the map ID of the transfer destination after spot selection.
 * 
 * @param XVariable
 * @parent <TransferCommonEvent>
 * @type variable
 * @desc This variable is used to store the X coordinate of the transfer destination after spot selection.
 * 
 * @param YVariable
 * @parent <TransferCommonEvent>
 * @type variable
 * @desc This variable is used to store the Y coordinate of the transfer destination after spot selection.
 * 
 * @param IdentifierVariable
 * @parent <TransferCommonEvent>
 * @type variable
 * @desc A variable that stores the identification value after selecting a spot.
 * Useful if you want to do some processing for each spot.
 * 
 * @param <FieldMap>
 * @desc Items related to atlas and its corresponding field.
 * 
 * @param UpdateWhenExitField
 * @parent <FieldMap>
 * @type boolean
 * @default true
 * @desc Automatically update variables for atlas coordinates when transferring from a field to another map.
 * 
 * @param UpdateWhenEnterSpot
 * @parent <FieldMap>
 * @type boolean
 * @default true
 * @desc Automatically updates the variables for atlas coordinates when transferred to each spot.
 * 
 * @param SelectNearestSpot
 * @parent <FieldMap>
 * @type boolean
 * @default false
 * @desc When selecting a spot, the spot nearest to the player's current location is automatically selected initially.
 * 
 * @param CurrentSymbolId
 * @parent <FieldMap>
 * @type number @min -999 @max 999
 * @default -1
 * @desc The ID of the symbol that displays the current location.
 * 
 * @param SelectedSymbolId
 * @parent <FieldMap>
 * @type number @min -999 @max 999
 * @default 0
 * @desc This is the ID of the symbol that displays the currently selected spot.
 * 
 * @param <Layout>
 * @desc Layout-related items.
 * 
 * @param SpotListWidth
 * @parent <Layout>
 * @type number
 * @default 300
 * @desc The width of the spot list.
 * 
 * @param HelpHeight
 * @parent <Layout>
 * @type number
 * @desc The height of the help frame.
 * By default (blank), two lines are reserved; set to 0 to hide it.
 * 
 * @param ReadOnlyGray
 * @parent <Layout>
 * @type boolean
 * @default false
 * @desc All spots are grayed out for read only.
 * Distinguishes between travel and read only.
 * 
 * @param <Menu Command>
 * @desc These are the related items for displaying the Travel function in the menu command.
 * 
 * @param ShowMenuCommand
 * @parent <Menu Command>
 * @type boolean
 * @default false
 * @desc Add the Travel function to the menu command.
 * 
 * @param ShowMenuCommandPosition
 * @parent <Menu Command>
 * @type number
 * @default 4
 * @desc The position where the Travel function is inserted into the menu command. 0 is the first position.
 * 
 * @param TravelName
 * @parent <Menu Command>
 * @type text
 * @default Map Travel
 * @desc Set the display name of the Travel function.
 * 
 * @param MenuCommandSwitch
 * @parent <Menu Command>
 * @type switch
 * @desc Display the command only when the switch is on.
 * Always display if blank.
 * 
 * @param MaskString
 * @parent MenuCommandSwitch
 * @type string
 * @desc If MenuCommandSwitch is off, displays the specified string. If blank, hides the command itself.
 * 
 * @param DisableSwitch
 * @parent <Menu Command>
 * @type switch
 * @desc Disallow command only when switch is on.
 * Always allow if blank.
 * 
 * @param TravelSymbol
 * @parent <Menu Command>
 * @type text
 * @default maptravel
 * @desc Set the symbol for the Travel function. (For advanced users)
 * This value can be used when working with other plugins.
 * 
 * @param ReadOnlyMenu
 * @parent <Menu Command>
 * @type boolean
 * @default false
 * @desc Makes the Travel command reference-only.
 * Intended for use as atlas.
 * 
 * @param <Other>
 * @desc Other items.
 * 
 * @param StartCommonEvent
 * @parent <Other>
 * @type common_event
 * @desc A common event that is executed when a scene starts.
 * It can display messages, etc., but its function is limited.

スポンサードリンク

-MZ plugins

Copyright© PGMZ - The Community-Driven Plugin Library for RPG Maker MZ , 2025 All Rights Reserved.