查看: 3436|回复: 8

[已经解决] 請問使用插件讀取檔案失敗問題

[复制链接]
梦石
0
星屑
497
在线时间
266 小时
注册时间
2015-12-8
回帖
729
发表于 2016-1-5 02:04:58 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 余烬之中 于 2016-6-21 18:15 编辑

來源:
https://atelierrgss.wordpress.com/rmv-battler-motion/

我用了這個插件之後,如果讀取檔案就會失敗,但是新建遊戲就正常,在RPG裡面測試也是正常

出錯訊息是

用網頁的話會出現
TypeError
this._motion_idle_xy is undefined

應用程序出現
TypeError
cannot read property '0' of undefined


除錯通知
TypeError: Cannot read property '0' of undefined
    at Game_Actor.Game_Battler.motion_Xaxis (MOG_BattlerMotion.js:194)
    at Sprite_Actor.Sprite_Battler.update_bmotion_position (MOG_BattlerMotion.js:438)
    at Sprite_Actor.Sprite_Battler.updatePosition (MOG_BattlerMotion.js:422)
    at Sprite_Actor.Sprite_Battler.setHome (rpg_sprites.js:487)
    at Sprite_Actor.setActorHome (YEP_BattleEngineCore.js:2513)
    at Sprite_Actor.setBattler (rpg_sprites.js:720)
    at Spriteset_Battle.updateActors (rpg_sprites.js:2626)
    at Spriteset_Battle.update (rpg_sprites.js:2418)
    at Spriteset_Battle.update (YEP_BattleEngineCore.js:2702)
    at Spriteset_Battle.Spriteset_Base.initialize (rpg_sprites.js:2121)

腳本以下
  1. //=============================================================================
  2. // MOG_BattlerMotion.js
  3. //=============================================================================

  4. /*:
  5. * @plugindesc (v1.2) Adiciona efeitos animados nos battlers.
  6. * @author Moghunter
  7. *
  8. * @param Shake Effect Actor
  9. * @desc Ativar o efeito tremer no aliado.
  10. * @default true
  11. *
  12. * @param Shake Effect Enemy
  13. * @desc Ativar o efeito tremer no aliado.
  14. * @default true
  15. *
  16. * @param Disable Blink Damage
  17. * @desc Desativar o efeito de piscar o battler no dano.
  18. * @default false   
  19. *
  20. * @help  
  21. * =============================================================================
  22. * +++ MOG - Battler Motion (v1.2) +++
  23. * By Moghunter
  24. * https://atelierrgss.wordpress.com/
  25. * =============================================================================
  26. * Adiciona efeitos animados nos battlers.
  27. *
  28. * =============================================================================
  29. * Para definir a animação de ação use a Tag abaixo na caixa de notas da skill.
  30. *
  31. * Motion Action: X
  32. *
  33. * 1 - Efeito Zoom.
  34. * 2 - Efeito giro para direita.
  35. * 3 - Efeito giro para esquerda.
  36. * 4 - Efeito pular.
  37. * 5 - Efeito ataque frontal.
  38. * 6 - Efeito rotação.
  39. * 7 - Efeito mover para direita.   
  40. *
  41. * =============================================================================
  42. * Para ativar os esfeitos de animações em posição de espera use as Tags abaixo.
  43. *
  44. * Breath Effect
  45. * Float Effect
  46. * Swing Effect
  47. *
  48. * =============================================================================
  49. * Histórico.
  50. * =============================================================================
  51. * (1.2) - Correção de não atualizar o efeito ao transformar o inimigo.
  52. *       - Correção do efeito tremer ao reviver o aliado.
  53. * (1.1) - Melhoria na animação de ação.
  54. *
  55. */

  56. //=============================================================================
  57. // ** PLUGIN PARAMETERS
  58. //=============================================================================
  59.   var Imported = Imported || {};
  60.   Imported.MOG_BattlerMotion = true;
  61.   var Moghunter = Moghunter || {};

  62.     Moghunter.parameters = PluginManager.parameters('MOG_BattlerMotion');
  63.     Moghunter.b_motion_shake_effect_actor = String(Moghunter.parameters['Shake Effect Actor'] || "true");
  64.     Moghunter.b_motion_shake_effect_enemy = String(Moghunter.parameters['Shake Effect Enemy'] || "true")
  65.     Moghunter.b_motion_disable_blink_damage = String(Moghunter.parameters['Disable Blink Damage'] || "false")
  66.        
  67. //=============================================================================
  68. // ** Game System
  69. //=============================================================================

  70. //==============================
  71. // * Initialize
  72. //==============================
  73. var _alias_mog_bmotion_sys_initialize = Game_System.prototype.initialize
  74. Game_System.prototype.initialize = function() {
  75.         _alias_mog_bmotion_sys_initialize.call(this);
  76.         this._bmotion = [false,false,false];
  77.     if (String(Moghunter.b_motion_shake_effect_actor) === "true") {this._bmotion[0] = true};
  78.         if (String(Moghunter.b_motion_shake_effect_enemy) === "true") {this._bmotion[1] = true};
  79.         if (String(Moghunter.b_motion_disable_blink_damage) === "true") {this._bmotion[2] = true};
  80. };

  81. //=============================================================================
  82. // ** Game Action
  83. //=============================================================================

  84. //==============================
  85. // * Prepare
  86. //==============================
  87. var _alias_mog_bmotion_gaction_prepare = Game_Action.prototype.prepare
  88. Game_Action.prototype.prepare = function() {       
  89.         _alias_mog_bmotion_gaction_prepare.call(this);
  90.         if (this.subject().isEnemy()){this.set_bmotion_action();};
  91. };

  92. //==============================
  93. // * Set Bmotion Action
  94. //==============================
  95. Game_Action.prototype.set_bmotion_action = function() {       
  96.         var item_notes = this._item.object().note.split(/[\r\n]+/);
  97.     item_notes.forEach(function(note) {
  98.          var note_data = note.split(': ')
  99.                  if (note_data[0].toLowerCase() == "motion action"){
  100.                          var par = note_data[1].split(':');
  101.                            this.subject().clear_action_data();
  102.                this.subject()._motion_action_data[0] = Number(par[0]);
  103.          }
  104.         },this);
  105. };

  106. //=============================================================================
  107. // ** Game Battler
  108. //=============================================================================

  109. //==============================
  110. // ** iniMembers
  111. //==============================
  112. var _alias_mog_bmotion_gbattler_initMembers = Game_Battler.prototype.initMembers;
  113. Game_Battler.prototype.initMembers = function() {
  114.         _alias_mog_bmotion_gbattler_initMembers.call(this);
  115.         this.set_motion_data();       
  116. };

  117. //==============================
  118. // * Notetags
  119. //==============================
  120. Game_Battler.prototype.notetags = function() {
  121.         if (this.isEnemy) {return this.enemy().note.split(/[\r\n]+/)};
  122.         if (this.isActor) {return this.actor().note.split(/[\r\n]+/)};
  123. };

  124. //==============================
  125. // ** Set Motion Data
  126. //==============================
  127. Game_Battler.prototype.set_motion_data = function() {
  128.         this.clear_action_data();
  129.         this._motion_damage_duration = 0;
  130.         this._motion_damage_xy = [0,0];
  131.         this._motion_idle_xy = [0,0];
  132.         this._motion_idle_scale = [1.00,1.00];
  133.         this._motion_idle_rotation = 0;       
  134.         this._motion_collapse_scale = [0,0];
  135.         this._motion_collapse_rotation = 0;
  136.         this._motion_breath = [0,0,0,1.03,0,false];
  137.         this._motion_fly = [0,0,0,60,0.35,false];
  138.         this._motion_swing = [0,0.003,0.10,60,0.35,false];
  139. };

  140. //==============================
  141. // ** Clear Action Data
  142. //==============================
  143. Game_Battler.prototype.clear_action_data = function() {
  144.         this._motion_action_data = [0,0,0,0];
  145.         this._motion_action_xy = [0,0];
  146.         this._motion_action_scale = [0,0];
  147.         this._motion_action_rotation = 0;
  148. };

  149. //==============================
  150. // ** Is MotionActing
  151. //==============================
  152. Game_Battler.prototype.is_motionActing = function() {
  153.         return this._motion_action_data[0] != 0;
  154. };

  155. //==============================
  156. // ** Set Battler Motion Data
  157. //==============================
  158. Game_Battler.prototype.set_battler_motion_data = function() {
  159.         for (var i = 0; i < this.notetags().length; i++) {               
  160.                 if (this.notetags()[i] == "Breath Effect") {this._motion_breath[5] = true};
  161.                 if (this.notetags()[i] == "Float Effect") {this._motion_fly[5] = true};
  162.                 if (this.notetags()[i] == "Swing Effect") {this._motion_swing[5] = true};
  163.         };       
  164. };

  165. //==============================
  166. // ** OnBattleStart
  167. //==============================
  168. var _alias_mog_bmotion_gbattler_onBattleStart = Game_Battler.prototype.onBattleStart;
  169. Game_Battler.prototype.onBattleStart = function() {
  170.     _alias_mog_bmotion_gbattler_onBattleStart.call(this);
  171.         this.set_motion_data();
  172. };

  173. //==============================
  174. // ** Motion Xaxis
  175. //==============================
  176. Game_Battler.prototype.motion_Xaxis = function() {
  177.         return this._motion_idle_xy[0] + this._motion_action_xy[0] +  this._motion_damage_xy[0]
  178. };

  179. //==============================
  180. // ** Motion Yaxis
  181. //==============================
  182. Game_Battler.prototype.motion_Yaxis = function() {
  183.         return this._motion_idle_xy[1] + this._motion_action_xy[1] +  this._motion_damage_xy[1]
  184. };

  185. //==============================
  186. // ** Motion ScaleX
  187. //==============================
  188. Game_Battler.prototype.motion_ScaleX = function() {
  189.         return this._motion_idle_scale[0] + this._motion_action_scale[0] + this._motion_collapse_scale[0];
  190. };

  191. //==============================
  192. // ** Motion ScaleY
  193. //==============================
  194. Game_Battler.prototype.motion_ScaleY= function() {
  195.         return this._motion_idle_scale[1] + this._motion_action_scale[1] + this._motion_collapse_scale[1];
  196. };

  197. //==============================
  198. // ** Motion Rotation
  199. //==============================
  200. Game_Battler.prototype.motion_rotation = function() {
  201.         return this._motion_idle_rotation + this._motion_action_rotation + this._motion_collapse_rotation;
  202. };

  203. //==============================
  204. // ** is Breath Mode
  205. //==============================
  206. Game_Battler.prototype.is_breath_mode = function() {
  207.         return this._motion_breath[5];
  208. };

  209. //==============================
  210. // ** is Flying Mode
  211. //==============================
  212. Game_Battler.prototype.is_fly_mode = function() {
  213.         return this._motion_fly[5] == true;
  214. };

  215. //==============================
  216. // ** is Swing Mode
  217. //==============================
  218. Game_Battler.prototype.is_swing_mode = function() {
  219.         return this._motion_swing[5];
  220. };

  221. //==============================
  222. // ** Motion Shake
  223. //==============================
  224. Game_Battler.prototype.motion_shake = function() {
  225.         this._motion_damage_duration = 30;
  226. };

  227. //=============================================================================
  228. // ** Game Enemy
  229. //=============================================================================

  230. //==============================
  231. // * Setup
  232. //==============================
  233. var _alias_mog_bmotion_genmy_setup = Game_Enemy.prototype.setup
  234. Game_Enemy.prototype.setup = function(enemyId, x, y) {
  235.         _alias_mog_bmotion_genmy_setup.call(this,enemyId, x, y);
  236.         this.set_motion_data();
  237. };

  238. //==============================
  239. // * Transform
  240. //==============================
  241. var _alias_mog_bmotion_transform = Game_Enemy.prototype.transform
  242. Game_Enemy.prototype.transform = function(enemyId) {
  243.     _alias_mog_bmotion_transform.call(this,enemyId)
  244.         this.set_motion_data();       
  245. };

  246. //=============================================================================
  247. // ** Game Action
  248. //=============================================================================

  249. //==============================
  250. // * Apply
  251. //==============================
  252. var _alias_mog_bmotion_gact_apply = Game_Action.prototype.apply;
  253. Game_Action.prototype.apply = function(target) {
  254.          var old_hp = target.hp;
  255.         _alias_mog_bmotion_gact_apply.call(this,target);
  256.         if (target.hp < old_hp) {
  257.              if (target.isActor() && $gameSystem._bmotion[0]) {target.motion_shake()};
  258.              if (target.isEnemy() && $gameSystem._bmotion[1]) {target.motion_shake()};               
  259.         };
  260. };

  261. //=============================================================================
  262. // ** Spriteset_Battle
  263. //=============================================================================

  264. //==============================
  265. // * Initialize
  266. //==============================
  267. var _alias_mog_bmotion_spriteseBattle_createEnemies = Spriteset_Battle.prototype.createEnemies;
  268. Spriteset_Battle.prototype.createEnemies = function() {
  269.         this._sprite_shadow = [];
  270.         for (var i = 0; i < $gameTroop.members().length; i++) {this._sprite_shadow[i] = new SpriteBattlerShadow(),this._battleField.addChild(this._sprite_shadow[i])};
  271.         _alias_mog_bmotion_spriteseBattle_createEnemies.call(this)
  272.         for (var i = 0; i < this._enemySprites.length; i++) {
  273.                  this._enemySprites[i].add_shadow(this._sprite_shadow[i]);
  274.         };
  275. };

  276. //=============================================================================
  277. // ** Sprite Enemy
  278. //=============================================================================

  279. //==============================
  280. // * Add Shadow
  281. //==============================
  282. Sprite_Enemy.prototype.add_shadow = function(sprite_shadow) {
  283.           this._spriteShadow = sprite_shadow;
  284. };

  285. //==============================
  286. // * iniVisibility
  287. //==============================
  288. var _alias_mog_bmotion_spenemy_initVisibility = Sprite_Enemy.prototype.initVisibility;
  289. Sprite_Enemy.prototype.initVisibility = function() {
  290.         _alias_mog_bmotion_spenemy_initVisibility.call(this);
  291.         this._check_initsetup = true;
  292. };

  293. //==============================
  294. // * updateBitmap
  295. //==============================
  296. var _alias_mog_bmotion_senmy_updateBitmap = Sprite_Enemy.prototype.updateBitmap;
  297. Sprite_Enemy.prototype.updateBitmap = function() {
  298.         _alias_mog_bmotion_senmy_updateBitmap.call(this);
  299.         if (this._check_duration < 10) {this._check_duration += 1};
  300.         if (this._check_duration > 1 ){if (this._check_initsetup && this.bitmap.isReady()) {this.set_bmotion_setup()};}
  301. };

  302. //==============================
  303. // * startBlink
  304. //==============================
  305. var _alias_mog_bmotion_srtenemy_startBlink = Sprite_Enemy.prototype.startBlink
  306. Sprite_Enemy.prototype.startBlink = function() {
  307.     if ($gameSystem._bmotion[2]) {this._effectDuration = 1; return};
  308.         _alias_mog_bmotion_srtenemy_startBlink.call(this);
  309. };

  310. //=============================================================================
  311. // ** Sprite_Battler
  312. //=============================================================================
  313. var _alias_mog_bmotion_sprtb_initialize = Sprite_Battler.prototype.initialize
  314. Sprite_Battler.prototype.initialize = function(battler) {
  315.         _alias_mog_bmotion_sprtb_initialize.call(this,battler)
  316.         this._check_initsetup = true;
  317.         this._check_duration = 0;
  318. };

  319. //==============================
  320. // * initMembers
  321. //==============================
  322. var _alias_mog_bmotion_sprtb_initMembers =         Sprite_Battler.prototype.initMembers;
  323. Sprite_Battler.prototype.initMembers = function() {
  324.         _alias_mog_bmotion_sprtb_initMembers.call(this);
  325.         this._check_initsetup = true;
  326. };

  327. //==============================
  328. // * Set Motion Setup
  329. //==============================
  330. Sprite_Battler.prototype.set_bmotion_setup = function() {       
  331.         this._check_initsetup = false;
  332.         this._battler.set_battler_motion_data();
  333.     if (this._battler.is_breath_mode()) {this.set_breath_mode()};
  334.         if (this._battler.is_fly_mode()) {this.set_fly_mode()};
  335.         if (this._battler.is_swing_mode()) {this.set_swing_mode()};
  336. };

  337. //==============================
  338. // * Set Breath Mode
  339. //==============================
  340. Sprite_Battler.prototype.set_breath_mode = function() {
  341.                 this._battler._motion_breath = [0,0,0,1.03,2,true];
  342.             if (this.bitmap.height <= 100) {this._battler._motion_breath[4] = 1};
  343.                 if (this.bitmap.height >= 300) {this._battler._motion_breath[4] = 3};
  344.                 var rz = (Math.random() * 0.06).toFixed(3);
  345.                 this.scale.y = 1.00 + Number(rz);
  346.                 var rz = Math.floor(Math.random() * 2);
  347.                 this._battler._motion_breath[0] = rz;
  348.                 var rz = Math.floor(Math.random() * 5);
  349.                 var rz = (rz * 0.0001).toFixed(4);
  350.                 this._battler._motion_breath[1] = 0.0025 + Number(rz);       
  351. };

  352. //==============================
  353. // * Set Fly Mode
  354. //==============================
  355. Sprite_Battler.prototype.set_fly_mode = function() {
  356.         this._battler._motion_fly = [this.x, this.y ,0 , 40 ,0.35,true];
  357.                 this._battler._motion_fly[2] = Math.floor(Math.random() * 2);
  358.                 this._battler._motion_fly[3] += Math.floor(Math.random() * 5);
  359.                 var rz = (Math.random() * 0.1).toFixed(2);
  360.                 this._battler._motion_fly[4] += Number(rz);       
  361.                 this._battler._motion_idle_xy[1] = -(Math.floor(Math.random() * this._battler._motion_fly[3]));
  362. };

  363. //==============================
  364. // * Set Swing Mode
  365. //==============================
  366. Sprite_Battler.prototype.set_swing_mode = function() {
  367.         this._battler._motion_swing = [0,0.003,0.10,0,0.35,true];
  368.                 var rz = (Math.random() * 0.10).toFixed(2);
  369.                 this.rotation = Number(rz);               
  370.                 this._battler._motion_swing[0] += Math.floor(Math.random() * 2);
  371. };

  372. //==============================
  373. // * Update Position
  374. //==============================
  375. var _alias_mog_battlerMotion_sprbtr_updatePosition = Sprite_Battler.prototype.updatePosition;
  376. Sprite_Battler.prototype.updatePosition = function() {
  377.         _alias_mog_battlerMotion_sprbtr_updatePosition.call(this);
  378.         this.update_bmotion_position();
  379. };

  380. //==============================
  381. // * Update Main
  382. //==============================
  383. var _alias_mog_bmotion_updateMain = Sprite_Battler.prototype.updateMain;
  384. Sprite_Battler.prototype.updateMain = function() {
  385.         _alias_mog_bmotion_updateMain.call(this)
  386.          this.update_bmotion();
  387. };

  388. //==============================
  389. // * Update Bmotion Position
  390. //==============================
  391. Sprite_Battler.prototype.update_bmotion_position = function() {
  392.   this.x += this._battler.motion_Xaxis();
  393.   this.y += this._battler.motion_Yaxis();
  394.   this.scale.x = this._battler.motion_ScaleX();
  395.   this.scale.y = this._battler.motion_ScaleY();
  396.   this.rotation = this._battler.motion_rotation();
  397. };

  398. //==============================
  399. // * Update Bmotion Position
  400. //==============================
  401. Sprite_Battler.prototype.update_bmotion = function() {
  402.            if (this._spriteShadow != null) {this._spriteShadow.update_shadow(this)};
  403.            if (this._battler.isDead()) {return};
  404.            if (this._battler._motion_damage_duration > 0) {this.update_motion_damage()};
  405.        if (this._battler.is_motionActing())
  406.                {this.update_motion_action();}                    
  407.            else
  408.              {this.update_motion_idle();
  409.            };
  410. };

  411. //==============================
  412. // * Update Motion_Standy
  413. //==============================
  414. Sprite_Battler.prototype.update_motion_idle = function() {
  415.   if (this._battler.isActor()) {return};   
  416.         if (this._battler.is_breath_mode()) {this.update_idle_breath_mode()};
  417.                 if (this._battler.is_fly_mode()) {this.update_idle_fly_mode()};
  418.                 if (this._battler.is_swing_mode()) {this.update_idle_swing_mode()};
  419. };

  420. //==============================
  421. // * Update Idle Breath Mode
  422. //==============================
  423. Sprite_Battler.prototype.update_idle_breath_mode = function() {
  424.             this._battler._motion_breath[2] += 1
  425.                 if (this._battler._motion_breath[2] < this._battler._motion_breath[4]) {return};
  426.                 this._battler._motion_breath[2] = 0        
  427.                 if (this._battler._motion_breath[0] == 0) {
  428.                         this._battler._motion_idle_scale[1] += this._battler._motion_breath[1];
  429.                     if (this._battler._motion_idle_scale[1] > this._battler._motion_breath[3]) {this._battler._motion_idle_scale[1] =this._battler._motion_breath[3]; this._battler._motion_breath[0] = 1};
  430.                 }
  431.                 else {
  432.                         this._battler._motion_idle_scale[1] -= this._battler._motion_breath[1];
  433.                         if (this._battler._motion_idle_scale[1] < 1.00) {this._battler._motion_idle_scale[1] = 1.00; this._battler._motion_breath[0] = 0};
  434.                 };
  435. };

  436. //==============================
  437. // * Update Idle Fly Mode
  438. //==============================
  439. Sprite_Battler.prototype.update_idle_fly_mode = function() {       
  440.          if (this._battler._motion_fly[2] === 0) {
  441.               this._battler._motion_idle_xy[1] -= this._battler._motion_fly[4];
  442.                          if (this._battler._motion_idle_xy[1] <= -this._battler._motion_fly[3]){
  443.                                  this._battler._motion_idle_xy[1] = -this._battler._motion_fly[3];
  444.                                  this._battler._motion_fly[2] = 1
  445.                          };
  446.                  }
  447.      else { this._battler._motion_idle_xy[1] += this._battler._motion_fly[4];
  448.                          if (this._battler._motion_idle_xy[1] >= -20){
  449.                                  this._battler._motion_idle_xy[1] = -20;
  450.                                  this._battler._motion_fly[2] = 0
  451.                          };                 
  452.          };                 
  453. };

  454. //==============================
  455. // * Update Swing Mode
  456. //==============================
  457. Sprite_Battler.prototype.update_idle_swing_mode = function() {
  458.         if (this._battler._motion_swing[0] === 0) {
  459.                       this._battler._motion_idle_rotation += this._battler._motion_swing[1];
  460.                           if (this._battler._motion_idle_rotation >= this._battler._motion_swing[2]) {this._battler._motion_idle_rotation = this._battler._motion_swing[2]; this._battler._motion_swing[0] =

  461. 1};
  462.                 }
  463.     else {this._battler._motion_idle_rotation -= this._battler._motion_swing[1];
  464.              if (this._battler._motion_idle_rotation <= -this._battler._motion_swing[2]) {this._battler._motion_idle_rotation = -this._battler._motion_swing[2]; this._battler._motion_swing[0] = 0};
  465.     };
  466. };

  467. //==============================
  468. // * Update Motion Damage
  469. //==============================
  470. Sprite_Battler.prototype.update_motion_damage = function() {
  471.          this._battler._motion_damage_xy[0] = (Math.random() * 12) - 6;
  472.          this._battler._motion_damage_duration -= 1;
  473.          if (this._battler._motion_damage_duration <= 0) {this._battler._motion_damage_xy = [0,0]};
  474. };

  475. //==============================
  476. // * Update Motion Action
  477. //==============================
  478. Sprite_Battler.prototype.update_motion_action = function() {
  479.         if (this._battler.isActor()) {return};
  480.     switch (this._battler._motion_action_data[0]) {
  481.                 case 1:
  482.             this.update_action_zoom();
  483.             break;
  484.                 case 2:
  485.             this.update_action_swing_right();
  486.             break;
  487.                 case 3:
  488.             this.update_action_swing_left();
  489.             break;
  490.                 case 4:
  491.             this.update_action_jump();
  492.             break;
  493.                 case 5:
  494.             this.update_action_frontal_attack();
  495.             break;
  496.                 case 6:
  497.             this.update_action_rotation();
  498.             break;
  499.                 case 7:
  500.             this.update_action_move_right();
  501.             break;                                                                       
  502.                 default :
  503.                this._battler.clear_action_data();               
  504.            break                               
  505.                 };  
  506.           
  507. };

  508. //==============================
  509. // * Update Action Zoom
  510. //==============================
  511. Sprite_Battler.prototype.update_action_zoom = function() {
  512.       this._battler._motion_action_data[1] += 1;
  513.           if (this._battler._motion_action_data[1] < 20) {
  514.               this._battler._motion_action_scale[0] += 0.005;
  515.           }
  516.           else if (this._battler._motion_action_data[1] < 40) {
  517.                   this._battler._motion_action_scale[0] -= 0.005;
  518.           }
  519.           else {
  520.               this._battler.clear_action_data();
  521.       };
  522.           this._battler._motion_action_scale[1] = this._battler._motion_action_scale[0]
  523. };

  524. //==============================
  525. // * Update Action Swing Right
  526. //==============================
  527. Sprite_Battler.prototype.update_action_swing_right = function() {
  528.       this._battler._motion_action_data[1] += 1
  529.           if (this._battler._motion_action_data[1] < 10) {
  530.                   this._battler._motion_action_scale[0] = 0;
  531.                   this._battler._motion_action_xy[0] += 6;
  532.                   this._battler._motion_action_xy[1] += 6;
  533.           }       
  534.           else if (this._battler._motion_action_data[1] < 30) {
  535.           this._battler._motion_action_scale[0] = -2.00;
  536.                   this._battler._motion_action_xy[0] -= 6;
  537.           }
  538.       else if (this._battler._motion_action_data[1] < 40) {
  539.           this._battler._motion_action_scale[0] = 0;
  540.                   this._battler._motion_action_xy[0] += 6;
  541.                   this._battler._motion_action_xy[1] -= 6;                            
  542.           }
  543.           else {
  544.               this._battler.clear_action_data();
  545.       };
  546. };

  547. //==============================
  548. // * Update Action Swing Left
  549. //==============================
  550. Sprite_Battler.prototype.update_action_swing_left = function() {
  551.       this._battler._motion_action_data[1] += 1
  552.           if (this._battler._motion_action_data[1] < 10) {
  553.                   this._battler._motion_action_scale[0] = -2.00;
  554.                   this._battler._motion_action_xy[0] -= 6;
  555.                   this._battler._motion_action_xy[1] += 6;
  556.           }       
  557.           else if (this._battler._motion_action_data[1] < 30) {
  558.                   this._battler._motion_action_scale[0] = 0;         
  559.                   this._battler._motion_action_xy[0] += 6;
  560.           }
  561.       else if (this._battler._motion_action_data[1] < 40) {
  562.           this._battler._motion_action_scale[0] = -2.00;
  563.                   this._battler._motion_action_xy[0] -= 6;
  564.                   this._battler._motion_action_xy[1] -= 6;                            
  565.           }
  566.           else {
  567.               this._battler.clear_action_data();
  568.       };
  569. };

  570. //==============================
  571. // * Update Action Jump
  572. //==============================
  573. Sprite_Battler.prototype.update_action_jump = function() {
  574.       this._battler._motion_action_data[1] += 1
  575.           if (this._battler._motion_action_data[1] < 15) {

  576.                   this._battler._motion_action_xy[1] -= 6;
  577.           }       
  578.           else if (this._battler._motion_action_data[1] < 30) {
  579.         
  580.                   this._battler._motion_action_xy[1] += 6;
  581.           }
  582.           else {
  583.               this._battler.clear_action_data();
  584.       };
  585. };

  586. //==============================
  587. // * Update Action Frontal
  588. //==============================
  589. Sprite_Battler.prototype.update_action_frontal_attack = function() {
  590.       this._battler._motion_action_data[1] += 1
  591.           if (this._battler._motion_action_data[1] < 10) {
  592.           this._battler._motion_action_rotation -= 0.03
  593.           }
  594.           else if (this._battler._motion_action_data[1] < 30) {
  595.           this._battler._motion_action_rotation += 0.04
  596.           }       
  597.           else if (this._battler._motion_action_data[1] < 40) {
  598.           this._battler._motion_action_rotation -= 0.06
  599.       }
  600.           else {
  601.               this._battler.clear_action_data();
  602.       };
  603. };

  604. //==============================
  605. // * Update Action Rotation
  606. //==============================
  607. Sprite_Battler.prototype.update_action_rotation = function() {
  608.       this._battler._motion_action_data[1] += 1
  609.           if (this._battler._motion_action_data[1] < 30) {
  610.           this._battler._motion_action_rotation += 0.2
  611.       }
  612.           else {
  613.               this._battler.clear_action_data();
  614.       };
  615. };

  616. //==============================
  617. // * Update Move Right
  618. //==============================
  619. Sprite_Battler.prototype.update_action_move_right = function() {
  620.       this._battler._motion_action_data[1] += 1
  621.           if (this._battler._motion_action_data[1] < 15) {
  622.                   this._battler._motion_action_xy[0] += 6;
  623.           }       
  624.           else if (this._battler._motion_action_data[1] < 30) {        
  625.                   this._battler._motion_action_xy[0] -= 6;
  626.           }
  627.           else {
  628.               this._battler.clear_action_data();
  629.       };
  630. };

  631. //=============================================================================
  632. // * SpriteBattlerShadow
  633. //=============================================================================
  634. function SpriteBattlerShadow() {
  635.     this.initialize.apply(this, arguments);
  636. };

  637. SpriteBattlerShadow.prototype = Object.create(Sprite.prototype);
  638. SpriteBattlerShadow.prototype.constructor = SpriteBattlerShadow;

  639. //==============================
  640. // * Initialize
  641. //==============================
  642. SpriteBattlerShadow.prototype.initialize = function() {
  643.     Sprite.prototype.initialize.call(this);       
  644.         this.opacity = 0;
  645.         this.visible = false;
  646.         this._data = [false,false];
  647. };

  648. //==============================
  649. // * Load File
  650. //==============================
  651. SpriteBattlerShadow.prototype.loadFiles = function(sprite) {       
  652.     if (!sprite._battler.is_fly_mode()){return};
  653.         this._data = [true,false];
  654.         this.bitmap = sprite.bitmap;
  655. };

  656. //==============================
  657. // * Set Data
  658. //==============================
  659. SpriteBattlerShadow.prototype.set_data = function(sprite) {
  660.     this._data = [true,true];
  661.         this.setBlendColor([0, 0, 0, 255])
  662.         this.anchor.x = 0.5;
  663.         this.anchor.y = 0.5;
  664. };

  665. //==============================
  666. // * Update Shadow
  667. //==============================
  668. SpriteBattlerShadow.prototype.update_shadow = function(sprite) {       
  669.         if (!this._data[0]) {this.loadFiles(sprite);return};
  670.         if (!this.bitmap.isReady()) {return;};
  671.         if (!this._data[1]) {this.set_data(sprite)};
  672.         if (!sprite._battler.is_fly_mode()){this.visible = false;return};
  673.         this.x = sprite.x;
  674.         ny = 0
  675.         if (this.need_set_ny_action(sprite._battler)) {ny = sprite._battler._motion_action_xy[1]};
  676.         this.y = sprite.y - sprite._battler._motion_idle_xy[1] - ny;
  677.         nz = Number((sprite._battler._motion_idle_xy[1] / 3) * 0.004);
  678.         this.scale.x = 1.4 + nz;
  679.         this.scale.y = 0.3 + nz;
  680.     this.opacity = sprite.opacity - 90;
  681.         this.visible = sprite.visible;
  682. };

  683. //==============================
  684. // * Need set ny Action
  685. //==============================
  686. SpriteBattlerShadow.prototype.need_set_ny_action = function(battler) {
  687.         if (battler._motion_action_data[0] == 4) {return true};
  688.         return false;
  689. };
复制代码

…あたしは天

梦石
0
星屑
2311
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2016-1-5 07:41:21 | 显示全部楼层
解决方法:新建游戏
回复

使用道具 举报

梦石
0
星屑
497
在线时间
266 小时
注册时间
2015-12-8
回帖
729
 楼主| 发表于 2016-1-5 11:28:50 | 显示全部楼层
taroxd 发表于 2016-1-5 07:41
解决方法:新建游戏

=   ="我要能讀取

点评

新的存档也不能读取?  发表于 2016-1-5 11:47
回复

使用道具 举报

梦石
0
星屑
497
在线时间
266 小时
注册时间
2015-12-8
回帖
729
 楼主| 发表于 2016-1-5 11:59:46 | 显示全部楼层
taroxd 发表于 2016-1-5 07:41
解决方法:新建游戏


不能 新開遊戲先關閉插件立刻存檔 在開啟插件讀取遊戲也會失敗
回复

使用道具 举报

…あたしは天

梦石
0
星屑
2311
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2016-1-5 12:46:04 | 显示全部楼层
小叮鈴 发表于 2016-1-5 11:59
不能 新開遊戲先關閉插件立刻存檔 在開啟插件讀取遊戲也會失敗

关闭插件是闹哪样
回复

使用道具 举报

梦石
0
星屑
497
在线时间
266 小时
注册时间
2015-12-8
回帖
729
 楼主| 发表于 2016-1-5 13:51:17 | 显示全部楼层
taroxd 发表于 2016-1-5 12:46
关闭插件是闹哪样

測試阿,不然為了這個插件報廢全部存檔也太蛋疼了吧

感覺只是其中一段語法出錯而已 應該能修正吧
回复

使用道具 举报

…あたしは天

梦石
0
星屑
2311
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2016-1-5 13:59:10 | 显示全部楼层
本帖最后由 taroxd 于 2016-1-5 14:01 编辑
小叮鈴 发表于 2016-1-5 13:51
測試阿,不然為了這個插件報廢全部存檔也太蛋疼了吧

感覺只是其中一段語法出錯而已 應該能修正吧 ...


你到底要不要开这个插件。要开就一直开着,不要开就扔掉。一会儿开一会儿不开是闹哪样啊。

另外这和语法错误一点关系都没有。修正方式就是一直开着插件(或者一直别开)
回复

使用道具 举报

梦石
0
星屑
497
在线时间
266 小时
注册时间
2015-12-8
回帖
729
 楼主| 发表于 2016-1-5 17:49:05 | 显示全部楼层
taroxd 发表于 2016-1-5 13:59
你到底要不要开这个插件。要开就一直开着,不要开就扔掉。一会儿开一会儿不开是闹哪样啊。

另外这和语法 ...

開者就當掉了阿 除非新建遊戲{:2_276:}
回复

使用道具 举报

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
回帖
1464
发表于 2016-1-5 19:28:37 | 显示全部楼层
本帖最后由 汪汪 于 2016-1-5 20:01 编辑

从理论上讲...找到它保存的存档和原来存档的差异就可以了.....


把这个做成插件使用,




  1. DataManager.extractSaveContents = function(contents) {
  2.     $gameSystem        = contents.system;
  3.     $gameScreen        = contents.screen;
  4.     $gameTimer         = contents.timer;
  5.     $gameSwitches      = contents.switches;
  6.     $gameVariables     = contents.variables;
  7.     $gameSelfSwitches  = contents.selfSwitches;
  8.     $gameActors        = contents.actors;
  9.     $gameParty         = contents.party;
  10.     $gameMap           = contents.map;
  11.     $gamePlayer        = contents.player;
  12.    
  13.     for(i = $gameActors._data.length-1;i>0;i-- ){
  14.     if(!$gameActors._data[i]._motion_damage_xy){$gameActors._data[i].set_motion_data()}
  15.    }
  16. };




复制代码

点评

謝了^^  发表于 2016-1-5 20:47
或者使用上面那个插件  发表于 2016-1-5 20:01
再读取时使用插件  发表于 2016-1-5 19:56
重新存档,看看再读取行不行.......不过这个也让我意识到以后插件要考虑读取存档后能不能兼容问题........  发表于 2016-1-5 19:55
在输入 for(i = $gameActors._data.length-1;i>0;i-- ){$gameActors._data[i].set_motion_data()}  发表于 2016-1-5 19:54

评分

参与人数 1梦石 +1 收起 理由
余烬之中 + 1 认可答案

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部