查看: 14892|回复: 15

[原创发布] 【装备立绘纸娃娃2月2日更新】SceneEquip

[复制链接]

职业の水客

梦石
2
星屑
17082
在线时间
7500 小时
注册时间
2010-6-16
回帖
3466

极短27评委MZ评测员极短26评委开拓者

发表于 2016-1-30 11:38:20 | 显示全部楼层 |阅读模式

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

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

×
使用相关以及授权说明原创插件,用于本工作室一商业游戏内(已贩卖)
目前已卖了2个月,所以这个脚本干脆拿出来给各种朋友使用,有以下规定:
1·允许随意修改插件内容
2·修改插件内容后请保留作者信息
3·可以用于任何游戏
4·使用或修改本插件不需要授权
5·使用本插件请声明出自【赵氏面馆】
6·修改插件可以自由署名,但需保留第一作者信息~


本插件只适用于单主角显示,如果想要多人物就需要自己改了
支持多角色显示!感谢夏末渐离同学为此插件进行了拓展!
具体更新请看9L



插件不更新,不维护,不修BUG,不提供指导方法,不要问为啥用不了,如果出错可能是有BUG了,因为脚本是自用的,如有问题请自行找人解决
还有界面不够好看的 请自行找人修改插件 本人不提供任何帮助


使用方法
0·把插件放进js\plugins
1·在img目录下建立player文件夹
2·人物立绘名称 player
3·人物装备部件名称 clothes_X 这里的X是指装备设定的ID
4·补充看最下面图
5·补充图片素材以供测试使用


插件信息 /*:
* @plugindesc 装备界面立绘纸娃娃
* @author Joritian
*
* @param 第一层装备类型ID
* @default 1
*
* @param 第二层装备类型ID
* @default 2
*
* @param 第三层装备类型ID
* @default 3
*
* @param 第四层装备类型ID
* @default 4
*
* @help 立绘图片位于"img/player""人物图片文件名为"player.png",若装备ID为 XXX 则对应的文件应命名为"clothes_XXX.png".
*/


  1. //=============================================================================
  2. /*:
  3. * @plugindesc 装备界面立绘纸娃娃
  4. * @author Joritian
  5. *
  6. * @param 第一层装备类型ID
  7. * @default 1
  8. *
  9. * @param 第二层装备类型ID
  10. * @default 2
  11. *
  12. * @param 第三层装备类型ID
  13. * @default 3
  14. *
  15. * @param 第四层装备类型ID
  16. * @default 4
  17. *
  18. * @help 立绘图片位于"img/player""人物图片文件名为"player.png",若装备ID为 XXX 则对应的文件应命名为"clothes_XXX.png".
  19. */
  20. //=============================================================================

  21. var parameters = PluginManager.parameters('Scene_Equip');
  22. var equipZ = [
  23.         Number(parameters['第四层装备类型ID'] || 4),
  24.         Number(parameters['第三层装备类型ID'] || 3),
  25.         Number(parameters['第二层装备类型ID'] || 2),
  26.         Number(parameters['第一层装备类型ID'] || 1),
  27. ];

  28. Scene_Equip.prototype.create = function() {
  29.     Scene_MenuBase.prototype.create.call(this);
  30.        
  31.         this.createPlayerPicture();
  32.        
  33.     this.createHelpWindow();
  34.     this.createStatusWindow();
  35.     this.createCommandWindow();
  36.     this.createSlotWindow();
  37.     this.createItemWindow();
  38.     this.refreshActor();
  39. };

  40. Scene_Equip.prototype.createStatusWindow = function() {
  41.     this._statusWindow = new Window_EquipStatus(180, this._helpWindow.height);
  42.     this.addWindow(this._statusWindow);
  43. };

  44. Scene_Equip.prototype.createCommandWindow = function() {
  45.     var wx = this._statusWindow.width + 180;
  46.     var wy = this._helpWindow.height;
  47.     var ww = Graphics.boxWidth - this._statusWindow.width - 180;
  48.     this._commandWindow = new Window_EquipCommand(wx, wy, ww);
  49.     this._commandWindow.setHelpWindow(this._helpWindow);
  50.     this._commandWindow.setHandler('equip',    this.commandEquip.bind(this));
  51.     this._commandWindow.setHandler('optimize', this.commandOptimize.bind(this));
  52.     this._commandWindow.setHandler('clear',    this.commandClear.bind(this));
  53.     this._commandWindow.setHandler('cancel',   this.popScene.bind(this));
  54.     this._commandWindow.setHandler('pagedown', this.nextActor.bind(this));
  55.     this._commandWindow.setHandler('pageup',   this.previousActor.bind(this));
  56.     this.addWindow(this._commandWindow);
  57. };

  58. Scene_Equip.prototype.createSlotWindow = function() {
  59.     var wx = this._statusWindow.width + 180;
  60.     var wy = this._commandWindow.y + this._commandWindow.height;
  61.     var ww = Graphics.boxWidth - this._statusWindow.width - 180;
  62.     var wh = this._statusWindow.height - this._commandWindow.height;
  63.     this._slotWindow = new Window_EquipSlot(wx, wy, ww, wh);
  64.     this._slotWindow.setHelpWindow(this._helpWindow);
  65.     this._slotWindow.setStatusWindow(this._statusWindow);
  66.     this._slotWindow.setHandler('ok',       this.onSlotOk.bind(this));
  67.     this._slotWindow.setHandler('cancel',   this.onSlotCancel.bind(this));
  68.     this.addWindow(this._slotWindow);
  69. };

  70. Scene_Equip.prototype.createItemWindow = function() {
  71.     var wx = 180;
  72.     var wy = this._statusWindow.y + this._statusWindow.height;
  73.     var ww = Graphics.boxWidth - 180;
  74.     var wh = Graphics.boxHeight - wy;
  75.     this._itemWindow = new Window_EquipItem(wx, wy, ww, wh);
  76.     this._itemWindow.setHelpWindow(this._helpWindow);
  77.     this._itemWindow.setStatusWindow(this._statusWindow);
  78.     this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
  79.     this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
  80.     this._slotWindow.setItemWindow(this._itemWindow);
  81.     this.addWindow(this._itemWindow);
  82. };

  83. Scene_Equip.prototype.commandOptimize = function() {
  84.     SoundManager.playEquip();
  85.     this.actor().optimizeEquipments();
  86.     this._statusWindow.refresh();
  87.     this._slotWindow.refresh();
  88.     this._commandWindow.activate();
  89.         this.updateEquipPictrues();
  90. };

  91. Scene_Equip.prototype.commandClear = function() {
  92.     SoundManager.playEquip();
  93.     this.actor().clearEquipments();
  94.     this._statusWindow.refresh();
  95.     this._slotWindow.refresh();
  96.     this._commandWindow.activate();
  97.         this.updateEquipPictrues();
  98. };

  99. Scene_Equip.prototype.onItemOk = function() {
  100.     SoundManager.playEquip();
  101.     this.actor().changeEquip(this._slotWindow.index(), this._itemWindow.item());
  102.     this._slotWindow.activate();
  103.     this._slotWindow.refresh();
  104.     this._itemWindow.deselect();
  105.     this._itemWindow.refresh();
  106.     this._statusWindow.refresh();
  107.         this.updateEquipPictrues();
  108. };

  109. // TO DO

  110. Scene_Equip.prototype.createPlayerPicture = function() {

  111.         this._playerPicture = new Sprite(Bitmap.load("img/player/player.png"));
  112.         this._playerPicture.move(30, 150);
  113.        
  114.         this._equipPictrues = new Array();
  115.        
  116.         this.addChild(this._playerPicture);
  117.        
  118.         for(var i = 0; i < 4; i++)
  119.         {
  120.                 this._equipPictrues[i] = new Sprite();
  121.                 this._equipPictrues[i].move(30, 150);
  122.                 this.addChild(this._equipPictrues[i]);
  123.         }
  124.        
  125.         this.updateEquipPictrues();
  126. }

  127. Scene_Equip.prototype.updateEquipPictrues = function() {
  128.        
  129.         var playerEquips = $gameActors.actor(1).armors();
  130.        
  131.         for(var t = 0; t < 4; t++) {
  132.                 for(var i = 0; i < 4; i++) {
  133.                         if (playerEquips[i]) {
  134.                                 if (equipZ[t] == playerEquips[i].etypeId) {
  135.                                         this._equipPictrues[t].bitmap = Bitmap.load("img/player/clothes_" + playerEquips[i].id + ".png");
  136.                                         break;
  137.                                 }
  138.                         } else {
  139.                                 this._equipPictrues[t].bitmap = ImageManager.loadEmptyBitmap();
  140.                         }
  141.                         this._equipPictrues[t].update();
  142.                 }
  143.         }
  144. }
复制代码


素材(禁止任何途径的使用):
player.zip (214.91 KB, 下载次数: 577)

相关图片:
穿着:
1.png
穿着叠加:
2.png
插件设定:
说明.png
设定类型:
类型.png

点评

不好意思没看到使用相关  发表于 2016-2-1 13:29
请求扩展该插件的授权……  发表于 2016-1-31 11:00

评分

参与人数 2星屑 +132 梦石 +1 收起 理由
永恒の未知数 + 66
余烬之中 + 66 + 1 塞糖

查看全部评分

游戏开发工具集,一站式AI生图+图片完美像素化及相关处理网站。
群爆炸重建后状态:论坛老人最多(只剩下了活跃的老人),技术力很强(依旧不变)的编程灌水群:901540785
专门讨论RM相关的Q群:56875149
PS:第一个群不是专门讨论RM的,第二个才是哦。
PS2:接受MV/MZ插件定制(QQ763992443)
梦石
0
星屑
50
在线时间
81 小时
注册时间
2016-1-6
回帖
145
发表于 2016-1-30 12:12:06 | 显示全部楼层
这个好像很厉害,拿来试试,谢谢楼主分享
回复

使用道具 举报

梦石
0
星屑
50
在线时间
81 小时
注册时间
2016-1-6
回帖
145
发表于 2016-1-30 12:49:57 | 显示全部楼层
试用了一下,还是挺简单易用的,不过大概用于商业游戏的时候游戏主角只有一个,如果我用MV默认的四人队伍,进入装备栏之后,纸娃娃的效果只显示第一个人的装备情况,后面几个人的装备情况不会显示,我再研究研究,谢谢楼主分享

点评

是啊 我做的那个游戏是单主角的 并没有考虑多人物 有能力的可以自己改改  发表于 2016-1-30 14:57
回复

使用道具 举报

梦石
0
星屑
50
在线时间
258 小时
注册时间
2011-12-23
回帖
71
发表于 2016-1-30 16:31:22 | 显示全部楼层
这是极好的
[
回复

使用道具 举报

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
回帖
1464
发表于 2016-1-30 18:02:53 | 显示全部楼层
不错的样子

点评

今天脑抽了2333  发表于 2016-1-31 21:29
……额,其实b=a之后,b那个方法就是b了,t同时也是a,然后a变成另一个方法。  发表于 2016-1-31 21:24
好吧,私有变量index还是需要在原方法a里面加个return才能让b通过call访问到的……  发表于 2016-1-31 18:12
b.call(this,x,y),是相当于b(x,y),不过把里面的this变成传入的this。  发表于 2016-1-31 16:52
b=function(index){return index+1};a=function() {var index=1;var i=b.call(this,index); return i};alert(a());  发表于 2016-1-31 16:40
回复

使用道具 举报

梦石
0
星屑
50
在线时间
44 小时
注册时间
2008-2-29
回帖
37
发表于 2016-1-30 18:31:40 | 显示全部楼层
好东西!多谢楼主。

P.S.有人研究出来如何加上人物了吗=w=是要调用actorID这个参数吗?JS哭手QAQ
回复

使用道具 举报

梦石
0
星屑
575
在线时间
1752 小时
注册时间
2008-11-7
回帖
1111
发表于 2016-1-31 10:51:24 | 显示全部楼层
这图会2显示在 战斗中吗
RPG魔塔:http://rpg.blue/thread-254429-1-1.html
魔塔2:http://rpg.blue/thread-303601-1-1.html
魔塔3: 制作中...MV
回复

使用道具 举报

梦石
0
星屑
50
在线时间
81 小时
注册时间
2016-1-6
回帖
145
发表于 2016-1-31 13:33:19 | 显示全部楼层
z2z4 发表于 2016-1-31 10:51
这图会2显示在 战斗中吗

并不会,我看了下脚本,就是单纯的装备界面显示,如果要做到战斗中去,调用一下图片应该就行了,不过应该不适用于侧视战斗,里面涉及到很多东西。

点评

Scene_Equip跟Scene_Battle又不是同一个画面。  发表于 2016-1-31 21:30
回复

使用道具 举报

梦石
0
星屑
60
在线时间
306 小时
注册时间
2014-8-5
回帖
403
发表于 2016-2-1 13:39:40 | 显示全部楼层
本帖最后由 夏末渐离 于 2016-2-1 13:42 编辑

遵从使用规则:
1·允许随意修改插件内容
2·修改插件内容后请保留作者信息
定义了新的内容:1.插件需要utf-8格式的文档。
2.支持多主角的切换。
3.立绘图片位于"img/player",人物图片文件名格式为:playerID.png,如"player1.png",
4. 若装备类型ID为X,对应的装备图片文件名格式为:ID_clothes_X.png, 如"1_player_1.png"。


插件代码
  1. //=============================================================================
  2. /*:
  3. * @plugindesc 装备界面立绘纸娃娃
  4. * @author Joritian
  5. *
  6. * @param 第一层装备类型ID
  7. * @default 1
  8. *
  9. * @param 第二层装备类型ID
  10. * @default 2
  11. *
  12. * @param 第三层装备类型ID
  13. * @default 3
  14. *
  15. * @param 第四层装备类型ID
  16. * @default 4
  17. *
  18. * @help
  19. * 立绘图片位于"img/player",人物图片文件名格式为:playerID.png,如"player1.png",
  20. * 若装备类型ID为X,对应的装备图片文件名格式为:ID_clothes_X.png, 如"1_player_1.png"。
  21. *
  22. */
  23. //=============================================================================
  24. (function(){
  25.     var parameters = PluginManager.parameters('Scene_Equip');
  26.     var equipZ = [
  27.         Number(parameters['第四层装备类型ID'] || 4),
  28.         Number(parameters['第三层装备类型ID'] || 3),
  29.         Number(parameters['第二层装备类型ID'] || 2),
  30.         Number(parameters['第一层装备类型ID'] || 1),
  31.     ];

  32.     Game_Party.prototype.makeMenuActorNext = function() {
  33.         var index = this.members().indexOf(this.menuActor());
  34.         if (index >= 0) {
  35.             index = (index + 1) % this.members().length;
  36.             this.setMenuActor(this.members()[index]);
  37.         } else {
  38.             this.setMenuActor(this.members()[0]);
  39.         }
  40.         return index+1;
  41.     };
  42.     Game_Party.prototype.makeMenuActorPrevious = function() {
  43.         var index = this.members().indexOf(this.menuActor());
  44.         if (index >= 0) {
  45.             index = (index + this.members().length - 1) % this.members().length;
  46.             this.setMenuActor(this.members()[index]);
  47.         } else {
  48.             this.setMenuActor(this.members()[0]);
  49.         }
  50.         return index+1;
  51.     };

  52.     Scene_Equip.prototype.create = function() {
  53.         Scene_MenuBase.prototype.create.call(this);
  54.         this.createPlayerPicture();
  55.         this.createHelpWindow();
  56.         this.createStatusWindow();
  57.         this.createCommandWindow();
  58.         this.createSlotWindow();
  59.         this.createItemWindow();
  60.         this.refreshActor();
  61.     };

  62.     Scene_Equip.prototype.createStatusWindow = function() {
  63.         this._statusWindow = new Window_EquipStatus(180, this._helpWindow.height);
  64.         this.addWindow(this._statusWindow);
  65.     };

  66.     Scene_Equip.prototype.createCommandWindow = function() {
  67.         var wx = this._statusWindow.width + 180;
  68.         var wy = this._helpWindow.height;
  69.         var ww = Graphics.boxWidth - this._statusWindow.width - 180;
  70.         this._commandWindow = new Window_EquipCommand(wx, wy, ww);
  71.         this._commandWindow.setHelpWindow(this._helpWindow);
  72.         this._commandWindow.setHandler('equip',    this.commandEquip.bind(this));
  73.         this._commandWindow.setHandler('optimize', this.commandOptimize.bind(this));
  74.         this._commandWindow.setHandler('clear',    this.commandClear.bind(this));
  75.         this._commandWindow.setHandler('cancel',   this.popScene.bind(this));
  76.         this._commandWindow.setHandler('pagedown', this.nextActor.bind(this));
  77.         this._commandWindow.setHandler('pageup',   this.previousActor.bind(this));
  78.         this.addWindow(this._commandWindow);
  79.     };

  80.     Scene_Equip.prototype.createSlotWindow = function() {
  81.         var wx = this._statusWindow.width + 180;
  82.         var wy = this._commandWindow.y + this._commandWindow.height;
  83.         var ww = Graphics.boxWidth - this._statusWindow.width - 180;
  84.         var wh = this._statusWindow.height - this._commandWindow.height;
  85.         this._slotWindow = new Window_EquipSlot(wx, wy, ww, wh);
  86.         this._slotWindow.setHelpWindow(this._helpWindow);
  87.         this._slotWindow.setStatusWindow(this._statusWindow);
  88.         this._slotWindow.setHandler('ok',       this.onSlotOk.bind(this));
  89.         this._slotWindow.setHandler('cancel',   this.onSlotCancel.bind(this));
  90.         this.addWindow(this._slotWindow);
  91.     };

  92.     Scene_Equip.prototype.createItemWindow = function() {
  93.         var wx = 180;
  94.         var wy = this._statusWindow.y + this._statusWindow.height;
  95.         var ww = Graphics.boxWidth - 180;
  96.         var wh = Graphics.boxHeight - wy;
  97.         this._itemWindow = new Window_EquipItem(wx, wy, ww, wh);
  98.         this._itemWindow.setHelpWindow(this._helpWindow);
  99.         this._itemWindow.setStatusWindow(this._statusWindow);
  100.         this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
  101.         this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
  102.         this._slotWindow.setItemWindow(this._itemWindow);
  103.         this.addWindow(this._itemWindow);
  104.     };

  105.     Scene_Equip.prototype.commandOptimize = function() {
  106.         SoundManager.playEquip();
  107.         this.actor().optimizeEquipments();
  108.         this._statusWindow.refresh();
  109.         this._slotWindow.refresh();
  110.         this._commandWindow.activate();
  111.         this.updateEquipPictrues();
  112.     };

  113.     Scene_Equip.prototype.commandClear = function() {
  114.         SoundManager.playEquip();
  115.         this.actor().clearEquipments();
  116.         this._statusWindow.refresh();
  117.         this._slotWindow.refresh();
  118.         this._commandWindow.activate();
  119.         this.updateEquipPictrues();
  120.     };

  121.     Scene_Equip.prototype.nextActor=function(){
  122.         this._ActorIndex= $gameParty.makeMenuActorNext();
  123.         this.updateActor();
  124.         this.onActorChange();
  125.         this.refreshPictures();
  126.     };

  127.     Scene_Equip.prototype.previousActor = function() {
  128.         this._ActorIndex=$gameParty.makeMenuActorPrevious();
  129.         this.updateActor();
  130.         this.onActorChange();
  131.         this.refreshPictures();
  132.     };

  133.     Scene_Equip.prototype.onItemOk = function() {
  134.         SoundManager.playEquip();
  135.         this.actor().changeEquip(this._slotWindow.index(), this._itemWindow.item());
  136.         this._slotWindow.activate();
  137.         this._slotWindow.refresh();
  138.         this._itemWindow.deselect();
  139.         this._itemWindow.refresh();
  140.         this._statusWindow.refresh();
  141.         this.updateEquipPictrues();
  142.     };

  143. // TO DO

  144.     Scene_Equip.prototype.createPlayerPicture = function() {
  145.         this._ActorIndex=$gameParty.menuActor().index()+1;
  146.         this._playerPicture = new Sprite(Bitmap.load("img/player/player"+this._ActorIndex+".png"));
  147.         this._playerPicture.move(30, 150);
  148.         this._equipPictrues = new Array();
  149.         this.addChild(this._playerPicture);
  150.         for(var i = 0; i < 4; i++)
  151.         {
  152.             this._equipPictrues[i] = new Sprite();
  153.             this._equipPictrues[i].move(30, 150);
  154.             this.addChild(this._equipPictrues[i]);
  155.         }
  156.         this.updateEquipPictrues();
  157.     };

  158.     Scene_Equip.prototype.updateEquipPictrues = function() {

  159.         var playerEquips = $gameActors.actor(this._ActorIndex).armors();
  160.         for(var t = 0; t < 4; t++) {
  161.             for(var i = 0; i < 4; i++) {
  162.                 if (playerEquips[i]) {
  163.                     if (equipZ[t] == playerEquips[i].etypeId) {
  164.                         this._equipPictrues[t].bitmap = Bitmap.load("img/player/"+this._ActorIndex+"_clothes_" + playerEquips[i].id + ".png");
  165.                         break;
  166.                     }
  167.                 } else {
  168.                     this._equipPictrues[t].bitmap = ImageManager.loadEmptyBitmap();
  169.                 }
  170.                 this._equipPictrues[t].update();
  171.             }
  172.         }
  173.     };

  174.     Scene_Equip.prototype.refreshPictures=function(){
  175.         this._playerPicture.bitmap=Bitmap.load("img/player/player"+this._ActorIndex+".png");
  176.         this.updateEquipPictrues();
  177.     }

  178. }());
复制代码

点评

本人已G,有事烧纸。  发表于 2016-5-10 23:40
想請問一下 這個如何能增加層數呢? 有沒有 連動對話中立繪的方法呢?@A@  发表于 2016-4-25 21:05

评分

参与人数 2星屑 +50 梦石 +1 收起 理由
余烬之中 + 1 精品文章
寂静的夜里 + 50 不错

查看全部评分

  点我进入    
       ↓      
回复

使用道具 举报

梦石
0
星屑
50
在线时间
44 小时
注册时间
2008-2-29
回帖
37
发表于 2016-2-23 22:47:06 | 显示全部楼层
本帖最后由 蜡笔小猴子 于 2016-2-23 22:52 编辑
夏末渐离 发表于 2016-2-1 13:39
遵从使用规则:
1·允许随意修改插件内容
2·修改插件内容后请保留作者信息


感谢修改!
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部