查看: 5775|回复: 5

[交流讨论] 有5帧行走图插件吗?

[复制链接]
梦石
0
星屑
801
在线时间
108 小时
注册时间
2016-7-9
回帖
28
发表于 2017-9-4 09:50:28 | 显示全部楼层 |阅读模式

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

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

×
MV 自带的是3帧的行走图,我有5帧的 人物行走动画 删除2帧的话 放进去怪怪的..怎么才能修改成5帧的!
梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2017-9-4 11:20:18 | 显示全部楼层
回复

使用道具 举报

梦石
0
星屑
2457
在线时间
912 小时
注册时间
2014-10-14
回帖
1155

开拓者

发表于 2017-9-5 20:52:12 | 显示全部楼层
本帖最后由 j296196585 于 2017-9-5 20:54 编辑

理论支持 无限幅


  1. //==============================================================================
  2. // Feng_MoveFrame.js
  3. //==============================================================================

  4. /*:
  5. * @plugindesc (v1.0)Define Character Sprites on your own.
  6. * 自定义行走图
  7. * @author 风宥雪
  8. *
  9. * @help This plugin does not provide plugin commands.
  10. * Version 1.0
  11. *
  12. *功能:自定义人物移动帧数,如name[s6][m12].png,表示人物6帧图片
  13. *为站立(stand)图,12帧图片为行走(move)图;
  14. *
  15. */
  16. Sprite_Character.prototype.setCharacterBitmap = function() {
  17.     //源代码
  18.     this.bitmap = ImageManager.loadCharacter(this._characterName);
  19.     this._isBigCharacter = ImageManager.isBigCharacter(this._characterName);
  20.     //以下为添加
  21.     this._character._total_frame = 0;
  22.     this._character._change_frame = false;
  23.     var sub_str = String(this._characterName).match(/\[s(\d+)\]/i);
  24.     if (sub_str)
  25.        {
  26.         this._character._frame_s = Number(sub_str[1]);
  27.         this._character._change_frame = true;
  28.         this._character._total_frame += this._character._frame_s;
  29.         }
  30.     else
  31.         this._character._frame_s = 0;
  32.     sub_str = String(this._characterName).match(/\[m(\d+)\]/i);
  33.     if (sub_str)
  34.        {
  35.         this._character._frame_m = Number(sub_str[1]);
  36.         this._character._change_frame = true;
  37.         this._character._total_frame += this._character._frame_m;
  38.         }
  39.     else
  40.         this._character._frame_m = 0;
  41.     if (this._character._total_frame == 0)  //防错处理
  42.         this._character._total_frame = 4;
  43. };

  44. Sprite_Character.prototype.characterBlockX = function() {
  45.     if(this._character._change_frame)
  46.         return  0;
  47.     else
  48.         {
  49.          if (this._isBigCharacter) {
  50.             return 0;
  51.             } else {
  52.                 var index = this._character.characterIndex();
  53.                 return index % 4 * 3;
  54.             }
  55.         }
  56. };

  57. Sprite_Character.prototype.characterBlockY = function() {
  58.     if(this._character._change_frame)
  59.         return  0;
  60.     else
  61.         {
  62.          if (this._isBigCharacter) {
  63.             return 0;
  64.             } else {
  65.                 var index = this._character.characterIndex();
  66.                 return Math.floor(index / 4) * 4;
  67.             }
  68.         }
  69. };

  70. Sprite_Character.prototype.patternWidth = function() {
  71.     if (this._tileId > 0) {
  72.         return $gameMap.tileWidth();
  73.     } else if(this._character._change_frame) {
  74.         return this.bitmap.width / this._character._total_frame;
  75.     } else  {
  76.          if (this._isBigCharacter) {
  77.              return this.bitmap.width / 3;
  78.              } else {
  79.         return this.bitmap.width / 12;
  80.              }
  81.         }
  82.     };

  83. Sprite_Character.prototype.patternHeight = function() {
  84.     if (this._tileId > 0) {
  85.         return $gameMap.tileWidth();
  86.     } else if(this._character._change_frame) {
  87.         return this.bitmap.height / 4;
  88.     } else {
  89.         if (this._isBigCharacter) {
  90.         return this.bitmap.height / 4;
  91.         } else {
  92.           return this.bitmap.height / 8;
  93.           }
  94.        }
  95.    };

  96. var feng_char_base_initMembers = Game_CharacterBase.prototype.initMembers;
  97. Game_CharacterBase.prototype.initMembers = function() {
  98.     feng_char_base_initMembers.call(this);
  99.     this._moveSpeed = 4;           //在这里可以更改角色移动速度
  100.     this._pattern = 0;
  101.     this._total_frame = 0;
  102.     this._change_frame = false;
  103.     this._frame_s = 0;
  104.     this._frame_m = 0;
  105. };


  106. Game_CharacterBase.prototype.updateAnimationCount = function() {
  107.     if (this.isMoving() && this.hasWalkAnime()) {
  108.         this._animationCount += 2.0; //在这里可以更改跑步动画刷新速度(默认1.5)
  109.     //静止有动态图时也要更新计数
  110.     } else if (this.hasStepAnime() || !this.isOriginalPattern() || this._frame_s > 1 || this.hasWalkAnime()) {
  111.         this._animationCount++;
  112.     }
  113. };

  114. Game_CharacterBase.prototype.updatePattern = function() {
  115.     if(this._change_frame)
  116.     {
  117.     if (!this.hasStepAnime() && this._stopCount > 0) {
  118.         if (this._frame_s == 0)
  119.             this._pattern = (this._pattern + 1) % this._frame_m;
  120.         else
  121.             this._pattern = (this._pattern + 1) % this._frame_s;
  122.     } else {
  123.         if (this._frame_m == 0)
  124.             this._pattern = (this._pattern + 1) % this._frame_s;
  125.         else//有行走图则采用行走图
  126.             {
  127.             var temp = (this._pattern - this._frame_s + 1) % this._frame_m;
  128.             this._pattern= this._frame_s + (temp > 0 ? temp : 0);
  129.             }
  130.         }
  131.     }
  132.     else
  133.     {
  134.       if (!this.hasStepAnime() && this._stopCount > 0) {
  135.         this.resetPattern();
  136.       } else {
  137.         this._pattern = (this._pattern + 1) % this.maxPattern();
  138.       }
  139.     }
  140. };
  141. Game_CharacterBase.prototype.maxPattern = function() {
  142.     return this._total_frame;
  143. };

  144. Game_CharacterBase.prototype.pattern = function() {
  145.     if(this._change_frame)
  146.         return this._pattern;
  147.     else
  148.         return this._pattern < 3 ? this._pattern : 1;
  149. };

  150. Game_CharacterBase.prototype.setDirection = function(d) {
  151.     if (!this.isDirectionFixed() && d) {
  152.         this._direction = d;
  153.     }
  154. };

复制代码
1[s15].png
NPC009[m4][s4].png
草药-延年果[s4].png
------落尽红樱君不见,轻绘梨花泪沾衣。~~~
回复

使用道具 举报

梦石
0
星屑
801
在线时间
108 小时
注册时间
2016-7-9
回帖
28
 楼主| 发表于 2017-9-11 01:02:52 | 显示全部楼层

谢谢大神!
回复

使用道具 举报

梦石
0
星屑
2457
在线时间
912 小时
注册时间
2014-10-14
回帖
1155

开拓者

发表于 2017-9-11 22:50:25 | 显示全部楼层

可惜了 论坛居然倒闭了
------落尽红樱君不见,轻绘梨花泪沾衣。~~~
回复

使用道具 举报

梦石
0
星屑
1166
在线时间
124 小时
注册时间
2014-5-29
回帖
10
发表于 2019-10-31 17:54:10 | 显示全部楼层

想問一下有沒有辦法ˋ改站立圖的速度
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部