设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 83|回复: 0

[转载发布] Star Passability Plugin!

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    8037

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    30081
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    39012

    灌水之王

    发表于 5 天前 | 显示全部楼层 |阅读模式
    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/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-1 10:43 , Processed in 0.106128 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表