设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 99|回复: 0

[转载发布] DoubleX RMMV Preloaded Resources

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    8357

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    30721
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    39972

    灌水之王

    发表于 前天 07:57 | 显示全部楼层 |阅读模式
    Purpose
    Lets you sets some audios/images to be loaded upon game start
    This should boost the FPS on phones noticeably if there's enough memory

    Spoiler: Parameters
                    JavaScript:       
    1. * @param IsPreloadAudio
    2. * @type boolean
    3. * @desc Sets whether the specified audios will be preloaded
    4. * @default true
    5. *
    6. * @param preloadAudioMSInterval
    7. * @parent IsPreloadAudio
    8. * @type number
    9. * @desc Sets the number of milliseconds to wait before loading the
    10. * next audio included by the same parameter(0 means no wait)
    11. * @default 0
    12. *
    13. * @param preloadedBGMs
    14. * @parent IsPreloadAudio
    15. * @type file[]
    16. * @dir audio/bgm/
    17. * @desc Sets the list of BGMs to be preloaded
    18. * @default []
    19. *
    20. * @param preloadedBGSs
    21. * @parent IsPreloadAudio
    22. * @type file[]
    23. * @dir audio/bgs/
    24. * @desc Sets the list of BGSs to be preloaded
    25. * @default []
    26. *
    27. * @param preloadedMEs
    28. * @parent IsPreloadAudio
    29. * @type file[]
    30. * @dir audio/me/
    31. * @desc Sets the list of MEs to be preloaded
    32. * @default []
    33. *
    34. * @param preloadedSEs
    35. * @parent IsPreloadAudio
    36. * @type file[]
    37. * @dir audio/se/
    38. * @desc Sets the list of SEs to be preloaded
    39. * @default []
    40. *
    41. * @param preloadedStaticSEs
    42. * @parent IsPreloadAudio
    43. * @type file[]
    44. * @dir audio/se/
    45. * @desc Sets the list of static SEs to be preloaded
    46. * @default []
    47. *
    48. * @param preloadedMiscAudios
    49. * @parent IsPreloadAudio
    50. * @type file[]
    51. * @dir audio/
    52. * @desc Sets the list of other audio files to be preloaded
    53. * @default []
    54. *
    55. * @param IsPreloadImage
    56. * @type boolean
    57. * @desc Sets whether the specified images will be preloaded
    58. * @default true
    59. *
    60. * @param preloadImageMSInterval
    61. * @parent IsPreloadImage
    62. * @type number
    63. * @desc Sets the number of milliseconds to wait before loading the
    64. * next hue and image under the same parameter(0 means no wait)
    65. * @default 0
    66. *
    67. * @param preloadedAnimations
    68. * @parent IsPreloadImage
    69. * @type struct<PreloadedAnimation>[]
    70. * @desc Sets the list of animations to be preloaded
    71. * @default []
    72. *
    73. * @param preloadedBattleBack1s
    74. * @parent IsPreloadImage
    75. * @type struct<PreloadedBattleBack1>[]
    76. * @desc Sets the list of 1st battle backs to be preloaded
    77. * @default []
    78. *
    79. * @param preloadedBattleBack2s
    80. * @parent IsPreloadImage
    81. * @type struct<PreloadedBattleBack2>[]
    82. * @desc Sets the list of 2nd battle backs to be preloaded
    83. * @default []
    84. *
    85. * @param preloadedCharacters
    86. * @parent IsPreloadImage
    87. * @type struct<PreloadedCharacter>[]
    88. * @desc Sets the list of characters to be preloaded
    89. * @default []
    90. *
    91. * @param preloadedEnemies
    92. * @parent IsPreloadImage
    93. * @type struct<PreloadedEnemy>[]
    94. * @desc Sets the list of enemies to be preloaded
    95. * @default []
    96. *
    97. * @param preloadedFaces
    98. * @parent IsPreloadImage
    99. * @type struct<PreloadedFace>[]
    100. * @desc Sets the list of faces to be preloaded
    101. * @default []
    102. *
    103. * @param preloadedParallaxes
    104. * @parent IsPreloadImage
    105. * @type struct<PreloadedParallax>[]
    106. * @desc Sets the list of parallaxes to be preloaded
    107. * @default []
    108. *
    109. * @param preloadedPictures
    110. * @parent IsPreloadImage
    111. * @type struct<PreloadedPicture>[]
    112. * @desc Sets the list of pictures to be preloaded
    113. * @default []
    114. *
    115. * @param preloadedSVActors
    116. * @parent IsPreloadImage
    117. * @type struct<PreloadedSVActor>[]
    118. * @desc Sets the list of sideview actors to be preloaded
    119. * @default []
    120. *
    121. * @param preloadedSVEnemies
    122. * @parent IsPreloadImage
    123. * @type struct<PreloadedSVEnemy>[]
    124. * @desc Sets the list of sideview enemies to be preloaded
    125. * @default []
    126. *
    127. * @param preloadedSystem
    128. * @parent IsPreloadImage
    129. * @type struct<PreloadedSystem>[]
    130. * @desc Sets the list of system images to be preloaded
    131. * @default []
    132. *
    133. * @param preloadedTilesets
    134. * @parent IsPreloadImage
    135. * @type struct<PreloadedTileset>[]
    136. * @desc Sets the list of tilesets to be preloaded
    137. * @default []
    138. *
    139. * @param preloadedTitles1
    140. * @parent IsPreloadImage
    141. * @type struct<PreloadedTitle1>[]
    142. * @desc Sets the list of 1st titles to be preloaded
    143. * @default []
    144. *
    145. * @param preloadedTitles2
    146. * @parent IsPreloadImage
    147. * @type struct<PreloadedTitle2>[]
    148. * @desc Sets the list of 2nd titles to be preloaded
    149. * @default []
    150. *
    151. * @param preloadedMiscImages
    152. * @parent IsPreloadImage
    153. * @type struct<PreloadedMiscImage>[]
    154. * @desc Sets the list of other image files to be preloaded
    155. * @default []
    复制代码


    Spoiler: Help
                    JavaScript:       
    1. * 1. You should only preload resources that are actually used or the game can
    2. *    take an excessively and unnecessarily long time to start
    3. * 2. You might have to test the values of preloadAudioMSInterval and
    4. *    preloadImageMSInterval to have the optimal preload time for your project
    5. * 3. Setting preloadAudioMSInterval/preloadImageMSInterval as 0 might block
    6. *    the UI thread for too long and thus crashing/freezing the game in phones
    7. * 4. You should consider not preloading resources that are only rarely used
    8. *    in case the preloading times are still too long
    9. * 5. Some plugins might use HTML5Audio instead of WebAudio, and preloading
    10. *    audios using HTML5Audio is meaningless HTML5Audio is a static class
    11. *    having nothing to preload
    12. * 6. You should compress the resources to be preoloaded for phones or the
    13. *    extra memory consumption from preloading them can quickly crash/free the
    14. *    game there
    15. * 7. No identical resource should be duplicated in the same parameter or
    16. *    across parameters(this plugin won't explicitly skip those duplicates as
    17. *    simplifying the codes this way can actually reduce preload time)
    18. * 8. If you want to keep the current parameter values in the plugin manager
    19. *    upon using a newer version, you can do the following:
    20. *    - Renames the newer version to be that of the older version
    21. *    - Edits the value of DoubleX_RMMV.Preloaded_Resources_File to be the
    22. *      filename of the older version, which must be done via opening this
    23. *      plugin js file directly
    24. * 9. (Advanced)By default, the images are cached upon first used, and the
    25. *    cache is a Least Recently Used(LRU) cache. This plugin reserves all
    26. *    preloaded images so the LRU will never release them unless they're
    27. *    explicitly told to be released via a script call
    复制代码


    Spoiler: Script Call Info
                    JavaScript:       
    1. *    # Image manipulations
    2. *      1. ImageManager.releasePreloadedFolderImg(param, filename, hue)
    3. *         - Releases the image with the filename filename and hue hue
    4. *           specified in parameter param
    5. *         - This can be useful when an image becomes rarely used and/or the
    6. *           preloaded images are consuming too much memory
    7. *         - Please note that using this script call doesn't always remove the
    8. *           image from the LRU cache instantly as it's still up to the LRU
    9. *           cache to determine when to remove that image now that it can be
    10. *           removed due to no longer being reserved
    11. *         - param and filename are supposed to be String
    12. *         - hue is supposed to be an integer from 0 to 360 inclusive
    13. *         - The script call's supposed to be Idempotent
    14. *      2. ImageManager.releasePreloadedMiscImg(path, hue, smooth)
    15. *         - Releases the image with the path path, hue hue and smooth smooth
    16. *         - This can be useful when an image becomes rarely used and/or the
    17. *           preloaded images are consuming too much memory
    18. *         - Please note that using this script call doesn't always remove the
    19. *           image from the LRU cache instantly as it's still up to the LRU
    20. *           cache to determine when to remove that image now that it can be
    21. *           removed due to no longer being reserved
    22. *         - path is supposed to be a String
    23. *         - hue is supposed to be an integer from 0 to 360 inclusive
    24. *         - smooth is supposed to be a Boolean
    25. *         - The script call's supposed to be Idempotent
    26. *    # Audio manipulations
    27. *      1. AudioManager.invalidateCachedWebAudio(folder, name)
    28. *         - Releases the audio with folder folder and filename name from the
    29. *           audio cache
    30. *         - This only works for non static SE audio loaded as WebAudio
    31. *         - folder is supposed to be a String
    32. *         - name is supposed to be a String
    33. *         - The script call's supposed to be Idempotent
    复制代码


    Spoiler: Prerequisites
    Abilities:
    1. Nothing special for most ordinary cases
       (No capability on Javascript ES5 experience but can still make reasonable guesses on readable novice codes up to 100 LoC scale)
    2. Little RMMV plugin development proficiency to fully utilize this plugin in intended ways
    (Elementary Javascript ES5 exposures being able to write beginner codes up to 300LoC scale )
    Spoiler: Terms Of Use
    1. Commercial use's always allowed and crediting me's always optional.
    2. You shall keep this plugin's Plugin Info part's contents intact.
    3. You shalln't claim that this plugin's written by anyone other than DoubleX or my aliases. I always reserve the right to deny you from using any of my plugins anymore if you've violated this.
    4. If you repost this plugin directly(rather than just linking back), you shall inform me of these direct repostings. I always reserve the right to request you to edit those direct repostings.
    5. CC BY 4.0, except those conflicting with any of the above, applies to this plugin, unless you've my permissions not needing follow so.
    6. I always reserve the right to deny you from using this plugin anymore if you've violated any of the above.
    Spoiler: Contributors
    Authors:
    1. DoubleX
    Plugin Development Collaborators:
    - None So Far
    Bug Reporters:
    - None So Far
    Compatibility Issue Raisers:
    - None So Far
    Feature Requesters:
    - None So Far
    Spoiler: Changelog
    *      v1.00b(GMT 0300 27-Mar-2020):
    *      1. You no longer have to edit the value of
    *         DoubleX_RMMZ.Preloaded_Resources_File when changing the plugin file
    *         name
    *      2. Fixed the crashes when preloading animations, images, etc, wthout
    *         hues(such cases will be understood as having the default hue 0 only)
    v1.00a(GMT 1500 7-Jul-2020):
    1. 1st version of this plugin finished
    Download Link
    Pastebin


    本贴来自国际rpgmaker官方论坛作者:DoubleX处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/doublex-rmmv-preloaded-resources.123760/

    本帖子中包含更多资源

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

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-2 00:10 , Processed in 0.078693 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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