查看: 20536|回复: 23

[原创发布] 米酒的RMMV的小插♂件开荒-不定期更新

[复制链接]

永夜蟄居の玖瀨

梦石
0
星屑
71
在线时间
1018 小时
注册时间
2011-9-5
回帖
2707

开拓者贵宾

发表于 2015-10-25 03:56:45 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

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

×
本帖最后由 千葉玖濑 于 2015-10-25 20:45 编辑

嗯…总之这个楼就是用来存放在下开荒MV无聊所弄的东西惹
按理说这些东西还是插到main的前面,或者用插件也行…
[fold=改变MV的鼠标光标]
QQ图片20151025034813.jpg
[pre lang="javascript" file="changeCursor.js"]//=============================================================================
// Pointerimage.js
/*:
* @plugindesc Change the cursor.
* @author Chiba Kunase.
*
* @help
* place the cursor.cur in img folder.
*/
//=============================================================================
    Scene_Title.prototype.initialize = function() {
    Scene_Base.prototype.initialize.call(this);
    document.getElementById('UpperCanvas').style.cursor='url(img/cursor.cur),auto';
    document.getElementById('ErrorPrinter').style.cursor='url(img/cursor.cur),auto';
};[/pre][/fold]
[fold=很蠢的跳过标题]事实上你把Title那一堆东西删了再加个Scene切换就可以直接实现跳过标题(趴
然而如果做成插件脚本就必须重定义原来Title里一堆创建窗口的方法,不然就会出现找不到某些属性的错误…结果就这么长了
[pre lang="Javascript" file="skiptitle.js"]//=============================================================================
// Skipthetitle.js
/*:
* @plugindesc Skip scene_title.
* @author Chiba Kunase.
*
* @help
* just trace on.
*/
//=============================================================================
Scene_Title.prototype.initialize = function() {
    Scene_Base.prototype.initialize.call(this);
    };

Scene_Title.prototype.create = function() {
    Scene_Base.prototype.create.call(this);
};

Scene_Title.prototype.start = function() {
    Scene_Base.prototype.start.call(this);
    SceneManager.clearStack();
    DataManager.setupNewGame();                                    
    SceneManager.goto(Scene_Map);                                 

};

Scene_Title.prototype.update = function() {
    Scene_Base.prototype.update.call(this);
};

Scene_Title.prototype.isBusy = function() {
    return false;
};

Scene_Title.prototype.terminate = function() {
    Scene_Base.prototype.terminate.call(this);
};[/pre][/fold]
[fold=角色八方向行走]嗯…因为鼠标寻路有问题暂时只做了键盘的……
[pre lang="javascript" file="8dir.js"]
//=============================================================================
// 8-dir move.js
/*:
* @plugindesc 8-dir move
* @author Chiba Kunase.
*
* @help
* just trace on.
*/
//=============================================================================

Game_Player.prototype.getInputDirection = function() {
    return Input.dir8;
};

Game_Player.prototype.executeMove = function(direction) {
    if (direction % 2 == 0)
    this.moveStraight(direction);
    if (direction == 1||direction ==3)
    this.moveDiagonally(direction+3 , 2);
    if (direction == 7||direction == 9)
    this.moveDiagonally(direction-3 , 8) ;
};

[/pre][/fold][fold=地图显示变量窗口]
[pre lang="javascript" file="mapvariables.js"]// Window_MapVariable
//
// The window for displaying the variable on the map screen.
/*:
* @plugindesc 在地图上显示变量窗口。
* @author 千叶玖瀬
*
* @param Variable
* @desc 需要显示变量的号码。
* @default 1
*
* @param Switch
* @desc 控制变量是否显示的开关
* @default 1

* @param Text
* @desc 在变量前显示的文字
*/
var parameters = PluginManager.parameters('mapvariables');
  var variableNumber = Number(parameters['Variable'] || 1);
  var switchNumber = Number(parameters['Switch'] || 1);

  var text = String(parameters['Text']||"");
function Window_MapVariable() {
    this.initialize.apply(this, arguments);
}
Window_MapVariable.prototype = Object.create(Window_Base.prototype);
Window_MapVariable.prototype.constructor = Window_MapVariable;

Window_MapVariable.prototype.initialize = function() {
    var wight = this.windowWidth();
    var height = this.windowHeight();
    Window_Base.prototype.initialize.call(this, 0, 0, wight, height);
    this.refresh();
};

Window_MapVariable.prototype.windowWidth = function() {
    return 300;
};

Window_MapVariable.prototype.windowHeight = function() {
    return this.fittingHeight(1);
};

Window_MapVariable.prototype.update = function() {
    this.refresh();
    Window_Base.prototype.update.call(this);
};

Window_MapVariable.prototype.open = function() {
    this.opacity = 255;
    this.refresh();
};
Window_MapVariable.prototype.refresh = function() {
    if ($gameSwitches._data[switchNumber] != true) {
        this.opacity = 0;
        this.contents.clear();
    }
    else{
        this.opacity = 255;
    this.contents.clear();
    var width = this.contentsWidth();
    this.drawText(text+ $gameVariables._data[variableNumber], 0, 0, width, 'center');
        }
    };
Scene_Map.prototype.createMapVariable = function() {
    this._mapVariable = new Window_MapVariable();
    this.addChild(this._mapVariable);
};
Scene_Map.prototype.createDisplayObjects = function() {
    this.createSpriteset();
    this.createMapNameWindow();
    this.createMapVariable();
    this.createWindowLayer();
    this.createAllWindows();
};
Scene_Map.prototype.callMenu = function() {
    SoundManager.playOk();
    SceneManager.push(Scene_Menu);
    Window_MenuCommand.initCommandPosition();
    $gameTemp.clearDestination();
    this._mapNameWindow.hide();
    this._mapVariable.hide();
    this._waitCount = 2;
};
Scene_Map.prototype.start = function() {
    Scene_Base.prototype.start.call(this);
    SceneManager.clearStack();
    if (this._transfer) {
        this.fadeInForTransfer();
        this._mapNameWindow.open();
        this._mapVariable.open();
        $gameMap.autoplay();
    } else if (this.needsFadeIn()) {
        this.startFadeIn(this.fadeSpeed(), false);
    }
    this.menuCalling = false;
};
Scene_Map.prototype.stop = function() {
    Scene_Base.prototype.stop.call(this);
    $gamePlayer.straighten();
    this._mapNameWindow.close();
    this._mapVariable.close();
    if (this.needsSlowFadeOut()) {
        this.startFadeOut(this.slowFadeSpeed(), false);
    } else if (SceneManager.isNextScene(Scene_Map)) {
        this.fadeOutForTransfer();
    } else if (SceneManager.isNextScene(Scene_Battle)) {
        this.launchBattle();
    }
};[/pre][/fold]

点评

我私自改成原创发布了 要常填坑哟~  发表于 2015-11-21 16:58

评分

参与人数 2星屑 +66 梦石 +2 赞 +1 收起 理由
Abyssstew + 1 塞糖
余烬之中 + 66 + 2 进图书馆 不填坑你何面目对我

查看全部评分


梦石
0
星屑
50
在线时间
36 小时
注册时间
2015-10-24
回帖
17
发表于 2015-10-25 09:07:14 | 显示全部楼层
等着出插件整合包
回复

使用道具 举报

梦石
0
星屑
4221
在线时间
1104 小时
注册时间
2008-5-17
回帖
199

开拓者

发表于 2015-10-25 10:28:36 | 显示全部楼层
看来JS大神还是很多的。。。。。。。
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2015-10-25 10:35:00 | 显示全部楼层
[fold=Skip the title][pre lang="ruby"]/*:
* @plugindesc Skip the title scene for testing purpose.
* @version 1.0
*/

(function() {

    Scene_Boot.prototype.start = function() {
        Scene_Base.prototype.start.call(this);
        SoundManager.preloadImportantSounds();
        if (DataManager.isBattleTest()) {
            DataManager.setupBattleTest();
            SceneManager.goto(Scene_Battle);
        } else {
            this.checkPlayerLocation();
            DataManager.setupNewGame();
            SceneManager.goto(Scene_Map);
        }
        this.updateDocumentTitle();
    };

})();[/pre][/fold]

点评

果然我那个玩法很蠢hhhhh_(:з」∠)_  发表于 2015-10-25 11:08
果然我那个玩法很蠢hhhhh_(:з」∠)_  发表于 2015-10-25 11:07
直接跳过了对title场景的创建么……  发表于 2015-10-25 11:07
回复

使用道具 举报

永夜蟄居の玖瀨

梦石
0
星屑
71
在线时间
1018 小时
注册时间
2011-9-5
回帖
2707

开拓者贵宾

 楼主| 发表于 2015-10-25 11:10:35 | 显示全部楼层
无名小兵 发表于 2015-10-25 10:28
看来JS大神还是很多的。。。。。。。

然而事实上是今天刚学的js……代码很糟糕| ू•ૅω•́)ᵎᵎᵎ

回复 1 1

使用道具 举报

梦石
0
星屑
38
在线时间
191 小时
注册时间
2010-11-9
回帖
53
发表于 2015-10-25 12:07:12 | 显示全部楼层
然而认识到直线最短的同时却不会绕路了。。。

点评

貌似是MV为了防止你用自动寻路过迷宫 故意把寻路算法弄成傻子类型(  发表于 2015-10-25 12:26
本来就不会绕路…我用默认工程点的时候他也是像傻子一样点不过去……  发表于 2015-10-25 12:21
回复

使用道具 举报

永夜蟄居の玖瀨

梦石
0
星屑
71
在线时间
1018 小时
注册时间
2011-9-5
回帖
2707

开拓者贵宾

 楼主| 发表于 2015-10-25 13:51:57 | 显示全部楼层
荼荼丸 发表于 2015-10-25 09:07
等着出插件整合包

已经把三个脚本转化成插件。把他保存到文件,加上js后缀,扔到plugin里面到游戏插件管理器就能看到。

点评

噫这方法好赞(  发表于 2015-10-25 19:47
在代码的[pre lang="javascript"] 的 javascipt后面 ]前面加上这样的file="xxxx.js",这样就可以让别人下载了。有些浏览器没法复制,这样比较好一些   发表于 2015-10-25 15:14
是米酒獭啦是PM所以是不能喝的(X  发表于 2015-10-25 13:57
我要喝米酒QAQ  发表于 2015-10-25 13:54

回复

使用道具 举报

梦石
0
星屑
38
在线时间
191 小时
注册时间
2010-11-9
回帖
53
发表于 2015-10-25 14:13:08 | 显示全部楼层
嘛,不是这个意思啦。
原版的确没办法走到地图外的通路,但可见的通路是可以的(至少我是可以的)
但你的脚本似乎是两点之间有障碍就走不过去了
最直观的就是面前一张长桌子,主角是绕不过去的,
或者是走那种一格宽的路拐直角的地方,除非站在路口前一格,否则都是过不去的,但这些原版都还是没问题的。
当然没有寻路功能呢倒是不要紧,我也很反对傻子系统,
但是到玩的时候用鼠标触碰等操作起来容错率太低还是会影响体验(有追逐性质的游戏神马的),所以觉得还是多一两格的容错会比较好
个人观点咯。。。

点评

嗯等我把那个寻路算法解决了应该还会发(X  发表于 2015-10-25 14:22
回复

使用道具 举报

永夜蟄居の玖瀨

梦石
0
星屑
71
在线时间
1018 小时
注册时间
2011-9-5
回帖
2707

开拓者贵宾

 楼主| 发表于 2015-10-25 14:20:45 | 显示全部楼层
losyK 发表于 2015-10-25 14:13
嘛,不是这个意思啦。
原版的确没办法走到地图外的通路,但可见的通路是可以的(至少我是可以的)
但你的脚 ...

…我刚才也发现这个bug了嗯…应该是我把他自带寻路算法给弄掉了…所以说正在改orz
原版还是有一点绕道的智商然而改了算法之后就只能走直线了2333...
暂时先把键盘八方向挂着然后鼠标寻路慢慢修补(ノ゚∀゚)ノ……

点评

干巴爹(ノ゚∀゚)ノ  发表于 2015-10-25 14:35

回复

使用道具 举报

梦石
0
星屑
80
在线时间
386 小时
注册时间
2007-7-27
回帖
4075

开拓者

发表于 2015-10-25 15:45:36 | 显示全部楼层
八方向和跳过标题我记得自带的插件里面有
不过没有斜方向的行走图的八方向实在是有点……难看
吸吸
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部