查看: 9036|回复: 16

[原创发布] MV改变游戏开始选项文字内容

[复制链接]
梦石
0
星屑
50
在线时间
8 小时
注册时间
2014-2-19
回帖
4
发表于 2015-12-21 12:24:13 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 林渊 于 2015-12-21 12:31 编辑

大家好,我叫Kai。
今天我为大家带来如何在MV改变游戏开始选项文字内容。

注意:这次教程改变游戏开始选项文字内容,功能是系统自己设置的,我只是借用了一下。

改变游戏开始选项文字内容需要4个文档:
js目录下的:
rpg_scenes.js
rpg_windows.js
rpg_managers.js
data目录下的:
System.json

改变游戏开始选项文字内容步骤如下:
1.在System.json添加你要的改变的内容
33.png
2.在rpg_managers.js添加内容
1.png
3.在rpg_windows.js添加内容
2.png
4.在rpg_scenes.js添加内容
3.png
5.完成图
344.png
大致上,就这四处改法。

评分

参与人数 1星屑 +266 收起 理由
余烬之中 + 266 0x0

查看全部评分

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
回帖
1464
发表于 2015-12-21 12:34:40 | 显示全部楼层
本帖最后由 余烬之中 于 2015-12-31 09:16 编辑

不推荐直接改脚本.

而且直接改脚本,1,2,3步改成一步就好
比如:
  1. //制作命令列表
  2. Window_TitleCommand.prototype.makeCommandList = function() {
  3. //添加一个选项 ,前面是显示内容,   后面是标志,用于方法调用时使用
  4.     this.addCommand(TextManager.newGame,   'newGame');
  5.     this.addCommand(TextManager.continue_, 'continue', this.isContinueEnabled());
  6.     this.addCommand(TextManager.options,   'options');
  7.     //如果要添添加一个项目可以直接添加文字
  8.     this.addCommand("第四个",   'four');
  9. };




  10. (function() {

  11. //制作命令列表
  12. Window_TitleCommand.prototype.makeCommandList = function() {
  13.     this.addCommand("新游戏",   'newGame');
  14.     this.addCommand("继续", 'continue', this.isContinueEnabled());
  15.     this.addCommand("设置",   'options');
  16.     this.addCommand("退出",   'four');
  17. };

  18. //创造选择窗口
  19. Scene_Title.prototype.createCommandWindow = function() {
  20.     this._commandWindow = new Window_TitleCommand();
  21.     //标志 绑定方法  也就是当点击相应选项时,会使用该选项标志 对应的方法
  22.     this._commandWindow.setHandler('newGame',  this.commandNewGame.bind(this));
  23.     this._commandWindow.setHandler('continue', this.commandContinue.bind(this));
  24.     this._commandWindow.setHandler('options',  this.commandOptions.bind(this));
  25.     //添加一个
  26.         this._commandWindow.setHandler('four', this.commandFour.bind(this));
  27.    
  28.     this.addWindow(this._commandWindow);
  29. };


  30. Scene_Title.prototype.commandFour = function() {
  31.     SceneManager.exit()
  32. };
  33. })();
复制代码
回复

使用道具 举报

梦石
0
星屑
50
在线时间
8 小时
注册时间
2014-2-19
回帖
4
 楼主| 发表于 2015-12-21 12:37:54 | 显示全部楼层
若如果出现中文乱码?
方法:
字体可以从C:\Windows\Fonts中获取。
把获得的字体放在fonts文件夹下。
修改fonts文件下夹的url中的字体名字。

按照以上方法修改,还出现了中文乱码?
方法:打开System.json另存为UTF-8即可。
回复

使用道具 举报

梦石
0
星屑
50
在线时间
8 小时
注册时间
2014-2-19
回帖
4
 楼主| 发表于 2015-12-21 12:40:37 | 显示全部楼层
汪汪 发表于 2015-12-21 12:34
不推荐直接改脚本.

插件管理器用的那种插件我写不大来,只会在原来的脚本改。( TдT)

点评

那种插件和这种差不多,直接复制一下相关部分,修改后放在一起就是一个插件了.  发表于 2015-12-21 12:44
回复

使用道具 举报

梦石
0
星屑
50
在线时间
8 小时
注册时间
2014-2-19
回帖
4
 楼主| 发表于 2015-12-21 13:08:59 | 显示全部楼层
汪汪 发表于 2015-12-21 12:34
不推荐直接改脚本.

而且直接改脚本,1,2,3步改成一步就好

好的,我会试着写一下单独文件的脚本。
不过我对MV的插件机制完全不懂,插件编写需要遵从什么规则不清楚,对插件无从下手,因为没有思路,所以写脚本比较慢。
我现在在看源程序,我觉得理解源程序对以后的插件编写是有帮助的,而且正好对这个有思路就修改了一下。
我觉得我要走脚本这一方面,插件的编写我觉得是必须要的。( ^ω^)
对于插件的编写,你有好的提议吗?

点评

插件就是把脚本的一部分修改,和原来rpg的一样,只不过mv弄了个插件管理器专门管理罢了.  发表于 2015-12-21 13:21
回复

使用道具 举报

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
回帖
1464
发表于 2015-12-21 13:22:26 | 显示全部楼层
本帖最后由 余烬之中 于 2015-12-31 09:15 编辑
  1. //-----------------------------------------------------------------------------
  2. // PluginManager
  3. // 插件管理器
  4. // The static class that manages the plugins.
  5. // 这个静态的类 管理 插件

  6. function PluginManager() {
  7.     throw new Error('This is a static class');
  8. }
  9. //路径
  10. PluginManager._path         = 'js/plugins/';
  11. //脚本
  12. PluginManager._scripts      = [];
  13. //错误地址
  14. PluginManager._errorUrls    = [];
  15. //参数
  16. PluginManager._parameters   = {};
  17. //安装
  18. PluginManager.setup = function(plugins) {
  19.     plugins.forEach(function(plugin) {
  20.         if (plugin.status && !this._scripts.contains(plugin.name)) {
  21.             this.setParameters(plugin.name, plugin.parameters);
  22.             this.loadScript(plugin.name + '.js');
  23.             this._scripts.push(plugin.name);
  24.         }
  25.     }, this);
  26. };
  27. //检查错误
  28. PluginManager.checkErrors = function() {
  29.     var url = this._errorUrls.shift();
  30.     if (url) {
  31.         throw new Error('Failed to load: ' + url);
  32.     }
  33. };
  34. //参数
  35. PluginManager.parameters = function(name) {
  36.     return this._parameters[name.toLowerCase()] || {};
  37. };
  38. //设置参数
  39. PluginManager.setParameters = function(name, parameters) {
  40.     this._parameters[name.toLowerCase()] = parameters;
  41. };
  42. //读取脚本
  43. PluginManager.loadScript = function(name) {
  44.     var url = this._path + name;
  45.     var script = document.createElement('script');
  46.     script.type = 'text/javascript';
  47.     script.src = url;
  48.     script.async = false;
  49.     script.onerror = this.onError.bind(this);
  50.     script._url = url;
  51.     document.body.appendChild(script);
  52. };
  53. //在错误
  54. PluginManager.onError = function(e) {
  55.     this._errorUrls.push(e.target._url);
  56. };
复制代码

点评

其实我也嫌这个太丑,改用[code]了0.0  发表于 2016-1-10 10:13
我找男票把这东西修好了 现在应该可以了  发表于 2015-12-31 11:23
能做的人都懒..  发表于 2015-12-31 10:27
能不能设置下这个版的脚本框默认js啊?  发表于 2015-12-31 10:10
脚本框 大哥..  发表于 2015-12-31 09:15
回复

使用道具 举报

梦石
0
星屑
50
在线时间
8 小时
注册时间
2014-2-19
回帖
4
 楼主| 发表于 2015-12-21 14:03:44 | 显示全部楼层
本帖最后由 林渊 于 2015-12-21 14:05 编辑
汪汪 发表于 2015-12-21 13:22
//-----------------------------------------------------------------------------
// PluginManager
// ...


我有点明白了,通过PluginManager来管理插件,通过loadScript把各个插件的内容放在main.js中,后面写的函数会覆盖前面的函数,有点了解了。之前虽然知道如何用插件管理器安装插件,但是不知道他是怎么安装的,不知道原理,感觉自己写会有问题,看了这段代码,感觉自己是想复杂了。谢谢啊。感觉有一点思路了写脚本了。
回复

使用道具 举报

梦石
0
星屑
50
在线时间
34 小时
注册时间
2016-1-7
回帖
56
发表于 2016-1-9 18:47:14 | 显示全部楼层
请问楼主..~ 有方法将 幵始  改为左上角吗 ?
回复

使用道具 举报

梦石
0
星屑
50
在线时间
34 小时
注册时间
2016-1-7
回帖
56
发表于 2016-1-9 18:47:54 | 显示全部楼层
汪汪 发表于 2015-12-21 13:22
//-----------------------------------------------------------------------------
// PluginManager
//  ...

请问有方法将   幵始      改为左上角吗 ?

点评

robber31 发表于 2016-1-9 18:47 请问有方法将 幵始 改为左上角吗 ? 请看第二页~ 我贴了出来  发表于 2016-1-9 21:42
左上角是指?  发表于 2016-1-9 19:55
回复

使用道具 举报

梦石
0
星屑
70
在线时间
269 小时
注册时间
2015-9-6
回帖
82
发表于 2016-1-9 21:19:11 | 显示全部楼层
如果只是改名字可以在数据库的术语里直接改,如果要加选项的话记得只用改rpg_scenes.js rpg_windows.js 这2个就够了。
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部