マップ上の位置を選択して高速移動できるプラグイン – GALV_MapTravel.js

タイトル
A new scene allowing you to fast travel by selecting locations on a map
作者名
ヘルプ
Galv's
----------------------------------------------------------------------------
This plugin creates a new scene the player can fast travel to a selected
location on a map image using mouse or keyboard.

This plugin is not plug-and-play, users will require skills that allow them
to create their own map graphics and understand basic javascript (such as
arrays and string).

GRAPHICS

Graphics in this map travel scene are located in a new folder (you will
need to add to your project):
YourProject/img/maptravel/

The map graphic can be any size you wish and controls the size you scroll
around in the map travel scene.

The location graphics can be any size also, but require 3 x the location
image's height to hold 3 frames. Each frame shows at different times:
Top: Default on the map
Middle: When location is selected
Bottom: When location is disabled
View the plugin demo for example location graphics

Make sure you set your 3 location variables in the plugin settings and do
not use those variables for anything else in your game. These will hold the
mapid, x, y values to use in a "Transfer" event command.




----------------------------------------------------------------------------
SCRIPT CALLS
----------------------------------------------------------------------------
Step 1. Create a map
---------------------
To create a new map to use in the map travel scene, use this script call:

Galv.MAPT.createMap(id,"mapImage",[[bg],[bg]],[[fg],[fg]]);

INFO:
id = a unique number to identify the map you created
"mapImage" = the name of the map graphic to use from /img/maptravel/
this image will determine the size of your map in the scene
[bg] = an array to set up a background graphic behind the map image
You can have as many bg arrays as desired each should have:
["bgimage",xmove,ymove,opacity]
[fg] = works the same as bg arrays but instead for foreground images
["fgimage",xmove,ymove,opacity]



Step 2. Setting locations and objects
-------------------------------------
You can add as many locations to a map as required using the below script
call for each location added.

Galv.MAPT.setLocation(id,"name","image",mx,my,tmid,tx,ty,"desc",f);

INFO:
id = the unique number identifying the map you created above
"name" = the name of the location (also used to reference it)
"image" = the name of the location graphic to use from /img/maptravel/
this graphic requires 3 rows in the spritesheet for:
top = normal, middle = active, bottom = disabled
mx = the x postion on your map graphic for the location
my = the y postion on your map graphic for the location
tmid = transfer map id - the in-game map id to transfer to
tx = the in-game map x co-ordinate to transfer to
ty = the in-game map y co-ordinate to transfer to
"desc" = a short description displayed when location is selected.
Use the | symbol to specify a new line.
f = frames of animation in your location image. Don't include
this attribute to use the plugin setting default frames

Note that you can use this setLocation to overwrite a previously set one
using the same name if you want to change it to something else.

In addition to locations, you can add 'objects' that work in a similar
way but only have one row of graphics in the spritesheet and will not
appear in the location list.

Galv.MAPT.setObject(id,"name","image",mx,my,f);
Galv.MAPT.removeObject(id,"name");


Step 3. Calling the scene
--------------------------
To open up the map travel scene for the player to fast travel to a location
that has been added to their map:

Galv.MAPT.openMap(id); unique id set above for map to open
if map isn't created nothing happens



Other Script Calls
-------------------

Galv.MAPT.hasMap(id) use in conditional branch 'script' to check if
map has been created in the player's game yet

Galv.MAPT.mapSelected use in conditional branch after scene is run
to check if player selected a location or not


Galv.MAPT.initLocation("name"); set starting location of map scene to
this location.

Galv.MAPT.enableLocation(id,"name",s); s can be true or false to
set the location "name" in the
map id to enabled or disabled

Galv.MAPT.removeLocation(id,"name"); remove location from mapid list

Galv.MAPT.editLocation(id,"name","attribute",value); edit location

id = the map id you are editing
"name" = the location name you are editing
"attribute" = the attribute you would like to edit. This can be:
"image" value = "imageName"
"mapXY" value = [x,y]
"transfer" value = [mapid,x,y]
"desc" value = "description here"
value = the value to change to. values for each attribute are above.

EXAMPLE
Galv.MAPT.editLocation(0,"Your Mansion","desc","A new description!");

Alternatively you could just overwrite the entire location by using
Galv.MAPT.setLocation(id,"name","image",mx,my,tmid,tx,ty,"desc");
and inputting the same name as you are overwriting.

----------------------------------------------------------------------------
パラメータ
param Transfer Map Variable
desc The in game variable used to store map ID player will transfer to
default 1

param Transfer X Variable
desc The in game variable used to store the x coordinate the player will transfer to
default 2

param Transfer Y Variable
desc The in game variable used to store the y coordinate the player will transfer to
default 3

param Confirm Text
desc Text displayed in the confirm window for executing the travel
default Travel

param Cancel Text
desc Text displayed in the confirm window for cancelling.
default Cancel

param Confirm Window Width
desc The width of the confirm window
default 180

param Default Location Frames
desc The width of the confirm window
default 3

param Frame Speed
desc The speed of the frame animation (smaller is faster)
default 10

ライセンス表記

紹介ページ https://galvs-scripts.com/category/rmmv-plugins/mv-scenessystems/#post-2294