Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*:
- //=============================================================================
- // Maliki's Location Loader
- // MalLocationLoader.js
- // version 1.1
- //=============================================================================
- * @plugindesc Allows developers to move where players respawn upon loading a saved game.
- * @author Maliki79
- * @param Location Load X
- * @desc The Variable number of the X coordinate that saves will load.
- *
- * @param Location Load Y
- * @desc The Variable number of the Y coordinate that saves will load.
- *
- * @param Location Load MapID
- * @desc The Variable number of the Map ID that saves will load.
- *@help This script will require 3 game variables to function properly.
- *
- *First, designate 3 game variables for each an X, Y and MapID.
- *Note the variable's numbers in the plugin interface.
- *Then you must change the variables as appropriate for the desired
- *load point in-game.
- *You can do this via Variable Change Eventing.
- *
- *Once the variables are set, just save normally and upon loading,
- *the player will appear at the coordinates set.
- *
- *This plugin is turned off by default. In order to activate it,
- *you must make the script call LL_Active = true.
- *
- *If need be, you can disable it again by using LL_Active = false.
- *
- *Note: If you input the coordinates incorrectly, turn off the plugin from the
- *editor and reload the save. It should position the player at
- *the original save point, where you can edit the variables as needed.
- */
- var Mal = Mal || {};
- var LL_Active = false;
- Mal.Parameters = PluginManager.parameters('MalLocationLoader');
- Mal.Param = Yanfly.Param || {};
- Mal.Param.NewLoadX = Number(Mal.Parameters['Location Load X']);
- Mal.Param.NewLoadY = Number(Mal.Parameters['Location Load Y']);
- Mal.Param.NewLoadID = Number(Mal.Parameters['Location Load MapID']);
- var MalLocationLoader = Scene_Load.prototype.reloadMapIfUpdated
- Scene_Load.prototype.reloadMapIfUpdated = function() {
- if (LL_Active) {
- $gamePlayer.reserveTransfer($gameVariables.value(Mal.Param.NewLoadID), $gameVariables.value(Mal.Param.NewLoadX), $gameVariables.value(Mal.Param.NewLoadY));
- $gamePlayer.requestMapReload();
- } else {
- if ($gameSystem.versionId() !== $dataSystem.versionId) {
- $gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
- $gamePlayer.requestMapReload();
- }}
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement