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

Project1

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

[原创发布] 音频图片资源文件压缩包加载插件

[复制链接]

Lv2.观梦者

梦石
0
星屑
711
在线时间
100 小时
注册时间
2024-5-22
帖子
76
跳转到指定楼层
1
发表于 6 天前 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 utunnels 于 2024-9-24 17:19 编辑

当时是给itch上的小游戏做的,支持把图片和声音打包成一个zip文件一次下载。
对大型游戏可能没有什么用,因为下载解包时间太长了,每次进游戏都要解包。
下载地址,留给需要的人吧:https://utstudio.itch.io/zipresourceloader

简单说明下:
插件基本上是即插即用的,只有一个参数就是压缩文件的名称,可以随便改(只要服务器支持的扩展名就行)
游戏发布之前,把img和audio文件夹打包到一个zip文件里,原来的文件可以删除。
注意:只能打包图像和声音文件,其余文件不能放进压缩包
img/system/Loading.png 这个文件要放在压缩包外面,要不然最初加载的时候没法显示Loading...

ZipResourceLoader.zip (12.17 KB, 下载次数: 2)

Lv2.观梦者

梦石
0
星屑
551
在线时间
73 小时
注册时间
2024-5-16
帖子
26
2
发表于 5 天前 | 只看该作者
建议来个仅打包不压缩的版本,素材多了移动不方便,但是压缩会导致游戏变卡
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7524
在线时间
1417 小时
注册时间
2018-12-16
帖子
2008
3
发表于 5 天前 | 只看该作者
本帖最后由 play337 于 2024-9-20 21:29 编辑



01.试了好几遍都是这个错误....

02.我把 ZIP.js 放到 plugins 里面 再改了 插件路径之后
变这个错误...

Uncaught (in promise) TypeError: Cannot read property 'arrayBuffer' of undefined
    at ZipLoader.load (zip-loader.js:357)

回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
711
在线时间
100 小时
注册时间
2024-5-22
帖子
76
4
 楼主| 发表于 4 天前 | 只看该作者
play337 发表于 2024-9-20 21:27
01.试了好几遍都是这个错误....

02.我把 ZIP.js 放到 plugins 里面 再改了 插件路径之后


01
zip-loader.js是放进libs里面了吗,和pixi之类的js在一起?


我看看要不改一下,把两个文件合并了算了,分开安装会造成不必要的麻烦
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
711
在线时间
100 小时
注册时间
2024-5-22
帖子
76
5
 楼主| 发表于 4 天前 | 只看该作者
我更新了一下,现在只用一个js文件就可以了
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7524
在线时间
1417 小时
注册时间
2018-12-16
帖子
2008
6
发表于 3 天前 | 只看该作者
一看就很喜欢这个插件. 马上就来试试...
01. 把插件放到 PLUGINS
02. 打包 IMG 和 AUDIO 变成 RESOURCE.ZIP
03. 删除 IMG 和 AUDIO
04. 把 LOADING.PNG 放在 ZIP同一层目录
05. 运行

loading zip image...
ZipResourceLoader.js:543 resources.zip
Loading.png:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
rpg_managers.js:1949 Error: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The HTMLImageElement provided is in the 'broken' state.
    at Function.Graphics._paintUpperCanvas (rpg_core.js:2569)
    at Function.Graphics.updateLoading (rpg_core.js:1969)
    at Function.SceneManager.onSceneLoading (rpg_managers.js:2046)
    at Function.SceneManager.renderScene (rpg_managers.js:2033)
    at Function.SceneManager.updateMain (rpg_managers.js:1987)
    at Function.SceneManager.update (rpg_managers.js:1907)
SceneManager.catchException @ rpg_managers.js:1949
ZipResourceLoader.js:553 audio/
ZipResourceLoader.js:553 audio/bgm/
ZipResourceLoader.js:553 audio/bgs/
ZipResourceLoader.js:553 audio/me/
ZipResourceLoader.js:553 audio/se/
ZipResourceLoader.js:553 audio/se/Cancel2.ogg
ZipResourceLoader.js:553 audio/se/Item3.ogg
ZipResourceLoader.js:553 audio/se/Move1.ogg
ZipResourceLoader.js:553 audio/se/Slash1.m4a
ZipResourceLoader.js:553 audio/se/Slash1.ogg
ZipResourceLoader.js:553 audio/se/Water1.m4a
ZipResourceLoader.js:553 audio/se/Water1.ogg
ZipResourceLoader.js:553 img/
ZipResourceLoader.js:553 img/animations/
ZipResourceLoader.js:553 img/battlebacks1/
ZipResourceLoader.js:553 img/battlebacks2/
ZipResourceLoader.js:553 img/characters/
ZipResourceLoader.js:553 img/characters/58585858.png
ZipResourceLoader.js:553 img/characters/Actor1.png
ZipResourceLoader.js:553 img/cursors/
ZipResourceLoader.js:553 img/cursors/_index.json
ZipResourceLoader.js:553 img/enemies/
ZipResourceLoader.js:553 img/faces/
ZipResourceLoader.js:553 img/faces/Actor1.png
ZipResourceLoader.js:553 img/parallaxes/
ZipResourceLoader.js:553 img/pictures/
ZipResourceLoader.js:553 img/pictures/Holdbackground.png
ZipResourceLoader.js:553 img/pictures/Holdcursor.png
ZipResourceLoader.js:553 img/pictures/Holdfill.png
ZipResourceLoader.js:553 img/pictures/Holdforeground.png
ZipResourceLoader.js:553 img/pictures/Holdlifetime.png
ZipResourceLoader.js:553 img/sv_actors/
ZipResourceLoader.js:553 img/sv_enemies/
ZipResourceLoader.js:553 img/system/
ZipResourceLoader.js:553 img/system/Balloon.png
ZipResourceLoader.js:553 img/system/ButtonSet.png
ZipResourceLoader.js:553 img/system/Damage.png
ZipResourceLoader.js:553 img/system/GameOver.png
ZipResourceLoader.js:553 img/system/IconSet.png
ZipResourceLoader.js:553 img/system/Loading.png
ZipResourceLoader.js:553 img/system/Shadow1.png
ZipResourceLoader.js:553 img/system/Shadow2.png
ZipResourceLoader.js:553 img/system/States.png
ZipResourceLoader.js:553 img/system/Weapons1.png
ZipResourceLoader.js:553 img/system/Weapons2.png
ZipResourceLoader.js:553 img/system/Weapons3.png
ZipResourceLoader.js:553 img/system/Window.png
ZipResourceLoader.js:553 img/tilesets/
ZipResourceLoader.js:553 img/tilesets/Outside_A1.png
ZipResourceLoader.js:553 img/tilesets/Outside_A1.txt
ZipResourceLoader.js:553 img/tilesets/Outside_A2.png
ZipResourceLoader.js:553 img/tilesets/Outside_A2.txt
ZipResourceLoader.js:553 img/tilesets/Outside_A5.png
ZipResourceLoader.js:553 img/tilesets/Outside_B.png
ZipResourceLoader.js:553 img/tilesets/Outside_B.txt
ZipResourceLoader.js:553 img/titles1/
ZipResourceLoader.js:553 img/titles2/

哭了..........
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
711
在线时间
100 小时
注册时间
2024-5-22
帖子
76
7
 楼主| 发表于 3 天前 | 只看该作者
Loading.png要放在原来的位置上,所以img/system不能全删了

点评

OK ! ^_^  发表于 3 天前
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7524
在线时间
1417 小时
注册时间
2018-12-16
帖子
2008
8
发表于 3 天前 | 只看该作者
本帖最后由 play337 于 2024-9-22 22:02 编辑

请问这个错误又是为什麽呢?

01.放在本地跑
rpg_managers.js:1919 Uncaught TypeError: Cannot read property 'removeEventListener' of null
SceneManager.onError @ rpg_managers.js:1919
rpg_managers.js:1920 chrome-extension://njgcanhfjdabfmnlmpmdedalocpafnhl/js/rpg_core.js 1632
SceneManager.onError @ rpg_managers.js:1920
rpg_core.js:1632 Uncaught TypeError: Cannot read property 'removeEventListener' of null
    at Bitmap._onError (rpg_core.js:1632)
    at XMLHttpRequest.requestFile.onerror (rpg_core.js:9229)
img/pictures/00-0menu001.rpgmvp:1 Failed to load resource: net::ERR_FILE_NOT_FOUND

02.放上网络跑
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
711
在线时间
100 小时
注册时间
2024-5-22
帖子
76
9
 楼主| 发表于 3 天前 | 只看该作者
play337 发表于 2024-9-22 21:58
请问这个错误又是为什麽呢?

01.放在本地跑

00-0menu001 这个文件存在吗?

这两个错误我没有遇到过,第二个F12看看控制台说啥?

点评

00-0menu001.png 吧...  发表于 3 天前
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
711
在线时间
100 小时
注册时间
2024-5-22
帖子
76
10
 楼主| 发表于 3 天前 | 只看该作者
play337 发表于 2024-9-22 21:58
请问这个错误又是为什麽呢?

01.放在本地跑


我又测试了一下,发现这个解压缩的库比较挑文件。
用windows自带的压缩做出来的zip它不能完全解压。
用7zip做出来的zip文件就没问题。

点评

windows 和 7zip 我测试完都是一样的错误.....  发表于 3 天前
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-25 07:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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