查看: 3770|回复: 15

[交流讨论] 求教一个图片预加载的插件

[复制链接]
梦石
0
星屑
490
在线时间
60 小时
注册时间
2023-7-19
回帖
58
发表于 2023-8-17 05:57:24 | 显示全部楼层 |阅读模式

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

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

×
目前自制的游戏由于立绘的太大太多,出现了不管打开什么或者过图都要加载一段时间的问题,,需求一个能预加载的插件,有插件的大佬能帮助一下吗
梦石
0
星屑
3244
在线时间
566 小时
注册时间
2020-8-20
回帖
71
发表于 2023-8-17 09:46:19 | 显示全部楼层
试试过个
DKTools
https://dk-plugins.ru/mz/dktools/
回复

使用道具 举报

梦石
0
星屑
490
在线时间
60 小时
注册时间
2023-7-19
回帖
58
 楼主| 发表于 2023-8-17 17:22:57 | 显示全部楼层
pkeasygod 发表于 2023-8-17 09:46
试试过个
DKTools
https://dk-plugins.ru/mz/dktools/

额...多谢,但,很痛苦,我机翻了注释来看,有说是
==============

###初始预压###

允许您在启动游戏时预加载音频和图像文件。



##重要##

仅预加载您真正需要的文件,例如,接口元素!

不要加载游戏地图上使用的图像和声音!

使用“地图预加载”功能!



##自定义路径##

为了预加载具有资源的整个文件夹或具有非标准路径的文件,

您必须在“文本”选项卡而不是“文件”选项卡中指定“路径”。



###=========================================================================

###地图预加载###

允许您在特定地图上预加载音频和图像文件。



##自定义路径##

为了预加载具有资源的整个文件夹或具有非标准路径的文件,

您必须在“文本”选项卡而不是“文件”选项卡中指定“路径”。

但,,我不知道再那开啊,英文不行啊
回复

使用道具 举报

梦石
0
星屑
5087
在线时间
182 小时
注册时间
2021-3-31
回帖
194
发表于 2023-8-18 17:30:03 | 显示全部楼层
dk的?图片的加载基本上每个插件但凡涉及到图片的地方都有,除非是写法有问题,如果要沿用rm的bitmap的话我可以写个单纯的预加载某个或者某些场景的图片?如果要针对某个文件夹下的所有图片也没问题,前提是付费购买,50rmb????,仅适用于,如果不沿用rm的bitmap,往往加载速度更快,但是需要同时处理相应的插件,转换格式
獨立遊戲製作中
有空的时候也可以继续接单mv/mz插件定制
回复

使用道具 举报

梦石
0
星屑
490
在线时间
60 小时
注册时间
2023-7-19
回帖
58
 楼主| 发表于 2023-8-18 21:30:31 | 显示全部楼层
闪电超重火炮 发表于 2023-8-18 17:30
dk的?图片的加载基本上每个插件但凡涉及到图片的地方都有,除非是写法有问题,如果要沿用rm的bitmap的话我 ...

可以,不管因为我是利用空闲时间去制作的(现在在做单子~)~所以会在过段时间有时间做了,考虑一下,因为现在是用插件了,但还没时间研究,先谢谢了~
回复

使用道具 举报

梦石
0
星屑
5844
在线时间
973 小时
注册时间
2015-2-6
回帖
123

开拓者

发表于 2023-8-19 11:05:21 | 显示全部楼层
画像の事前読み込みを改善します,mit协议
  1. //=============================================================================
  2. // PANDA_ImagePreLoad.js
  3. //=============================================================================
  4. // [Update History]
  5. // 2021-05-29 Ver.1.0.0 First Release for MZ.
  6. // 2021-06-23 Ver.1.1.0 fix for subfolder (MZ 1.3.0).
  7. // 2021-07-05 Ver.1.1.1 revert fix for subfolder (MZ 1.3.2).

  8. /*:
  9. * @target MZ
  10. * @plugindesc Improve image preloading.
  11. * @author panda(werepanda.jp)
  12. * @url [url]http://www.werepanda.jp/blog/20210529185556.html[/url]
  13. *
  14. * @help Improve image preloading to eliminate image display lag.
  15. *
  16. * By default, when the event starts, the face images of [Show Text]
  17. * and the picture images of [Show Picture] in the 200 lines
  18. * from the beginning of the event are loaded first.
  19. * This allows the images to be displayed quickly when they are actually used.
  20. * However, since there is no additional preloading of images appearing after
  21. * the 200th line, the lag will be noticeable later in the long event.
  22. *
  23. * To solve this problem,
  24. * this plugin allows you to set the number of lines to preload.
  25. * When the number is 0, all lines of the event will be preloaded.
  26. * However, if the event is very long, it may take some time to preload.
  27. * In addition to the face images of Show Text and the picture of Show Picture,
  28. * the parallaxe images of [Change Parallax] and the character images of
  29. * [Change Image] in [Set Movenemt Route] are also preloaded.
  30. *
  31. * You can also use the plugin command "Preload Image" to preload any images.
  32. *
  33. * [License]
  34. * this plugin is released under MIT license.
  35. * [url]https://opensource.org/licenses/mit-license.php[/url]
  36. *
  37. * @param SliceRows
  38. * @text Preload Lines
  39. * @desc Specify the number of lines to be preloaded in the event. 0 means all lines will be preloaded.
  40. * @type number
  41. * @default 0
  42. * @min 0
  43. *
  44. * @command PRELOAD_IMAGE
  45. * @text Preload Image
  46. * @desc Preload the specified image file.
  47. *
  48. * @arg file
  49. * @text Image File Name
  50. * @desc Specify the image file to be preloaded.
  51. * @type file
  52. * @dir img/
  53. *
  54. */

  55. /*:ja
  56. * @target MZ
  57. * @plugindesc 画像の事前読み込みを改善します。
  58. * @author panda(werepanda.jp)
  59. * @url [url]http://www.werepanda.jp/blog/20210529185556.html[/url]
  60. *
  61. * @help 画像の事前読み込みを改善して、画像の表示ラグを解消します。
  62. *
  63. * デフォルトでは、イベント開始時にイベントの先頭から200行目までにある
  64. * 「文章の表示」の顔グラフィックと「ピクチャの表示」の画像を先に読み込んで
  65. * 実際の使用時に画像を素早く表示できるようになっています。
  66. * しかし、200行目以降に登場する画像を追加で先読みすることはないため、
  67. * 長いイベントの場合、後半は画像の表示ラグが目立ってしまいます。
  68. *
  69. * そこで、プラグインパラメータで先読み行数を任意に設定できるようにしました。
  70. * 先読み行数を 0 にすると、イベントの全行を先読みします。
  71. * ただし、非常に長いイベントの場合は先読みに時間がかかる可能性があります。
  72. * また「文章の表示」の顔グラフィックと「ピクチャの表示」の画像以外に、
  73. * 「遠景の変更」の遠景画像と「移動ルートの設定」中の「画像の変更」で
  74. * 使われる画像ファイルも、先読みしてくれるようになっています。
  75. *
  76. * また、プラグインコマンド「画像先読み」で、任意の画像を先読みできます。
  77. * あわせてご利用ください。
  78. *
  79. * ■ 利用規約
  80. * このプラグインはMITライセンスで配布されます。
  81. * ご自由にお使いください。
  82. * [url]https://opensource.org/licenses/mit-license.php[/url]
  83. *
  84. * @param SliceRows
  85. * @text 先読み行数
  86. * @desc イベントで画像の先読み対象となる行数を指定します。0を指定すると全行が対象になります。
  87. * @type number
  88. * @default 0
  89. * @min 0
  90. *
  91. * @command PRELOAD_IMAGE
  92. * @text 画像先読み
  93. * @desc 指定した画像ファイルを先読みします。
  94. *
  95. * @arg file
  96. * @text 画像ファイル名
  97. * @desc 先読みする画像ファイルを指定します。
  98. * @type file
  99. * @dir img/
  100. *
  101. */

  102. /*:ko
  103. * @target MZ
  104. * @plugindesc 이미지의 미리 불러오기를 개선합니다.
  105. * @author panda(werepanda.jp)
  106. * @url [url]http://www.werepanda.jp/blog/20210529185556.html[/url]
  107. *
  108. * @help 이미지의 미리 불러오기를 개선하여 이미지의 표시 렉을 해소합니다.
  109. *
  110. * 기본적으로 이벤트가 시작할 때에 이벤트 명령의 처음부터 200행까지
  111. * "텍스트 표시"의 얼굴 이미지와 "그림 표시"의 그림을 미리 불러오고
  112. * 실제로 사용할 때에 그 이미지를 빠르게 표시할 수 있습니다.
  113. * 그러나 200행 이후에 등장하는 이미지를 추가로 불러오지는 않기 때문에
  114. * 긴 이벤트의 경우 후반은 이미지의 표시 렉이 눈에 띕니다.
  115. *
  116. * 그래서 플러그인 매개 변수로 미리 불러올 행수를 설정할 수 있도록 했습니다.
  117. * 행수를 0으로 하면, 이벤트의 모든 행을 미리 불러옵니다.
  118. * 다만 매우 긴 이벤트의 경우는 미리 불러오는데 시간이 걸릴 가능성이 있습니다.
  119. * 또한 "텍스트 표시"의 얼굴 이미지와 "그림 표시"의 그림 이미지 이외에도
  120. * "먼 배경 변경"과 "이동 루트 설정"중의 "이미지 변경"에서 사용되는
  121. * 이비지 파일도 미리 불러오기 해줍니다.
  122. *
  123. * 또 플러그인 명령 "이미지 미리 불러오기"로, 임의의 이미지를 미리 불러오기
  124. * 할 수 있습니다. 함께 이용하시기 바랍니다.
  125. *
  126. * [이용 약관]
  127. * 이 플러그인은 MIT 라이센스로 공개됩니다.
  128. * [url]https://opensource.org/licenses/mit-license.php[/url]
  129. *
  130. * @param SliceRows
  131. * @text 미리 불러올 행수
  132. * @desc 이벤트에서 이미지 미리 불러오기 대상이 될 행수를 지정합니다. 0을 지정하면 모든 행이 대상이 됩니다.
  133. * @type number
  134. * @default 0
  135. * @min 0
  136. *
  137. * @command PRELOAD_IMAGE
  138. * @text 이미지 미리 불러오기
  139. * @desc 지정된 이미지 파일을 미리 불러옵니다.
  140. *
  141. * @arg file
  142. * @text 이미지 파일명
  143. * @desc 미리 불러올 이미지 파일을 지정합니다.
  144. * @type file
  145. * @dir img/
  146. *
  147. */


  148. (() => {
  149.         'use strict';
  150.        
  151.         // This Plugin Name
  152.         const pluginName = decodeURIComponent(document.currentScript.src).match(/([^\/]+)\.js$/)[1];
  153.        
  154.         // Parameters
  155.         const parameters = PluginManager.parameters(pluginName);
  156.         const SliceRows = parseInt(parameters['SliceRows']) || 0;
  157.        
  158.        
  159.         //--------------------------------------------------
  160.         // Plugin Command "PreLoad Image"
  161.         //--------------------------------------------------
  162.         PluginManager.registerCommand(pluginName, 'PRELOAD_IMAGE', function(args) {
  163.                
  164.                 // get arguments
  165.                 const file = args['file'] || '';
  166.                
  167.                 // preload image
  168.                 if (file !== '') {
  169.                         ImageManager.loadBitmap('img/', file);
  170.                 }
  171.                
  172.         });
  173.        
  174.        
  175.         //--------------------------------------------------
  176.         // Game_Interpreter.loadImages
  177.         //  [Modified Definition]
  178.         //--------------------------------------------------
  179.         const _Game_Interpreter_loadImages = Game_Interpreter.prototype.loadImages;
  180.         Game_Interpreter.prototype.loadImages = function() {
  181.                 // slice event commands (if SliceRows = 0, get all commands)
  182.                 const list = (SliceRows > 0) ? this._list.slice(0, SliceRows) : this._list;
  183.                 for (const command of list) {
  184.                         switch (command.code) {
  185.                                 case 101: // Show Text
  186.                                         ImageManager.loadFace(command.parameters[0]);
  187.                                         break;
  188.                                 case 231: // Show Picture
  189.                                         ImageManager.loadPicture(command.parameters[1]);
  190.                                         break;
  191.                                 case 284: // Change Parallax (added)
  192.                                         ImageManager.loadParallax(command.parameters[0]);
  193.                                         break;
  194.                                 case 205: // Set Movement Route (added)
  195.                                         const commands = command.parameters[1].list;
  196.                                         for (const cmd of commands) {
  197.                                                 switch (cmd.code) {
  198.                                                         case 41:        // Change Character
  199.                                                                 ImageManager.loadCharacter(cmd.parameters[0]);
  200.                                                                 break;
  201.                                                 }
  202.                                         }
  203.                                         break;
  204.                         }
  205.                 }
  206.         };
  207.        
  208. })();

复制代码

好久没用论坛代码功能,试一下
此书生之言,可言而不可用也 ↑-_-||

仓管610早晚班,没多余精力做别的了 →_→
回复

使用道具 举报

梦石
0
星屑
490
在线时间
60 小时
注册时间
2023-7-19
回帖
58
 楼主| 发表于 2023-8-19 16:19:23 | 显示全部楼层
戏蹑群星斗 发表于 2023-8-19 11:05
画像の事前読み込みを改善します,mit协议
//========================================================== ...

啊,,,这个怎么用,,我是画师,只知道一点点代码知识~
回复

使用道具 举报

梦石
0
星屑
5087
在线时间
182 小时
注册时间
2021-3-31
回帖
194
发表于 2023-8-21 22:50:32 | 显示全部楼层
~谓伊~ 发表于 2023-8-18 21:30
可以,不管因为我是利用空闲时间去制作的(现在在做单子~)~所以会在过段时间有时间做了,考虑一下,因为 ...

问题不大,图片数量过多还有一种解决方式是使用纹理打包
獨立遊戲製作中
有空的时候也可以继续接单mv/mz插件定制
回复

使用道具 举报

梦石
0
星屑
1321
在线时间
116 小时
注册时间
2007-12-15
回帖
59
发表于 2023-8-22 15:42:56 | 显示全部楼层
你看下这个视频,有个延迟处理的方法。使用setTimeout函数
【【RMMZ】边打星铁边做游戏 #5 背包格子-哔哩哔哩】 https://b23.tv/h8d6yGW
回复

使用道具 举报

梦石
0
星屑
490
在线时间
60 小时
注册时间
2023-7-19
回帖
58
 楼主| 发表于 2023-8-22 23:13:58 | 显示全部楼层
wu5563 发表于 2023-8-22 15:42
你看下这个视频,有个延迟处理的方法。使用setTimeout函数
【【RMMZ】边打星铁边做游戏 #5 背包格子-哔哩哔 ...

非常感谢
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部