设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 503|回复: 4
打印 上一主题 下一主题

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

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1268
在线时间
160 小时
注册时间
2022-9-17
帖子
101
跳转到指定楼层
1
发表于 2022-10-29 18:19:20 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x


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

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

Lv3.寻梦者

梦石
0
星屑
1268
在线时间
160 小时
注册时间
2022-9-17
帖子
101
2
 楼主| 发表于 2022-10-29 18:22:51 | 只看该作者
附上出BUG的脚本插件,这是MOG系列里的。在战斗中选择角色会触发上述的BUG。
JS 代码复制
  1. //=============================================================================
  2. // MOG_ActorPictureCM.js
  3. //=============================================================================
  4.  
  5. /*:
  6. * @target MZ
  7. * @plugindesc (v1.0) Apresenta a imagem do personagem durante a seleção de comandos.
  8. * @author Moghunter
  9. *
  10. * @param -> MAIN <<<<<<<<<<<<<<<<<<<<<<<
  11. * @desc
  12. *
  13. * @param Slide Speed
  14. * @parent -> MAIN <<<<<<<<<<<<<<<<<<<<<<<
  15. * @desc Definição da velocidade de deslize.
  16. * @default 10
  17. *
  18. * @param
  19. *
  20. * @param -> BUST <<<<<<<<<<<<<<<<<<<<<<<
  21. * @desc
  22. *
  23. * @param Bust Visible
  24. * @parent -> BUST <<<<<<<<<<<<<<<<<<<<<<<
  25. * @text Visible
  26. * @type boolean
  27. * @desc Ativar a imagem do personagem.
  28. * @default true
  29. *
  30. * @param Bust X-Axis
  31. * @text X-Axis
  32. * @parent -> BUST <<<<<<<<<<<<<<<<<<<<<<<
  33. * @desc Definição da posição X-axis da imagem.
  34. * @default 608
  35. *
  36. * @param Bust Y-Axis
  37. * @text Y-Axis
  38. * @parent -> BUST <<<<<<<<<<<<<<<<<<<<<<<
  39. * @desc Definição da posição Y-axis da imagem.
  40. * @default 624
  41. *
  42. * @param Bust Slide X
  43. * @text Slide Animation X
  44. * @parent -> BUST <<<<<<<<<<<<<<<<<<<<<<<
  45. * @desc Definição de deslize X-Axis.
  46. * @default -150
  47. *
  48. * @param Bust Slide Y
  49. * @text Slide Animation Y
  50. * @parent -> BUST <<<<<<<<<<<<<<<<<<<<<<<
  51. * @desc Definição de deslize Y-Axis.
  52. * @default 0  
  53. *
  54. * @param Breath Effect
  55. * @text Breath Animation
  56. * @parent -> BUST <<<<<<<<<<<<<<<<<<<<<<<
  57. * @type boolean
  58. * @desc Ativar respiração de respiração.
  59. * @default false
  60. *
  61. * @param
  62. *
  63. * @param -> FACE <<<<<<<<<<<<<<<<<<<<<<<
  64. * @desc
  65. *
  66. * @param Face Visible
  67. * @text Visible
  68. * @parent -> FACE <<<<<<<<<<<<<<<<<<<<<<<
  69. * @type boolean
  70. * @desc Ativar a imagem da Face.
  71. * @default true
  72. *
  73. * @param Face X-Axis
  74. * @text X-Axis
  75. * @parent -> FACE <<<<<<<<<<<<<<<<<<<<<<<
  76. * @desc Definição da posição X-axis da imagem.
  77. * @default 570
  78. *
  79. * @param Face Y-Axis
  80. * @text Y-Axis
  81. * @parent -> FACE <<<<<<<<<<<<<<<<<<<<<<<  
  82. * @desc Definição da posição Y-axis da imagem.
  83. * @default 0
  84. *
  85. * @param Face Slide X
  86. * @text Slide Animation X
  87. * @parent -> FACE <<<<<<<<<<<<<<<<<<<<<<<  
  88. * @desc Definição de deslize X-Axis.
  89. * @default 150
  90. *
  91. * @param Face Slide Y
  92. * @text Slide Animation Y
  93. * @parent -> FACE <<<<<<<<<<<<<<<<<<<<<<<   
  94. * @desc Definição de deslize Y-Axis.
  95. * @default 0
  96. *
  97. * @command ActorPicture_setFileName
  98. * @desc Mudar o gráfico do personagem.
  99. * @text FileName (Bust)
  100. *
  101. * @arg id
  102. * @desc Definição da ID do personagem
  103. * @text Id
  104. * @default 1
  105. * @type number
  106. * @min 1
  107. *
  108. * @arg filename
  109. * @desc Definição do arquivo de imagem.
  110. * @text File Name
  111. * @default Bust_Test
  112. * @type file
  113. * @dir img/actor_picture_cm/
  114. *
  115. * @arg breath
  116. * @desc Ativar o efeito de respirar.
  117. * @text Breath Effect
  118. * @default false
  119. * @type boolean
  120. *
  121. * @arg visible
  122. * @desc Apresentar ou ocultar a imagem.
  123. * @text Visible
  124. * @default true
  125. * @type boolean
  126. *
  127. * @command ActorPicture_setFileName2
  128. * @desc Mudar o gráfico do personagem Suport.
  129. * @text FileName (Sup)
  130. *
  131. * @arg id
  132. * @desc Definição da ID do personagem
  133. * @text Id
  134. * @default 1
  135. * @type number
  136. * @min 1
  137. *
  138. * @arg filename
  139. * @desc Definição do arquivo de imagem.
  140. * @text File Name
  141. * @default Bust_Test2
  142. * @type file
  143. * @dir img/actor_picture_cm/
  144. *
  145. * @arg visible
  146. * @desc Apresentar ou ocultar a imagem.
  147. * @text Visible
  148. * @default true
  149. * @type boolean
  150. *  
  151. * @help  
  152. * =============================================================================
  153. * +++ MOG - Actor Picture CM (v1.0) +++
  154. * By Moghunter
  155. * [url]https://atelierrgss.wordpress.com/[/url]
  156. * =============================================================================
  157. * Apresenta a imagem do personagem durante a seleção de comandos.
  158. *
  159. * =============================================================================
  160. * - REQUIRED FILES -
  161. * =============================================================================
  162. * As imagens dos personagens devem ser gravadas na pasta. /img/actor_picture_cm/
  163. * A nomeação dos arquivos devem ser feitas da seguinte forma.
  164. *
  165. * Actor_ + ID + _bust.png
  166. *
  167. * Exemplo
  168. *
  169. * -> Actor_1_bust.png
  170. * -> Actor_2_bust.png
  171. * -> Actor_3_bust.png
  172. *
  173. * ----------------------------------------------------------------------------
  174. *
  175. * Para definir a imagem secundária do personagem nomeie o arquivo da seguinte
  176. * forma.
  177. *
  178. * -> Actor_ ID + _sub.png
  179. *
  180. * Exemplo
  181. *
  182. * -> Actor_1_sub.png
  183. * -> Actpr_2_sub.png
  184. * -> ...
  185. *
  186. */
  187.  
  188. //=============================================================================
  189. // ** PLUGIN PARAMETERS
  190. //=============================================================================
  191.  
  192. //=============================================================================
  193. // ** PLUGIN PARAMETERS
  194. //=============================================================================
  195.   var Imported = Imported || {};
  196.   Imported.MOG_ActorPictureCM = true;
  197.   var Moghunter = Moghunter || {};
  198.  
  199.    Moghunter.parameters = PluginManager.parameters('MOG_ActorPictureCM');
  200.     Moghunter.actor_slideSpeed = Number(Moghunter.parameters['Slide Speed'] || 10);
  201.         Moghunter.actor_fileName = String(Moghunter.parameters['File Name'] || "Actor_");
  202.     Moghunter.actor_cm1_visible = String(Moghunter.parameters['Face Visible'] || "true");
  203.         Moghunter.actor_cm1_slideX = Number(Moghunter.parameters['Face Slide X'] || 150);
  204.         Moghunter.actor_cm1_slideY = Number(Moghunter.parameters['Face Slide Y'] || 0);
  205.         Moghunter.actor_cm1_x = Number(Moghunter.parameters['Face X-Axis'] || 570);
  206.     Moghunter.actor_cm1_y = Number(Moghunter.parameters['Face Y-Axis'] || 0);
  207.         Moghunter.actor_cm2_visible = String(Moghunter.parameters['Bust Visible'] || "true");
  208.         Moghunter.actor_cm2_slideX = Number(Moghunter.parameters['Bust Slide X'] || -150);
  209.         Moghunter.actor_cm2_slideY = Number(Moghunter.parameters['Bust Slide Y'] || 0);       
  210.         Moghunter.actor_cm2_x = Number(Moghunter.parameters['Bust X-Axis'] || 408);
  211.     Moghunter.actor_cm2_y = Number(Moghunter.parameters['Bust Y-Axis'] || 624);
  212.         Moghunter.actor_cm2_breathEffect = String(Moghunter.parameters['Breath Effect'] || "true");
  213.  
  214. //=============================================================================
  215. // ■■■  PluginManager ■■■
  216. //=============================================================================       
  217. PluginManager.registerCommand('MOG_ActorPictureCM', "ActorPicture_setFileName", data => {
  218.         var id = Number(data.id);
  219.         var fileName = data.filename;
  220.         var visible = String(data.visible) == "true" ? true : false;
  221.         var breath = String(data.breath) == "true" ? true : false;
  222.         for (var i = 0; i < $gameParty.members().length; i++) {
  223.             var actor = $gameParty.members()[i];
  224.                 if (actor._actorId === id) {
  225.                         if (actor) {
  226.                                 actor.setBattleBust_1(fileName);
  227.                                 actor.visbattleBust_1(visible);
  228.                                 actor.setActorCMbreathEffect(breath)
  229.                         };
  230.                 };
  231.         };
  232. });
  233.  
  234. PluginManager.registerCommand('MOG_ActorPictureCM', "ActorPicture_setFileName2", data => {
  235.         var id = Number(data.id);
  236.         var fileName = data.filename;
  237.         var visible = String(data.visible) == "true" ? true : false;
  238.         for (var i = 0; i < $gameParty.members().length; i++) {
  239.             var actor = $gameParty.members()[i];
  240.                 if (actor._actorId === id) {
  241.                         if (actor) {
  242.                                 actor.setBattleBust_2(fileName);
  243.                                 actor.visbattleBust_2(visible);
  244.                         };
  245.                 };
  246.         };
  247. });
  248.  
  249. //=============================================================================
  250. // ■■■ ImageManager ■■■
  251. //=============================================================================
  252.  
  253. //==============================
  254. // * Load Actor Pic CM
  255. //==============================
  256. ImageManager.loadActorpicCM = function(filename) {
  257.     return this.loadBitmap('img/actor_picture_cm/', filename, 0, true);
  258. };                       
  259.  
  260. //=============================================================================
  261. // ■■■ Game_Temp ■■■
  262. //=============================================================================
  263.  
  264. //==============================
  265. // ♦ ALIAS ♦  Initialize
  266. //==============================
  267. var _alias_mog_actorcm_temp_initialize = Game_Temp.prototype.initialize;
  268. Game_Temp.prototype.initialize = function() {
  269.         _alias_mog_actorcm_temp_initialize.call(this);
  270.     this._actorCmData = [false,false,true];
  271. };
  272.  
  273. //=============================================================================
  274. // ■■■ Game_System ■■■
  275. //=============================================================================
  276.  
  277. //==============================
  278. // ♦ ALIAS ♦  Initialize
  279. //==============================
  280. var _alias_mog_actorcm_sys_initialize = Game_System.prototype.initialize;
  281. Game_System.prototype.initialize = function() {
  282.         _alias_mog_actorcm_sys_initialize.call(this);
  283.     this._actorCmOffSet = [true,0,0];
  284. };       
  285.  
  286. //=============================================================================
  287. // ■■■ Game Interpreter ■■■
  288. //=============================================================================
  289.  
  290. //==============================
  291. // * PluginCommand
  292. //==============================
  293. var _mog_actorCM_gint_pluginCommand = Game_Interpreter.prototype.pluginCommand
  294. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  295.         _mog_actorCM_gint_pluginCommand.call(this,command, args)
  296.         if (command === "actorCM_fileName")  {this.setActorCM(args)};
  297.         if (command === "actorCM_breathEffect")  {this.setActorBreathEffect(args)};
  298.         return true;
  299. };
  300.  
  301. //==============================
  302. // * Set Actor CM
  303. //==============================
  304. Game_Interpreter.prototype.setActorCM = function(args) {
  305.         var id = Number(args[1]);
  306.         var fileName = String(args[3]);
  307.         for (var i = 0; i < $gameParty.members().length; i++) {
  308.             var actor = $gameParty.members()[i];
  309.                 if (actor._actorId === id) {
  310.                         if (actor) {actor.setActorCMNAme(fileName)};
  311.                 };
  312.         };
  313. };
  314.  
  315. //==============================
  316. // * Set Actor Breath Effect
  317. //==============================
  318. Game_Interpreter.prototype.setActorBreathEffect = function(args) {
  319.         var id = Number(args[1]);
  320.         var enable = String(args[3]) == "true" ? true : false;
  321.         for (var i = 0; i < $gameParty.members().length; i++) {
  322.             var actor = $gameParty.members()[i];
  323.                 if (actor._actorId === id) {
  324.                         if (actor) {actor.setActorCMbreathEffect(enable)};
  325.                 };
  326.         };
  327. };
  328.  
  329. //=============================================================================
  330. // ■■■ Game_Actor ■■■
  331. //=============================================================================
  332.  
  333. //==============================
  334. // ♦ ALIAS ♦  Initialize
  335. //==============================
  336. var _mog_actorcm_gactor_initMembers = Game_Actor.prototype.initMembers;
  337. Game_Actor.prototype.initMembers = function() {
  338.         _mog_actorcm_gactor_initMembers.call(this);
  339.         var breathEffect = String(Moghunter.actor_cm2_breathEffect) == "true" ? true : false;
  340.         this._actorCMData = ["",0,0,breathEffect,"",true,true];
  341. };
  342.  
  343. //==============================
  344. // ♦ ALIAS ♦  Setup
  345. //==============================
  346. var _mog_actorcm_gactor_setup = Game_Actor.prototype.setup;
  347. Game_Actor.prototype.setup = function(actorId) {
  348.         _mog_actorcm_gactor_setup.call(this,actorId);
  349.         this._actorCMData[0] = "Actor_" + this._actorId + "_bust";
  350.         this._actorCMData[4] = "Actor_" + this._actorId + "_sup";
  351. };
  352.  
  353.  
  354. //==============================
  355. // * battle Bust 1
  356. //==============================
  357. Game_Actor.prototype.battleBust_1 = function() {
  358.         return String(this._actorCMData[0]);
  359. };
  360.  
  361. //==============================
  362. // * battle Bust 2
  363. //==============================
  364. Game_Actor.prototype.battleBust_2 = function() {
  365.         return String(this._actorCMData[4]);
  366. };
  367.  
  368. //==============================
  369. // * set Battle bust 1
  370. //==============================
  371. Game_Actor.prototype.setBattleBust_1 = function(filename) {
  372.     this._actorCMData[0] = filename;
  373. };
  374.  
  375. //==============================
  376. // * vis Battle bust 1
  377. //==============================
  378. Game_Actor.prototype.visbattleBust_1 = function(visible) {
  379.     this._actorCMData[5] = visible;
  380. };
  381.  
  382. //==============================
  383. // * set Battle bust 2
  384. //==============================
  385. Game_Actor.prototype.setBattleBust_2 = function(filename) {
  386.     this._actorCMData[4] = filename;
  387. };
  388.  
  389. //==============================
  390. // * vis Battle bust 2
  391. //==============================
  392. Game_Actor.prototype.visbattleBust_2 = function(visible) {
  393.     this._actorCMData[6] = visible;
  394. };
  395.  
  396. //==============================
  397. // * set Actor CM Breath Effect
  398. //==============================
  399. Game_Actor.prototype.setActorCMbreathEffect = function(enable) {
  400.         this._actorCMData[3] = enable;
  401. };       
  402.  
  403. //=============================================================================
  404. // ■■■ Scene Base ■■■
  405. //=============================================================================
  406.  
  407. //==============================
  408. // ** create Hud Field
  409. //==============================
  410. Scene_Base.prototype.createHudField = function() {
  411.         this._hudField = new Sprite();
  412.         this._hudField.z = 10;
  413.         this.addChild(this._hudField);
  414. };
  415.  
  416. //==============================
  417. // ** sort MZ
  418. //==============================
  419. Scene_Base.prototype.sortMz = function() {
  420.    this._hudField.children.sort((a, b) => a.z - b.z);
  421. };
  422.  
  423. //=============================================================================
  424. // ■■■ Scene Battle ■■■
  425. //=============================================================================
  426.  
  427. //==============================
  428. // ♦ ALIAS ♦  create Spriteset
  429. //==============================
  430. var _mog_actorPicCM_sbattle_createSpriteset = Scene_Battle.prototype.createSpriteset;
  431. Scene_Battle.prototype.createSpriteset = function() {
  432.         _mog_actorPicCM_sbattle_createSpriteset.call(this);
  433.         if (!this._hudField) {this.createHudField()};
  434.     this.createActorCM();
  435.         this.sortMz();       
  436. };
  437.  
  438. //==============================
  439. // * Create Actor CM
  440. //==============================
  441. Scene_Battle.prototype.createActorCM = function() {
  442.       this.actorPictureCM = new Actor_CMPicture();
  443.       this.actorPictureCM.z = 3;
  444.       this._hudField.addChild(this.actorPictureCM);
  445. };
  446.  
  447. //==============================
  448. // ♦ ALIAS ♦  Update
  449. //==============================
  450. var _alias_mog_actorcm_scbat_update = Scene_Battle.prototype.update;
  451. Scene_Battle.prototype.update = function() {
  452.         _alias_mog_actorcm_scbat_update.call(this);
  453.         $gameTemp._actorCmData[0] = this.sprite_actor_cm_visible();
  454. };
  455.  
  456. //==============================
  457. // * Sprite Actor CM Visible
  458. //==============================
  459. Scene_Battle.prototype.sprite_actor_cm_visible = function() {
  460.         if (!BattleManager.actor()) {return false};
  461.         if (this._actorWindow.active) {return false};
  462.         if (this._enemyWindow.active) {return false};
  463.         if (this._partyCommandWindow.active) {return false};
  464.         if ($gameMessage.isBusy()) {return false};
  465.         if (!BattleManager.isInputting()) {return false};
  466.         return true;
  467. };
  468.  
  469. //=============================================================================
  470. // ■■■ Actor_CMPicture ■■■
  471. //=============================================================================
  472. function Actor_CMPicture() {
  473.     this.initialize.apply(this, arguments);
  474. };
  475.  
  476. Actor_CMPicture.prototype = Object.create(Sprite.prototype);
  477. Actor_CMPicture.prototype.constructor = Actor_CMPicture;
  478.  
  479. //==============================
  480. // * Initialize
  481. //==============================
  482. Actor_CMPicture.prototype.initialize = function() {
  483.     Sprite.prototype.initialize.call(this);       
  484.         this._actor = null;
  485.         this._CmName = null;
  486.         this._breahEffect = false;
  487.         $gameTemp._actorCmData = [false,false,true];
  488.         this._cm1 = String(Moghunter.actor_cm1_visible) === "true" ? true : false;
  489.         this._cm2 = String(Moghunter.actor_cm2_visible) === "true" ? true : false;
  490.         this._xf = 816 - Graphics.width;
  491.     this._yf = 624 - Graphics.height;               
  492.         this._sldSpd = Math.min(Math.max(Moghunter.actor_slideSpeed,1),999);
  493.         if (this._cm1) {this.createCM1()};
  494.         if (this._cm2) {this.createCM2()};
  495. };
  496.  
  497. //==============================
  498. // * is Visible
  499. //==============================
  500. Actor_CMPicture.prototype.isVisible = function() {
  501.         if (!$gameSystem._actorCmOffSet[0]) {return false};
  502.         if (!$gameTemp._actorCmData[2]) {return false};
  503.     return $gameTemp._actorCmData[0];
  504. };
  505.  
  506. //==============================
  507. // * create CM1
  508. //==============================
  509. Actor_CMPicture.prototype.createCM1 = function() {
  510.     this._supSprite = new Sprite();
  511.         this._supSprite.visible = false;
  512.         this._supSpriteData = null;
  513.         this.addChild(this._supSprite);
  514. };
  515.  
  516. //==============================
  517. // * create CM2
  518. //==============================
  519. Actor_CMPicture.prototype.createCM2 = function() {
  520.     this._bust = new Sprite();
  521.         this._bust.anchor.x = 0.5;
  522.         this._bust.anchor.y = 1.0;
  523.         this._bust.visible = false;
  524.         this._bustData = null;
  525.         this.addChild(this._bust);
  526. };
  527.  
  528. //==============================
  529. // * Hide Sprites
  530. //==============================
  531. Actor_CMPicture.prototype.hideSprites = function() {
  532.         if (this._supSprite) {this._supSprite.visible = false};
  533.     if (this._bust) {this._bust.visible = false};
  534. };
  535.  
  536. //==============================
  537. // * move To
  538. //==============================
  539. Actor_CMPicture.prototype.moveto = function(value,real_value) {
  540.         if (value == real_value) {return value};
  541.         var dnspeed = 2 + (Math.abs(value - real_value) / this._sldSpd);
  542.         if (value > real_value) {value -= dnspeed;
  543.             if (value < real_value) {value = real_value};}
  544.     else if (value < real_value) {value  += dnspeed;
  545.             if (value  > real_value) {value  = real_value};               
  546.     };
  547.         return Math.floor(value);
  548. };
  549.  
  550. //==============================
  551. // * Need Refresh Actor
  552. //==============================
  553. Actor_CMPicture.prototype.refreshActor = function() {
  554.         this._actor = BattleManager.actor();
  555.         if (this._actor) {this.refreshSprites()};
  556. };
  557.  
  558. //==============================
  559. // * refresh Bitmap CM1
  560. //==============================
  561. Actor_CMPicture.prototype.refreshBitmapCM1 = function() {
  562.         var fileName = !this._actor._actorCMData[6] ? "" : this._actor.battleBust_2();
  563.     this._supSprite.bitmap = ImageManager.loadActorpicCM(fileName);       
  564.         this._supSprite.visible = false;
  565.         this._supSpriteData = null;
  566. };
  567.  
  568. //==============================
  569. // * refresh Bitmap CM2
  570. //==============================
  571. Actor_CMPicture.prototype.refreshBitmapCM2 = function() {
  572.         var fileName = !this._actor._actorCMData[5] ? "" : this._actor.battleBust_1();
  573.     this._bust.bitmap = ImageManager.loadActorpicCM(fileName);       
  574.         this._bust.visible = false;
  575.         this._bust.zoom = {}
  576.         this._bust.zoom.speed = 0.0004;
  577.         this._bust.zoom.maxScale = 0.008;
  578.         this._bust.zoom.phase = 0;
  579.         this._bust.zoom.y = 0;
  580.         this._breahEffect = false;
  581.         this._bustData = null;
  582. };
  583.  
  584. //==============================
  585. // * refresh Sprites
  586. //==============================
  587. Actor_CMPicture.prototype.refreshSprites = function() {
  588.         this._CmName = this._actor ? this._actor.battleBust_1() : null;
  589.     if (this._supSprite) {this.refreshBitmapCM1()};
  590.         if (this._bust) {this.refreshBitmapCM2()};
  591. };
  592.  
  593. //==============================
  594. // * Need Refresh Actor
  595. //==============================
  596. Actor_CMPicture.prototype.needRefreshActor = function() {
  597.          if ($gameTemp._actorCmData[1]) {return true};
  598.          if (BattleManager.actor() != this._actor) {return true};
  599.          if (this._actor && this._CmName != this._actor.battleBust_1())
  600.      return false;
  601. };
  602.  
  603. //==============================
  604. // * get Data CM1
  605. //==============================
  606. Actor_CMPicture.prototype.getDataCM1 = function() {
  607.     this._supSpriteData = [this._supSprite.bitmap.width,this._supSprite.bitmap.height,
  608.                            Moghunter.actor_cm1_x,Moghunter.actor_cm1_y,0,0,true,
  609.                                            Moghunter.actor_cm1_slideX,Moghunter.actor_cm1_slideY
  610.                                           ];
  611.         this._supSprite.visible = this._actor._actorCMData[6];
  612.         this._supSprite.opacity = 0;
  613.         this._supSprite.x = this._supSpriteData[6] ? this._supSpriteData[2] + this._supSpriteData[7] : this._supSpriteData[2];
  614.         this._supSprite.y = this._supSpriteData[6] ? this._supSpriteData[3] + this._supSpriteData[8] : this._supSpriteData[3];
  615. };
  616.  
  617. //==============================
  618. // * Update CM1
  619. //==============================
  620. Actor_CMPicture.prototype.updateCM1 = function() {
  621.          if (!this.isVisible()) {
  622.              this._supSpriteData[4] = this._supSpriteData[2] + this._supSpriteData[7];
  623.              this._supSpriteData[5] = this._supSpriteData[3] + this._supSpriteData[8];
  624.                  this._supSprite.opacity -= 15;
  625.          } else {
  626.              this._supSpriteData[4] = this._supSpriteData[2];
  627.              this._supSpriteData[5] = this._supSpriteData[3];
  628.                  this._supSprite.opacity += 15;
  629.          };         
  630.          this._supSprite.x = this.moveto(this._supSprite.x,this._supSpriteData[4]);
  631.          this._supSprite.y = this.moveto(this._supSprite.y,this._supSpriteData[5]);
  632. };
  633.  
  634. //==============================
  635. // * need Get Data 1
  636. //==============================
  637. Actor_CMPicture.prototype.needGetData1 = function() {
  638.          if (!this._supSprite) {return false};
  639.          if (this._supSpriteData) {return false};
  640.          if (!this._supSprite.bitmap) {return false};
  641.          if (!this._supSprite.bitmap.isReady()) {return false};
  642.          return true;
  643. };
  644.  
  645. //==============================
  646. // * get Data CM2
  647. //==============================
  648. Actor_CMPicture.prototype.getDataCM2 = function() {
  649.     this._bustData = [this._bust.bitmap.width,this._bust.bitmap.height,
  650.                            Moghunter.actor_cm2_x,Moghunter.actor_cm2_y,0,0,true,
  651.                                            Moghunter.actor_cm2_slideX,Moghunter.actor_cm2_slideY,
  652.                                           0,0,0];
  653.         this._bust.visible = this._actor._actorCMData[5];
  654.         this._bust.opacity = 0;
  655.         this._bustData[2] = Moghunter.actor_cm2_x;
  656.         this._bustData[3] = Moghunter.actor_cm2_y;
  657.         this._bust.x = this._bustData[6] ? this._bustData[2] + this._bustData[7] : this._bustData[2];
  658.         this._bust.y = this._bustData[6] ? this._bustData[3] + this._bustData[8] : this._bustData[3];
  659.         this._breahEffect = this._actor._actorCMData[3];
  660. };
  661.  
  662. //==============================
  663. // * refresh Frame
  664. //==============================
  665. Actor_CMPicture.prototype.refreshFrame = function(sprite,index) {
  666.     var cw = this._eyesData.cw;
  667.         var ch = this._eyesData.ch;
  668.         var fr = cw * index;
  669.     sprite.setFrame(fr,0,cw,ch)
  670. };
  671.  
  672. //==============================
  673. // * breathSpeed
  674. //==============================
  675. Actor_CMPicture.prototype.breathSpeed = function() {
  676.      return  0.000225;
  677. };
  678.  
  679. //==============================
  680. // * Update CM2
  681. //==============================
  682. Actor_CMPicture.prototype.updateCM2 = function() {
  683.          if (!this.isVisible()) {
  684.              this._bustData[4] = this._bustData[2] + this._bustData[7];
  685.              this._bustData[5] = this._bustData[3] + this._bustData[8];
  686.                  this._bust.opacity -= 15;
  687.          } else {
  688.              this._bustData[4] = this._bustData[2];
  689.              this._bustData[5] = this._bustData[3];
  690.                  this._bust.opacity += 15;
  691.          };         
  692.          this._bust.x = this.moveto(this._bust.x,this._bustData[4]);
  693.          this._bust.y = this.moveto(this._bust.y,this._bustData[5]);
  694.      if (this._breahEffect && this._bust.opacity > 0) {this.updateBreathEffect()};
  695. };
  696.  
  697. //==============================
  698. // * Update Breath Effect
  699. //==============================
  700. Actor_CMPicture.prototype.updateBreathEffect = function() {         
  701.          this._bust.zoom.speed = this.breathSpeed();
  702.          if (this._bust.zoom.phase === 0) {
  703.                  this._bust.zoom.y += this._bust.zoom.speed
  704.                  if (this._bust.zoom.y >= this._bust.zoom.maxScale) {
  705.                      this._bust.zoom.y = this._bust.zoom.maxScale;
  706.                          this._bust.zoom.phase = 1;
  707.                  };
  708.          } else {
  709.                  this._bust.zoom.y -= this._bust.zoom.speed
  710.                  if (this._bust.zoom.y <= 0) {
  711.                      this._bust.zoom.y = 0;
  712.                          this._bust.zoom.phase = 0;
  713.                  };                 
  714.          };
  715.          this._bust.scale.y = 1.00 + this._bust.zoom.y;
  716. };
  717.  
  718. //==============================
  719. // * update Other
  720. //==============================
  721. Actor_CMPicture.prototype.updateOther = function() {         
  722.     this.x = -this._xf;
  723.         this.y = -this._yf;
  724. };       
  725.  
  726. //==============================
  727. // * need Get Data 2
  728. //==============================
  729. Actor_CMPicture.prototype.needGetData2 = function() {
  730.          if (!this._bust) {return false};
  731.          if (this._bustData) {return false};
  732.          if (!this._bust.bitmap) {return false};
  733.          if (!this._bust.bitmap.isReady()) {return false};
  734.          return true;
  735. };
  736.  
  737. //==============================
  738. // * Update
  739. //==============================
  740. Actor_CMPicture.prototype.update = function() {
  741.         Sprite.prototype.update.call(this);
  742.         if (this.needRefreshActor()) {this.refreshActor()};
  743.         if (this.needGetData1()) {this.getDataCM1()};
  744.         if (this.needGetData2()) {this.getDataCM2()};
  745.         if (this._supSpriteData ) {this.updateCM1()};
  746.         if (this._bustData) {this.updateCM2()};
  747.         this.updateOther();         
  748. };
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1268
在线时间
160 小时
注册时间
2022-9-17
帖子
101
3
 楼主| 发表于 2022-10-29 18:34:21 | 只看该作者
排查了一遍,大概率锁定是     actorCMData[0]   导致的BUG。继续排查中……
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5529
在线时间
1142 小时
注册时间
2013-12-3
帖子
271
4
发表于 2022-10-29 18:36:17 | 只看该作者
F12 看哪行代码报的错

点评

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

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-11 19:45

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表