设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
搜索附件  
同能RPG制作大师 › 附件中心 › 同能RM技术讨论区 › RPG Maker MV 讨论区 › Star Passability Plugin!: TP_StarPassability.js

Star Passability Plugin!: TP_StarPassability.js

 

Star Passability Plugin!:
Hello fellow developers!

As many of you may already know of the star passability problem in the A-tilesheet, having looked around for so long without a definitive solution I finally stumbled across this https://forums.rpgmakerweb.com/index.php?threads/cityshrimps-cover-tiles.96380/
CityShrimp's Cover Tiles
It worked just fine but when I used it on a tile that had shadow on it it still worked but it removed the shadow from the tile.
So I decided to fix it and in the process I recreated it so now it's like a complete new plugin!

I've removed all the parts that I didn't need so that the plugin now just adds star passability to tiles.

It's use is pretty straight forward, just cover the tiles you want to have star passability with region ID and they will become star passable i.e. you will be able to walk under them.

In spite of  being a programmer I am by no way familiar with either Javascript nor RMMV JS library and with no clear references out there it was pretty hard developing this plugin, so please be aware that this plugin might cause bugs, instability, errors in your game or doesn't work at all!

I tested it and it works fine for me, so you can try using for yourself and see if it works for you.

This piece of code is free for commercial and non-commercial use!

No credit needed!

This plugin is based on CityShrimp's Cover Tiles plugin, link in the description above, so credit goes to CityShrimp.

If you're going to comment, ask a question, request a fix for the plugin I apologize in advance for by 99% most probably I'm not going to answer.

If updates in the plugin are made I'm gonna post them here.

Thank you.


/*=======================================================================

======
* ThePreparator's Star Passability
* TP_StarPassability.js
* Version: 1.0.0
* Free for commercial and non commercial use no credit nedeed!


*========================================================================

=====*/

/*:
* @plugindesc This plugin lets you add star passability to tiles that

don't have it.
*            
* @Author ThePreparator
*
* ===Parameter List===
*
* @param Star_Passability
* @desc This region ID will make the tile higher than the player i.e. it

will make you pass under the tile.
* @Default 19
*
* @Help
*

=========================================================================

===
*/

var Imported = Imported || {};
Imported['TP_StarPassability'] = "1.0.0";

var TP_StarPassability = TP_StarPassability || {};

(function($) {
    "use strict";

    // Load parameters
    $.parameters = PluginManager.parameters("TP_StarPassability") || {};
    $.Star_Passability = Number($.parameters['Star_Passability'] || 19);


    var old_Game_Map_checkPassage = Game_Map.prototype.checkPassage;
    Game_Map.prototype.checkPassage = function(x, y, bit) {
        var rid = this.regionId(x, y);
            if (rid == $.Star_Passability)
            return true;
        return old_Game_Map_checkPassage.call(this, x, y, bit);
    }


    ShaderTilemap.prototype._paintTiles = function(startX, startY, x, y)

{
        var mx = startX + x;
        var my = startY + y;
        var dx = x * this._tileWidth, dy = y * this._tileHeight;
        var tileId0 = this._readMapData(mx, my, 0);
        var tileId1 = this._readMapData(mx, my, 1);
        var tileId2 = this._readMapData(mx, my, 2);
        var tileId3 = this._readMapData(mx, my, 3);
        var shadowBits = this._readMapData(mx, my, 4);
        var lowerLayer = this.lowerLayer.children[0];
        var upperLayer = this.upperLayer.children[0];



        if (this._isHigherTile(tileId0) || $gameMap.regionId(mx, my) ==

$.Star_Passability) {
            this._drawTile(upperLayer, tileId0, dx, dy);


        } else {
            this._drawTile(lowerLayer, tileId0, dx, dy);
               }

        if (this._isHigherTile(tileId1) || $gameMap.regionId(mx, my) ==

$.Star_Passability) {
            this._drawTile(upperLayer, tileId1, dx, dy);

        } else {
            this._drawTile(lowerLayer, tileId1, dx, dy);         
        }


        if (this._isOverpassPosition(mx, my)) {
            this._drawTile(upperLayer, tileId2, dx, dy);
            this._drawTile(upperLayer, tileId3, dx, dy);
        }



        else {

            if ((this._isHigherTile(tileId2) || $gameMap.regionId(mx, my)

== $.Star_Passability) || (this._isHigherTile(tileId3) ||

$gameMap.regionId(mx, my) == $.Star_Passability)) {


            if ($gameMap.regionId(mx, my) == $.Star_Passability){
                this._drawShadow(upperLayer, shadowBits, dx, dy);}
            else{this._drawShadow(lowerLayer, shadowBits, dx, dy);}



                this._drawTile(lowerLayer, tileId2, dx, dy);
                this._drawTile(upperLayer, tileId3, dx, dy);

                        }

            else {
                this._drawTile(lowerLayer, tileId2, dx, dy);              

                this._drawTile(lowerLayer, tileId3, dx, dy);
            }   


        }

    };

})(TP_StarPassability);


本贴来自国际rpgmaker官方论坛作者:ThePreparator处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/star-passability-plugin.123621/
简体中文
繁體中文
English(英语)
日本語(日语)
Deutsch(德语)
Русский язык(俄语)
بالعربية(阿拉伯语)
Türkçe(土耳其语)
Português(葡萄牙语)
ภาษาไทย(泰国语)
한어(朝鲜语/韩语)
Français(法语)
关闭

幸运抽奖

社区每日抽奖来袭,快来试试你是欧皇还是非酋~

立即查看

Loading...

QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

GMT+8, 2026-10-3 14:08 , Processed in 0.109825 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

返回顶部