查看: 1210|回复: 4

[有事请教] 加入新插件后弹出undefined,如何解决

[复制链接]
梦石
0
星屑
1445
在线时间
181 小时
注册时间
2022-9-17
回帖
99
发表于 2022-10-29 18:19:20 | 显示全部楼层 |阅读模式

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

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

×
bug.JPG

游戏已经测试一段时间了,在加入新插件之后,如果是重新开始新游戏,那不会报错。但是读取旧存档的时候就会报错。请问如何在旧存档中继续运行?

个人拙见:是不是需要用旧存档重新读取遍历一次插件内容?

梦石
0
星屑
1445
在线时间
181 小时
注册时间
2022-9-17
回帖
99
 楼主| 发表于 2022-10-29 18:22:51 | 显示全部楼层
附上出BUG的脚本插件,这是MOG系列里的。在战斗中选择角色会触发上述的BUG。
  1. //=============================================================================
  2. // MOG_ActorPictureCM.js
  3. //=============================================================================

  4. /*:
  5. * @target MZ
  6. * @plugindesc (v1.0) Apresenta a imagem do personagem durante a seleção de comandos.
  7. * @author Moghunter
  8. *
  9. * @param -> MAIN <<<<<<<<<<<<<<<<<<<<<<<
  10. * @desc
  11. *
  12. * @param Slide Speed
  13. * @parent -> MAIN <<<<<<<<<<<<<<<<<<<<<<<
  14. * @desc Definição da velocidade de deslize.
  15. * @default 10
  16. *
  17. * @param
  18. *
  19. * @param -> BUST <<<<<<<<<<<<<<<<<<<<<<<
  20. * @desc
  21. *
  22. * @param Bust Visible
  23. * @parent -> BUST <<<<<<<<<<<<<<<<<<<<<<<
  24. * @text Visible
  25. * @type boolean
  26. * @desc Ativar a imagem do personagem.
  27. * @default true
  28. *
  29. * @param Bust X-Axis
  30. * @text X-Axis
  31. * @parent -> BUST <<<<<<<<<<<<<<<<<<<<<<<
  32. * @desc Definição da posição X-axis da imagem.
  33. * @default 608
  34. *
  35. * @param Bust Y-Axis
  36. * @text Y-Axis
  37. * @parent -> BUST <<<<<<<<<<<<<<<<<<<<<<<
  38. * @desc Definição da posição Y-axis da imagem.
  39. * @default 624
  40. *
  41. * @param Bust Slide X
  42. * @text Slide Animation X
  43. * @parent -> BUST <<<<<<<<<<<<<<<<<<<<<<<
  44. * @desc Definição de deslize X-Axis.
  45. * @default -150
  46. *
  47. * @param Bust Slide Y
  48. * @text Slide Animation Y
  49. * @parent -> BUST <<<<<<<<<<<<<<<<<<<<<<<
  50. * @desc Definição de deslize Y-Axis.
  51. * @default 0  
  52. *
  53. * @param Breath Effect
  54. * @text Breath Animation
  55. * @parent -> BUST <<<<<<<<<<<<<<<<<<<<<<<
  56. * @type boolean
  57. * @desc Ativar respiração de respiração.
  58. * @default false
  59. *
  60. * @param
  61. *
  62. * @param -> FACE <<<<<<<<<<<<<<<<<<<<<<<
  63. * @desc
  64. *
  65. * @param Face Visible
  66. * @text Visible
  67. * @parent -> FACE <<<<<<<<<<<<<<<<<<<<<<<
  68. * @type boolean
  69. * @desc Ativar a imagem da Face.
  70. * @default true
  71. *
  72. * @param Face X-Axis
  73. * @text X-Axis
  74. * @parent -> FACE <<<<<<<<<<<<<<<<<<<<<<<
  75. * @desc Definição da posição X-axis da imagem.
  76. * @default 570
  77. *
  78. * @param Face Y-Axis
  79. * @text Y-Axis
  80. * @parent -> FACE <<<<<<<<<<<<<<<<<<<<<<<  
  81. * @desc Definição da posição Y-axis da imagem.
  82. * @default 0
  83. *
  84. * @param Face Slide X
  85. * @text Slide Animation X
  86. * @parent -> FACE <<<<<<<<<<<<<<<<<<<<<<<  
  87. * @desc Definição de deslize X-Axis.
  88. * @default 150
  89. *
  90. * @param Face Slide Y
  91. * @text Slide Animation Y
  92. * @parent -> FACE <<<<<<<<<<<<<<<<<<<<<<<   
  93. * @desc Definição de deslize Y-Axis.
  94. * @default 0
  95. *
  96. * @command ActorPicture_setFileName
  97. * @desc Mudar o gráfico do personagem.
  98. * @text FileName (Bust)
  99. *
  100. * @arg id
  101. * @desc Definição da ID do personagem
  102. * @text Id
  103. * @default 1
  104. * @type number
  105. * @min 1
  106. *
  107. * @arg filename
  108. * @desc Definição do arquivo de imagem.
  109. * @text File Name
  110. * @default Bust_Test
  111. * @type file
  112. * @dir img/actor_picture_cm/
  113. *
  114. * @arg breath
  115. * @desc Ativar o efeito de respirar.
  116. * @text Breath Effect
  117. * @default false
  118. * @type boolean
  119. *
  120. * @arg visible
  121. * @desc Apresentar ou ocultar a imagem.
  122. * @text Visible
  123. * @default true
  124. * @type boolean
  125. *
  126. * @command ActorPicture_setFileName2
  127. * @desc Mudar o gráfico do personagem Suport.
  128. * @text FileName (Sup)
  129. *
  130. * @arg id
  131. * @desc Definição da ID do personagem
  132. * @text Id
  133. * @default 1
  134. * @type number
  135. * @min 1
  136. *
  137. * @arg filename
  138. * @desc Definição do arquivo de imagem.
  139. * @text File Name
  140. * @default Bust_Test2
  141. * @type file
  142. * @dir img/actor_picture_cm/
  143. *
  144. * @arg visible
  145. * @desc Apresentar ou ocultar a imagem.
  146. * @text Visible
  147. * @default true
  148. * @type boolean
  149. *  
  150. * @help  
  151. * =============================================================================
  152. * +++ MOG - Actor Picture CM (v1.0) +++
  153. * By Moghunter
  154. * [url]https://atelierrgss.wordpress.com/[/url]
  155. * =============================================================================
  156. * Apresenta a imagem do personagem durante a seleção de comandos.
  157. *
  158. * =============================================================================
  159. * - REQUIRED FILES -
  160. * =============================================================================
  161. * As imagens dos personagens devem ser gravadas na pasta. /img/actor_picture_cm/
  162. * A nomeação dos arquivos devem ser feitas da seguinte forma.
  163. *
  164. * Actor_ + ID + _bust.png
  165. *
  166. * Exemplo
  167. *
  168. * -> Actor_1_bust.png
  169. * -> Actor_2_bust.png
  170. * -> Actor_3_bust.png
  171. *
  172. * ----------------------------------------------------------------------------
  173. *
  174. * Para definir a imagem secundária do personagem nomeie o arquivo da seguinte
  175. * forma.
  176. *
  177. * -> Actor_ ID + _sub.png
  178. *
  179. * Exemplo
  180. *
  181. * -> Actor_1_sub.png
  182. * -> Actpr_2_sub.png
  183. * -> ...
  184. *
  185. */

  186. //=============================================================================
  187. // ** PLUGIN PARAMETERS
  188. //=============================================================================

  189. //=============================================================================
  190. // ** PLUGIN PARAMETERS
  191. //=============================================================================
  192.   var Imported = Imported || {};
  193.   Imported.MOG_ActorPictureCM = true;
  194.   var Moghunter = Moghunter || {};

  195.    Moghunter.parameters = PluginManager.parameters('MOG_ActorPictureCM');
  196.     Moghunter.actor_slideSpeed = Number(Moghunter.parameters['Slide Speed'] || 10);
  197.         Moghunter.actor_fileName = String(Moghunter.parameters['File Name'] || "Actor_");
  198.     Moghunter.actor_cm1_visible = String(Moghunter.parameters['Face Visible'] || "true");
  199.         Moghunter.actor_cm1_slideX = Number(Moghunter.parameters['Face Slide X'] || 150);
  200.         Moghunter.actor_cm1_slideY = Number(Moghunter.parameters['Face Slide Y'] || 0);
  201.         Moghunter.actor_cm1_x = Number(Moghunter.parameters['Face X-Axis'] || 570);
  202.     Moghunter.actor_cm1_y = Number(Moghunter.parameters['Face Y-Axis'] || 0);
  203.         Moghunter.actor_cm2_visible = String(Moghunter.parameters['Bust Visible'] || "true");
  204.         Moghunter.actor_cm2_slideX = Number(Moghunter.parameters['Bust Slide X'] || -150);
  205.         Moghunter.actor_cm2_slideY = Number(Moghunter.parameters['Bust Slide Y'] || 0);       
  206.         Moghunter.actor_cm2_x = Number(Moghunter.parameters['Bust X-Axis'] || 408);
  207.     Moghunter.actor_cm2_y = Number(Moghunter.parameters['Bust Y-Axis'] || 624);
  208.         Moghunter.actor_cm2_breathEffect = String(Moghunter.parameters['Breath Effect'] || "true");
  209.        
  210. //=============================================================================
  211. // ■■■  PluginManager ■■■
  212. //=============================================================================       
  213. PluginManager.registerCommand('MOG_ActorPictureCM', "ActorPicture_setFileName", data => {
  214.         var id = Number(data.id);
  215.         var fileName = data.filename;
  216.         var visible = String(data.visible) == "true" ? true : false;
  217.         var breath = String(data.breath) == "true" ? true : false;
  218.         for (var i = 0; i < $gameParty.members().length; i++) {
  219.             var actor = $gameParty.members()[i];
  220.                 if (actor._actorId === id) {
  221.                         if (actor) {
  222.                                 actor.setBattleBust_1(fileName);
  223.                                 actor.visbattleBust_1(visible);
  224.                                 actor.setActorCMbreathEffect(breath)
  225.                         };
  226.                 };
  227.         };
  228. });

  229. PluginManager.registerCommand('MOG_ActorPictureCM', "ActorPicture_setFileName2", data => {
  230.         var id = Number(data.id);
  231.         var fileName = data.filename;
  232.         var visible = String(data.visible) == "true" ? true : false;
  233.         for (var i = 0; i < $gameParty.members().length; i++) {
  234.             var actor = $gameParty.members()[i];
  235.                 if (actor._actorId === id) {
  236.                         if (actor) {
  237.                                 actor.setBattleBust_2(fileName);
  238.                                 actor.visbattleBust_2(visible);
  239.                         };
  240.                 };
  241.         };
  242. });
  243.        
  244. //=============================================================================
  245. // ■■■ ImageManager ■■■
  246. //=============================================================================

  247. //==============================
  248. // * Load Actor Pic CM
  249. //==============================
  250. ImageManager.loadActorpicCM = function(filename) {
  251.     return this.loadBitmap('img/actor_picture_cm/', filename, 0, true);
  252. };                       
  253.        
  254. //=============================================================================
  255. // ■■■ Game_Temp ■■■
  256. //=============================================================================

  257. //==============================
  258. // ♦ ALIAS ♦  Initialize
  259. //==============================
  260. var _alias_mog_actorcm_temp_initialize = Game_Temp.prototype.initialize;
  261. Game_Temp.prototype.initialize = function() {
  262.         _alias_mog_actorcm_temp_initialize.call(this);
  263.     this._actorCmData = [false,false,true];
  264. };

  265. //=============================================================================
  266. // ■■■ Game_System ■■■
  267. //=============================================================================

  268. //==============================
  269. // ♦ ALIAS ♦  Initialize
  270. //==============================
  271. var _alias_mog_actorcm_sys_initialize = Game_System.prototype.initialize;
  272. Game_System.prototype.initialize = function() {
  273.         _alias_mog_actorcm_sys_initialize.call(this);
  274.     this._actorCmOffSet = [true,0,0];
  275. };       

  276. //=============================================================================
  277. // ■■■ Game Interpreter ■■■
  278. //=============================================================================

  279. //==============================
  280. // * PluginCommand
  281. //==============================
  282. var _mog_actorCM_gint_pluginCommand = Game_Interpreter.prototype.pluginCommand
  283. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  284.         _mog_actorCM_gint_pluginCommand.call(this,command, args)
  285.         if (command === "actorCM_fileName")  {this.setActorCM(args)};
  286.         if (command === "actorCM_breathEffect")  {this.setActorBreathEffect(args)};
  287.         return true;
  288. };

  289. //==============================
  290. // * Set Actor CM
  291. //==============================
  292. Game_Interpreter.prototype.setActorCM = function(args) {
  293.         var id = Number(args[1]);
  294.         var fileName = String(args[3]);
  295.         for (var i = 0; i < $gameParty.members().length; i++) {
  296.             var actor = $gameParty.members()[i];
  297.                 if (actor._actorId === id) {
  298.                         if (actor) {actor.setActorCMNAme(fileName)};
  299.                 };
  300.         };
  301. };

  302. //==============================
  303. // * Set Actor Breath Effect
  304. //==============================
  305. Game_Interpreter.prototype.setActorBreathEffect = function(args) {
  306.         var id = Number(args[1]);
  307.         var enable = String(args[3]) == "true" ? true : false;
  308.         for (var i = 0; i < $gameParty.members().length; i++) {
  309.             var actor = $gameParty.members()[i];
  310.                 if (actor._actorId === id) {
  311.                         if (actor) {actor.setActorCMbreathEffect(enable)};
  312.                 };
  313.         };
  314. };

  315. //=============================================================================
  316. // ■■■ Game_Actor ■■■
  317. //=============================================================================

  318. //==============================
  319. // ♦ ALIAS ♦  Initialize
  320. //==============================
  321. var _mog_actorcm_gactor_initMembers = Game_Actor.prototype.initMembers;
  322. Game_Actor.prototype.initMembers = function() {
  323.         _mog_actorcm_gactor_initMembers.call(this);
  324.         var breathEffect = String(Moghunter.actor_cm2_breathEffect) == "true" ? true : false;
  325.         this._actorCMData = ["",0,0,breathEffect,"",true,true];
  326. };

  327. //==============================
  328. // ♦ ALIAS ♦  Setup
  329. //==============================
  330. var _mog_actorcm_gactor_setup = Game_Actor.prototype.setup;
  331. Game_Actor.prototype.setup = function(actorId) {
  332.         _mog_actorcm_gactor_setup.call(this,actorId);
  333.         this._actorCMData[0] = "Actor_" + this._actorId + "_bust";
  334.         this._actorCMData[4] = "Actor_" + this._actorId + "_sup";
  335. };


  336. //==============================
  337. // * battle Bust 1
  338. //==============================
  339. Game_Actor.prototype.battleBust_1 = function() {
  340.         return String(this._actorCMData[0]);
  341. };

  342. //==============================
  343. // * battle Bust 2
  344. //==============================
  345. Game_Actor.prototype.battleBust_2 = function() {
  346.         return String(this._actorCMData[4]);
  347. };

  348. //==============================
  349. // * set Battle bust 1
  350. //==============================
  351. Game_Actor.prototype.setBattleBust_1 = function(filename) {
  352.     this._actorCMData[0] = filename;
  353. };

  354. //==============================
  355. // * vis Battle bust 1
  356. //==============================
  357. Game_Actor.prototype.visbattleBust_1 = function(visible) {
  358.     this._actorCMData[5] = visible;
  359. };

  360. //==============================
  361. // * set Battle bust 2
  362. //==============================
  363. Game_Actor.prototype.setBattleBust_2 = function(filename) {
  364.     this._actorCMData[4] = filename;
  365. };

  366. //==============================
  367. // * vis Battle bust 2
  368. //==============================
  369. Game_Actor.prototype.visbattleBust_2 = function(visible) {
  370.     this._actorCMData[6] = visible;
  371. };

  372. //==============================
  373. // * set Actor CM Breath Effect
  374. //==============================
  375. Game_Actor.prototype.setActorCMbreathEffect = function(enable) {
  376.         this._actorCMData[3] = enable;
  377. };       
  378.        
  379. //=============================================================================
  380. // ■■■ Scene Base ■■■
  381. //=============================================================================

  382. //==============================
  383. // ** create Hud Field
  384. //==============================
  385. Scene_Base.prototype.createHudField = function() {
  386.         this._hudField = new Sprite();
  387.         this._hudField.z = 10;
  388.         this.addChild(this._hudField);
  389. };

  390. //==============================
  391. // ** sort MZ
  392. //==============================
  393. Scene_Base.prototype.sortMz = function() {
  394.    this._hudField.children.sort((a, b) => a.z - b.z);
  395. };
  396.        
  397. //=============================================================================
  398. // ■■■ Scene Battle ■■■
  399. //=============================================================================

  400. //==============================
  401. // ♦ ALIAS ♦  create Spriteset
  402. //==============================
  403. var _mog_actorPicCM_sbattle_createSpriteset = Scene_Battle.prototype.createSpriteset;
  404. Scene_Battle.prototype.createSpriteset = function() {
  405.         _mog_actorPicCM_sbattle_createSpriteset.call(this);
  406.         if (!this._hudField) {this.createHudField()};
  407.     this.createActorCM();
  408.         this.sortMz();       
  409. };

  410. //==============================
  411. // * Create Actor CM
  412. //==============================
  413. Scene_Battle.prototype.createActorCM = function() {
  414.       this.actorPictureCM = new Actor_CMPicture();
  415.       this.actorPictureCM.z = 3;
  416.       this._hudField.addChild(this.actorPictureCM);
  417. };

  418. //==============================
  419. // ♦ ALIAS ♦  Update
  420. //==============================
  421. var _alias_mog_actorcm_scbat_update = Scene_Battle.prototype.update;
  422. Scene_Battle.prototype.update = function() {
  423.         _alias_mog_actorcm_scbat_update.call(this);
  424.         $gameTemp._actorCmData[0] = this.sprite_actor_cm_visible();
  425. };

  426. //==============================
  427. // * Sprite Actor CM Visible
  428. //==============================
  429. Scene_Battle.prototype.sprite_actor_cm_visible = function() {
  430.         if (!BattleManager.actor()) {return false};
  431.         if (this._actorWindow.active) {return false};
  432.         if (this._enemyWindow.active) {return false};
  433.         if (this._partyCommandWindow.active) {return false};
  434.         if ($gameMessage.isBusy()) {return false};
  435.         if (!BattleManager.isInputting()) {return false};
  436.         return true;
  437. };

  438. //=============================================================================
  439. // ■■■ Actor_CMPicture ■■■
  440. //=============================================================================
  441. function Actor_CMPicture() {
  442.     this.initialize.apply(this, arguments);
  443. };

  444. Actor_CMPicture.prototype = Object.create(Sprite.prototype);
  445. Actor_CMPicture.prototype.constructor = Actor_CMPicture;

  446. //==============================
  447. // * Initialize
  448. //==============================
  449. Actor_CMPicture.prototype.initialize = function() {
  450.     Sprite.prototype.initialize.call(this);       
  451.         this._actor = null;
  452.         this._CmName = null;
  453.         this._breahEffect = false;
  454.         $gameTemp._actorCmData = [false,false,true];
  455.         this._cm1 = String(Moghunter.actor_cm1_visible) === "true" ? true : false;
  456.         this._cm2 = String(Moghunter.actor_cm2_visible) === "true" ? true : false;
  457.         this._xf = 816 - Graphics.width;
  458.     this._yf = 624 - Graphics.height;               
  459.         this._sldSpd = Math.min(Math.max(Moghunter.actor_slideSpeed,1),999);
  460.         if (this._cm1) {this.createCM1()};
  461.         if (this._cm2) {this.createCM2()};
  462. };

  463. //==============================
  464. // * is Visible
  465. //==============================
  466. Actor_CMPicture.prototype.isVisible = function() {
  467.         if (!$gameSystem._actorCmOffSet[0]) {return false};
  468.         if (!$gameTemp._actorCmData[2]) {return false};
  469.     return $gameTemp._actorCmData[0];
  470. };

  471. //==============================
  472. // * create CM1
  473. //==============================
  474. Actor_CMPicture.prototype.createCM1 = function() {
  475.     this._supSprite = new Sprite();
  476.         this._supSprite.visible = false;
  477.         this._supSpriteData = null;
  478.         this.addChild(this._supSprite);
  479. };

  480. //==============================
  481. // * create CM2
  482. //==============================
  483. Actor_CMPicture.prototype.createCM2 = function() {
  484.     this._bust = new Sprite();
  485.         this._bust.anchor.x = 0.5;
  486.         this._bust.anchor.y = 1.0;
  487.         this._bust.visible = false;
  488.         this._bustData = null;
  489.         this.addChild(this._bust);
  490. };

  491. //==============================
  492. // * Hide Sprites
  493. //==============================
  494. Actor_CMPicture.prototype.hideSprites = function() {
  495.         if (this._supSprite) {this._supSprite.visible = false};
  496.     if (this._bust) {this._bust.visible = false};
  497. };

  498. //==============================
  499. // * move To
  500. //==============================
  501. Actor_CMPicture.prototype.moveto = function(value,real_value) {
  502.         if (value == real_value) {return value};
  503.         var dnspeed = 2 + (Math.abs(value - real_value) / this._sldSpd);
  504.         if (value > real_value) {value -= dnspeed;
  505.             if (value < real_value) {value = real_value};}
  506.     else if (value < real_value) {value  += dnspeed;
  507.             if (value  > real_value) {value  = real_value};               
  508.     };
  509.         return Math.floor(value);
  510. };

  511. //==============================
  512. // * Need Refresh Actor
  513. //==============================
  514. Actor_CMPicture.prototype.refreshActor = function() {
  515.         this._actor = BattleManager.actor();
  516.         if (this._actor) {this.refreshSprites()};
  517. };

  518. //==============================
  519. // * refresh Bitmap CM1
  520. //==============================
  521. Actor_CMPicture.prototype.refreshBitmapCM1 = function() {
  522.         var fileName = !this._actor._actorCMData[6] ? "" : this._actor.battleBust_2();
  523.     this._supSprite.bitmap = ImageManager.loadActorpicCM(fileName);       
  524.         this._supSprite.visible = false;
  525.         this._supSpriteData = null;
  526. };

  527. //==============================
  528. // * refresh Bitmap CM2
  529. //==============================
  530. Actor_CMPicture.prototype.refreshBitmapCM2 = function() {
  531.         var fileName = !this._actor._actorCMData[5] ? "" : this._actor.battleBust_1();
  532.     this._bust.bitmap = ImageManager.loadActorpicCM(fileName);       
  533.         this._bust.visible = false;
  534.         this._bust.zoom = {}
  535.         this._bust.zoom.speed = 0.0004;
  536.         this._bust.zoom.maxScale = 0.008;
  537.         this._bust.zoom.phase = 0;
  538.         this._bust.zoom.y = 0;
  539.         this._breahEffect = false;
  540.         this._bustData = null;
  541. };

  542. //==============================
  543. // * refresh Sprites
  544. //==============================
  545. Actor_CMPicture.prototype.refreshSprites = function() {
  546.         this._CmName = this._actor ? this._actor.battleBust_1() : null;
  547.     if (this._supSprite) {this.refreshBitmapCM1()};
  548.         if (this._bust) {this.refreshBitmapCM2()};
  549. };

  550. //==============================
  551. // * Need Refresh Actor
  552. //==============================
  553. Actor_CMPicture.prototype.needRefreshActor = function() {
  554.          if ($gameTemp._actorCmData[1]) {return true};
  555.          if (BattleManager.actor() != this._actor) {return true};
  556.          if (this._actor && this._CmName != this._actor.battleBust_1())
  557.      return false;
  558. };

  559. //==============================
  560. // * get Data CM1
  561. //==============================
  562. Actor_CMPicture.prototype.getDataCM1 = function() {
  563.     this._supSpriteData = [this._supSprite.bitmap.width,this._supSprite.bitmap.height,
  564.                            Moghunter.actor_cm1_x,Moghunter.actor_cm1_y,0,0,true,
  565.                                            Moghunter.actor_cm1_slideX,Moghunter.actor_cm1_slideY
  566.                                           ];
  567.         this._supSprite.visible = this._actor._actorCMData[6];
  568.         this._supSprite.opacity = 0;
  569.         this._supSprite.x = this._supSpriteData[6] ? this._supSpriteData[2] + this._supSpriteData[7] : this._supSpriteData[2];
  570.         this._supSprite.y = this._supSpriteData[6] ? this._supSpriteData[3] + this._supSpriteData[8] : this._supSpriteData[3];
  571. };

  572. //==============================
  573. // * Update CM1
  574. //==============================
  575. Actor_CMPicture.prototype.updateCM1 = function() {
  576.          if (!this.isVisible()) {
  577.              this._supSpriteData[4] = this._supSpriteData[2] + this._supSpriteData[7];
  578.              this._supSpriteData[5] = this._supSpriteData[3] + this._supSpriteData[8];
  579.                  this._supSprite.opacity -= 15;
  580.          } else {
  581.              this._supSpriteData[4] = this._supSpriteData[2];
  582.              this._supSpriteData[5] = this._supSpriteData[3];
  583.                  this._supSprite.opacity += 15;
  584.          };         
  585.          this._supSprite.x = this.moveto(this._supSprite.x,this._supSpriteData[4]);
  586.          this._supSprite.y = this.moveto(this._supSprite.y,this._supSpriteData[5]);
  587. };

  588. //==============================
  589. // * need Get Data 1
  590. //==============================
  591. Actor_CMPicture.prototype.needGetData1 = function() {
  592.          if (!this._supSprite) {return false};
  593.          if (this._supSpriteData) {return false};
  594.          if (!this._supSprite.bitmap) {return false};
  595.          if (!this._supSprite.bitmap.isReady()) {return false};
  596.          return true;
  597. };

  598. //==============================
  599. // * get Data CM2
  600. //==============================
  601. Actor_CMPicture.prototype.getDataCM2 = function() {
  602.     this._bustData = [this._bust.bitmap.width,this._bust.bitmap.height,
  603.                            Moghunter.actor_cm2_x,Moghunter.actor_cm2_y,0,0,true,
  604.                                            Moghunter.actor_cm2_slideX,Moghunter.actor_cm2_slideY,
  605.                                           0,0,0];
  606.         this._bust.visible = this._actor._actorCMData[5];
  607.         this._bust.opacity = 0;
  608.         this._bustData[2] = Moghunter.actor_cm2_x;
  609.         this._bustData[3] = Moghunter.actor_cm2_y;
  610.         this._bust.x = this._bustData[6] ? this._bustData[2] + this._bustData[7] : this._bustData[2];
  611.         this._bust.y = this._bustData[6] ? this._bustData[3] + this._bustData[8] : this._bustData[3];
  612.         this._breahEffect = this._actor._actorCMData[3];
  613. };

  614. //==============================
  615. // * refresh Frame
  616. //==============================
  617. Actor_CMPicture.prototype.refreshFrame = function(sprite,index) {
  618.     var cw = this._eyesData.cw;
  619.         var ch = this._eyesData.ch;
  620.         var fr = cw * index;
  621.     sprite.setFrame(fr,0,cw,ch)
  622. };

  623. //==============================
  624. // * breathSpeed
  625. //==============================
  626. Actor_CMPicture.prototype.breathSpeed = function() {
  627.      return  0.000225;
  628. };

  629. //==============================
  630. // * Update CM2
  631. //==============================
  632. Actor_CMPicture.prototype.updateCM2 = function() {
  633.          if (!this.isVisible()) {
  634.              this._bustData[4] = this._bustData[2] + this._bustData[7];
  635.              this._bustData[5] = this._bustData[3] + this._bustData[8];
  636.                  this._bust.opacity -= 15;
  637.          } else {
  638.              this._bustData[4] = this._bustData[2];
  639.              this._bustData[5] = this._bustData[3];
  640.                  this._bust.opacity += 15;
  641.          };         
  642.          this._bust.x = this.moveto(this._bust.x,this._bustData[4]);
  643.          this._bust.y = this.moveto(this._bust.y,this._bustData[5]);
  644.      if (this._breahEffect && this._bust.opacity > 0) {this.updateBreathEffect()};
  645. };

  646. //==============================
  647. // * Update Breath Effect
  648. //==============================
  649. Actor_CMPicture.prototype.updateBreathEffect = function() {         
  650.          this._bust.zoom.speed = this.breathSpeed();
  651.          if (this._bust.zoom.phase === 0) {
  652.                  this._bust.zoom.y += this._bust.zoom.speed
  653.                  if (this._bust.zoom.y >= this._bust.zoom.maxScale) {
  654.                      this._bust.zoom.y = this._bust.zoom.maxScale;
  655.                          this._bust.zoom.phase = 1;
  656.                  };
  657.          } else {
  658.                  this._bust.zoom.y -= this._bust.zoom.speed
  659.                  if (this._bust.zoom.y <= 0) {
  660.                      this._bust.zoom.y = 0;
  661.                          this._bust.zoom.phase = 0;
  662.                  };                 
  663.          };
  664.          this._bust.scale.y = 1.00 + this._bust.zoom.y;
  665. };

  666. //==============================
  667. // * update Other
  668. //==============================
  669. Actor_CMPicture.prototype.updateOther = function() {         
  670.     this.x = -this._xf;
  671.         this.y = -this._yf;
  672. };       

  673. //==============================
  674. // * need Get Data 2
  675. //==============================
  676. Actor_CMPicture.prototype.needGetData2 = function() {
  677.          if (!this._bust) {return false};
  678.          if (this._bustData) {return false};
  679.          if (!this._bust.bitmap) {return false};
  680.          if (!this._bust.bitmap.isReady()) {return false};
  681.          return true;
  682. };

  683. //==============================
  684. // * Update
  685. //==============================
  686. Actor_CMPicture.prototype.update = function() {
  687.         Sprite.prototype.update.call(this);
  688.         if (this.needRefreshActor()) {this.refreshActor()};
  689.         if (this.needGetData1()) {this.getDataCM1()};
  690.         if (this.needGetData2()) {this.getDataCM2()};
  691.         if (this._supSpriteData ) {this.updateCM1()};
  692.         if (this._bustData) {this.updateCM2()};
  693.         this.updateOther();         
  694. };
复制代码
回复

使用道具 举报

梦石
0
星屑
1445
在线时间
181 小时
注册时间
2022-9-17
回帖
99
 楼主| 发表于 2022-10-29 18:34:21 | 显示全部楼层
排查了一遍,大概率锁定是     actorCMData[0]   导致的BUG。继续排查中……
回复

使用道具 举报

梦石
0
星屑
7898
在线时间
1533 小时
注册时间
2013-12-3
回帖
306
发表于 2022-10-29 18:36:17 | 显示全部楼层
F12 看哪行代码报的错

点评

查看了确实是actorCMData[0]导致了错误,但还没想到修复方法  发表于 2022-10-29 18:49
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部