Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.
Original Source
- Original title: MV AltimitMovement Compatibility with Overpass script
- Original author: Vagus
- Original date: January 7, 2021
- Source thread: https://forums.rpgmakerweb.com/threads/altimitmovement-compatibility-with-overpass-script.131913/
- Source forum path: Game Development Engines > RPG Maker Javascript Plugins > JS Plugin Requests
Summary
AltimitMovement - Github OverpassTile-Fix - Site(Chinese) OverpassTile-Fix - Raw Spoiler: Overpass
Archived First Post
AltimitMovement - Github
OverpassTile-Fix - Site(Chinese)
OverpassTile-Fix - Raw
The Overpass script is found in the dlc folder of the RPG Maker MV files, under " KADOKAWA plugins". I've provided it hear for convenience.
Although I've found a similar plugin that is mostly compatible with AltimitMovement, it doesn't have the same functionality as Overpass. However, when used together something breaks. When on top of an overpass or transition, if the player touches the top or left border of the tile, they will "fall off" the overpass. If on top of a transition and touching the top or left sides of the tile, the game will think you are underneath nearby overpass regions.
These screenshots show both the layout of regions and what happens when the edge of the region is touched. Note that the player is cut off on #8.
I haven't got the foggiest clue how to fix this, but I figured someone out there might.
Any and all efforts are appreciated!
OverpassTile-Fix - Site(Chinese)
OverpassTile-Fix - Raw
//=============================================================================
// OverpassTile.js
//=============================================================================
/*:
* @plugindesc Settings for bridges which characters can pass through.
* @Author Yoji Ojima
*
* @param Overpass Region ID
* @desc The region ID for "overpass" such as bridges.
* @Default 255
*
* @param Gateway Region ID
* @desc The region ID for "gateway" such as bridge ends.
* @Default 254
*
* @Help
*
* This plugin uses region ID to determine a floor level.
* In default, set 255 to bridge tiles and 254 to ends of them.
*
* Note: This plugin does not support the collision judgment modification
* between characters who are in different floors.
*/
/*:ja
* @plugindesc キャラクターが下をくぐり抜けられる橋の設定です。
* @Author Yoji Ojima
*
* @param Overpass Region ID
* @desc 橋などの立体交差部分に設定するリージョンIDです。
* @Default 255
*
* @param Gateway Region ID
* @desc 橋の両端など、立体交差の入り口部分に設定するリージョンIDです。
* @Default 254
*
* @Help
*
* このプラグインは、床の高さを決定するのにリージョンIDを使用します。
* デフォルトでは橋の部分に255、その両端に254を設定してください。
*
* 注意:このプラグインは、異なる階層にいるキャラクター間の衝突判定修正は
* サポートしていません。
*/
(function() {
var parameters = PluginManager.parameters('OverpassTile');
var overpassRegionId = Number(parameters['Overpass Region ID'] || 255);
var gatewayRegionId = Number(parameters['Gateway Region ID'] || 254);
var _Tilemap_isOverpassPosition = Tilemap.prototype._isOverpassPosition;
Tilemap.prototype._isOverpassPosition = function(mx, my) {
var regionId = this._readMapData(mx, my, 5);
if (regionId === overpassRegionId) {
return true;
} else {
return _Tilemap_isOverpassPosition.call(this, mx, my);
}
};
var _Game_CharacterBase_screenZ = Game_CharacterBase.prototype.screenZ;
Game_CharacterBase.prototype.screenZ = function() {
if (this._higherLevel) {
return 5;
} else {
return _Game_CharacterBase_screenZ.call(this);
}
};
var _Game_CharacterBase_isMapPassable =
Game_CharacterBase.prototype.isMapPassable;
Game_CharacterBase.prototype.isMapPassable = function(x, y, d) {
if (_Game_CharacterBase_isMapPassable.call(this, x, y, d)) {
var x2 = $gameMap.roundXWithDirection(x, d);
var y2 = $gameMap.roundYWithDirection(y, d);
var d2 = this.reverseDir(d);
var regionId1 = $gameMap.regionId(x, y);
var regionId2 = $gameMap.regionId(x2, y2);
if (this._higherLevel && regionId1 !== gatewayRegionId) {
return (regionId2 === gatewayRegionId ||
regionId2 === overpassRegionId);
}
if (!this._higherLevel && regionId1 === overpassRegionId) {
if (regionId2 === overpassRegionId) {
var bit1 = (1 << (d / 2 - 1)) & 0x0f;
var bit2 = (1 << (d2 / 2 - 1)) & 0x0f;
var flags = $gameMap.tilesetFlags();
var tileId1 = $gameMap.tileId(x, y, 0);
var tileId2 = $gameMap.tileId(x, y, 1);
var tileId3 = $gameMap.tileId(x2, y2, 0);
var tileId4 = $gameMap.tileId(x2, y2, 1);
if ((flags[tileId1] | flags[tileId2]) & bit1) {
return false;
}
if ((flags[tileId3] | flags[tileId4]) & bit2) {
return false;
}
}
return regionId2 !== gatewayRegionId;
}
return true;
} else {
return false;
}
};
var _Game_CharacterBase_refreshBushDepth =
Game_CharacterBase.prototype.refreshBushDepth;
Game_CharacterBase.prototype.refreshBushDepth = function() {
_Game_CharacterBase_refreshBushDepth.call(this);
var regionId = this.regionId();
if (regionId === gatewayRegionId) {
this._higherLevel = true;
} else if (regionId !== overpassRegionId) {
this._higherLevel = false;
}
};
})();
// OverpassTile.js
//=============================================================================
/*:
* @plugindesc Settings for bridges which characters can pass through.
* @Author Yoji Ojima
*
* @param Overpass Region ID
* @desc The region ID for "overpass" such as bridges.
* @Default 255
*
* @param Gateway Region ID
* @desc The region ID for "gateway" such as bridge ends.
* @Default 254
*
* @Help
*
* This plugin uses region ID to determine a floor level.
* In default, set 255 to bridge tiles and 254 to ends of them.
*
* Note: This plugin does not support the collision judgment modification
* between characters who are in different floors.
*/
/*:ja
* @plugindesc キャラクターが下をくぐり抜けられる橋の設定です。
* @Author Yoji Ojima
*
* @param Overpass Region ID
* @desc 橋などの立体交差部分に設定するリージョンIDです。
* @Default 255
*
* @param Gateway Region ID
* @desc 橋の両端など、立体交差の入り口部分に設定するリージョンIDです。
* @Default 254
*
* @Help
*
* このプラグインは、床の高さを決定するのにリージョンIDを使用します。
* デフォルトでは橋の部分に255、その両端に254を設定してください。
*
* 注意:このプラグインは、異なる階層にいるキャラクター間の衝突判定修正は
* サポートしていません。
*/
(function() {
var parameters = PluginManager.parameters('OverpassTile');
var overpassRegionId = Number(parameters['Overpass Region ID'] || 255);
var gatewayRegionId = Number(parameters['Gateway Region ID'] || 254);
var _Tilemap_isOverpassPosition = Tilemap.prototype._isOverpassPosition;
Tilemap.prototype._isOverpassPosition = function(mx, my) {
var regionId = this._readMapData(mx, my, 5);
if (regionId === overpassRegionId) {
return true;
} else {
return _Tilemap_isOverpassPosition.call(this, mx, my);
}
};
var _Game_CharacterBase_screenZ = Game_CharacterBase.prototype.screenZ;
Game_CharacterBase.prototype.screenZ = function() {
if (this._higherLevel) {
return 5;
} else {
return _Game_CharacterBase_screenZ.call(this);
}
};
var _Game_CharacterBase_isMapPassable =
Game_CharacterBase.prototype.isMapPassable;
Game_CharacterBase.prototype.isMapPassable = function(x, y, d) {
if (_Game_CharacterBase_isMapPassable.call(this, x, y, d)) {
var x2 = $gameMap.roundXWithDirection(x, d);
var y2 = $gameMap.roundYWithDirection(y, d);
var d2 = this.reverseDir(d);
var regionId1 = $gameMap.regionId(x, y);
var regionId2 = $gameMap.regionId(x2, y2);
if (this._higherLevel && regionId1 !== gatewayRegionId) {
return (regionId2 === gatewayRegionId ||
regionId2 === overpassRegionId);
}
if (!this._higherLevel && regionId1 === overpassRegionId) {
if (regionId2 === overpassRegionId) {
var bit1 = (1 << (d / 2 - 1)) & 0x0f;
var bit2 = (1 << (d2 / 2 - 1)) & 0x0f;
var flags = $gameMap.tilesetFlags();
var tileId1 = $gameMap.tileId(x, y, 0);
var tileId2 = $gameMap.tileId(x, y, 1);
var tileId3 = $gameMap.tileId(x2, y2, 0);
var tileId4 = $gameMap.tileId(x2, y2, 1);
if ((flags[tileId1] | flags[tileId2]) & bit1) {
return false;
}
if ((flags[tileId3] | flags[tileId4]) & bit2) {
return false;
}
}
return regionId2 !== gatewayRegionId;
}
return true;
} else {
return false;
}
};
var _Game_CharacterBase_refreshBushDepth =
Game_CharacterBase.prototype.refreshBushDepth;
Game_CharacterBase.prototype.refreshBushDepth = function() {
_Game_CharacterBase_refreshBushDepth.call(this);
var regionId = this.regionId();
if (regionId === gatewayRegionId) {
this._higherLevel = true;
} else if (regionId !== overpassRegionId) {
this._higherLevel = false;
}
};
})();
The Overpass script is found in the dlc folder of the RPG Maker MV files, under " KADOKAWA plugins". I've provided it hear for convenience.
Although I've found a similar plugin that is mostly compatible with AltimitMovement, it doesn't have the same functionality as Overpass. However, when used together something breaks. When on top of an overpass or transition, if the player touches the top or left border of the tile, they will "fall off" the overpass. If on top of a transition and touching the top or left sides of the tile, the game will think you are underneath nearby overpass regions.
These screenshots show both the layout of regions and what happens when the edge of the region is touched. Note that the player is cut off on #8.
I haven't got the foggiest clue how to fix this, but I figured someone out there might.
Any and all efforts are appreciated!
Downloads / Referenced Files
Log in to download
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadCreator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
0
replies
1
view
Topic Summary
Loading summary...