creator3.0 TileMap 资源路径问题

  • Creator 版本:creator 3.0

  • 目标平台: all

  • 重现方式:

  • 首个报错:
    vconsole.min.js:10 [error]: WalkPoint not find in [WalkPoint.jpg, FlyPoint.jpg, Background100001_4.jpg, Background100001_1.jpg, Background100001_2.jpg, Background100001_3.jpg]
    value @ vconsole.min.js:10
    value @ vconsole.min.js:10
    window.console. @ vconsole.min.js:10
    value @ vconsole.min.js:10
    value @ vconsole.min.js:10
    window.console. @ vconsole.min.js:10
    parseXMLString @ tmx-xml-parser.ts:670
    initWithXML @ tmx-xml-parser.ts:523
    TMXMapInfo @ tmx-xml-parser.ts:210
    _applyFile @ tiled-map.ts:367
    set @ tiled-map.ts:112
    (anonymous) @ DSceneBase.ts:335
    (anonymous) @ utilities.ts:328
    (anonymous) @ misc.ts:145
    setTimeout (async)
    callInNextTick @ misc.ts:144
    (anonymous) @ utilities.ts:326
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    (anonymous) @ load.ts:103
    cb @ utilities.ts:220
    onComplete @ load.ts:87
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    onComplete @ load.ts:261
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    (anonymous) @ load.ts:103
    cb @ utilities.ts:220
    onComplete @ load.ts:87
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    onComplete @ load.ts:261
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    (anonymous) @ load.ts:103
    cb @ utilities.ts:220
    onComplete @ load.ts:87
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    onComplete @ load.ts:261
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    (anonymous) @ load.ts:103
    cb @ utilities.ts:220
    onComplete @ load.ts:87
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    onComplete @ load.ts:261
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    (anonymous) @ load.ts:103
    cb @ utilities.ts:220
    onComplete @ load.ts:87
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    (anonymous) @ load.ts:143
    (anonymous) @ parser.ts:412
    parseImage @ parser.ts:170
    parse @ parser.ts:404
    parse @ load.ts:132
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    (anonymous) @ load.ts:121
    finale @ downloader.ts:409
    (anonymous) @ utilities.ts:80
    done @ downloader.ts:388
    loadCallback @ download-dom-image.ts:48
    load (async)
    downloadDomImage @ download-dom-image.ts:57
    downloadImage @ downloader.ts:58
    process @ downloader.ts:392
    retry @ utilities.ts:76
    download @ downloader.ts:413
    load @ pack-manager.ts:205
    fetch @ load.ts:119
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    (anonymous) @ load.ts:91
    forEach @ utilities.ts:225
    load @ load.ts:67
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    preprocess @ preprocess.ts:81
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    loadDepends @ load.ts:268
    (anonymous) @ load.ts:178
    (anonymous) @ parser.ts:412
    parseImport @ parser.ts:329
    parse @ parser.ts:404
    parse @ load.ts:173
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    (anonymous) @ load.ts:121
    finale @ downloader.ts:409
    (anonymous) @ utilities.ts:80
    done @ downloader.ts:388
    xhr.onload @ download-file.ts:57
    load (async)
    downloadFile @ download-file.ts:55
    downloadJson @ downloader.ts:68
    process @ downloader.ts:392
    retry @ utilities.ts:76
    download @ downloader.ts:413
    load @ pack-manager.ts:205
    fetch @ load.ts:119
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    (anonymous) @ load.ts:91
    forEach @ utilities.ts:225
    load @ load.ts:67
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    preprocess @ preprocess.ts:81
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    loadDepends @ load.ts:268
    (anonymous) @ load.ts:178
    (anonymous) @ parser.ts:412
    parseImport @ parser.ts:329
    parse @ parser.ts:404
    parse @ load.ts:173
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    (anonymous) @ load.ts:121
    finale @ downloader.ts:409
    (anonymous) @ utilities.ts:80
    done @ downloader.ts:388
    xhr.onload @ download-file.ts:57
    load (async)
    downloadFile @ download-file.ts:55
    downloadJson @ downloader.ts:68
    process @ downloader.ts:392
    retry @ utilities.ts:76
    download @ downloader.ts:413
    load @ pack-manager.ts:205
    fetch @ load.ts:119
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    (anonymous) @ load.ts:91
    forEach @ utilities.ts:225
    load @ load.ts:67
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    preprocess @ preprocess.ts:81
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    loadDepends @ load.ts:268
    (anonymous) @ load.ts:178
    (anonymous) @ parser.ts:412
    parseImport @ parser.ts:329
    parse @ parser.ts:404
    parse @ load.ts:173
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    (anonymous) @ load.ts:121
    finale @ downloader.ts:409
    (anonymous) @ utilities.ts:80
    done @ downloader.ts:388
    xhr.onload @ download-file.ts:57
    load (async)
    downloadFile @ download-file.ts:55
    downloadJson @ downloader.ts:68
    process @ downloader.ts:392
    retry @ utilities.ts:76
    download @ downloader.ts:413
    load @ pack-manager.ts:205
    fetch @ load.ts:119
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    (anonymous) @ load.ts:91
    forEach @ utilities.ts:225
    load @ load.ts:67
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    preprocess @ preprocess.ts:81
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    loadDepends @ load.ts:268
    (anonymous) @ load.ts:178
    (anonymous) @ parser.ts:412
    parseImport @ parser.ts:329
    parse @ parser.ts:404
    parse @ load.ts:173
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    (anonymous) @ load.ts:121
    finale @ downloader.ts:409
    (anonymous) @ utilities.ts:80
    done @ downloader.ts:388
    xhr.onload @ download-file.ts:57
    load (async)
    downloadFile @ download-file.ts:55
    downloadJson @ downloader.ts:68
    process @ downloader.ts:392
    retry @ utilities.ts:76
    download @ downloader.ts:413
    load @ pack-manager.ts:205
    fetch @ load.ts:119
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    (anonymous) @ load.ts:91
    forEach @ utilities.ts:225
    load @ load.ts:67
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    preprocess @ preprocess.ts:81
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    loadAny @ asset-manager.ts:457
    load @ bundle.ts:239
    initPlayerPosition @ DSceneBase.ts:331
    onHandle @ DSceneBase.ts:94
    onHandle @ DSceneNoviceVillage_control.ts:45
    update @ control.ts:415
    update @ DSceneBase.ts:89
    (anonymous) @ component-scheduler.ts:281
    (anonymous) @ component-scheduler.ts:233
    invoke @ component-scheduler.ts:195
    updatePhase @ component-scheduler.ts:480
    mainLoop @ director.ts:885
    _callback @ game.ts:706
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    Show 37 more frames
    vconsole.min.js:10 cc.TMXMapInfo.parseXMLFile(): Texture ‘…/WalkPoint.jpg’ not found.
    value @ vconsole.min.js:10
    value @ vconsole.min.js:10
    window.console. @ vconsole.min.js:10
    value @ vconsole.min.js:10
    value @ vconsole.min.js:10
    window.console. @ vconsole.min.js:10
    error @ debug.ts:99
    errorID @ debug.ts:275
    parseXMLString @ tmx-xml-parser.ts:671
    initWithXML @ tmx-xml-parser.ts:523
    TMXMapInfo @ tmx-xml-parser.ts:210
    _applyFile @ tiled-map.ts:367
    set @ tiled-map.ts:112
    (anonymous) @ DSceneBase.ts:335
    (anonymous) @ utilities.ts:328
    (anonymous) @ misc.ts:145
    setTimeout (async)
    callInNextTick @ misc.ts:144
    (anonymous) @ utilities.ts:326
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    (anonymous) @ load.ts:103
    cb @ utilities.ts:220
    onComplete @ load.ts:87
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    onComplete @ load.ts:261
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    (anonymous) @ load.ts:103
    cb @ utilities.ts:220
    onComplete @ load.ts:87
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    onComplete @ load.ts:261
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    (anonymous) @ load.ts:103
    cb @ utilities.ts:220
    onComplete @ load.ts:87
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    onComplete @ load.ts:261
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    (anonymous) @ load.ts:103
    cb @ utilities.ts:220
    onComplete @ load.ts:87
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    onComplete @ load.ts:261
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    (anonymous) @ load.ts:103
    cb @ utilities.ts:220
    onComplete @ load.ts:87
    dispatch @ task.ts:258
    (anonymous) @ pipeline.ts:275
    (anonymous) @ load.ts:143
    (anonymous) @ parser.ts:412
    parseImage @ parser.ts:170
    parse @ parser.ts:404
    parse @ load.ts:132
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    (anonymous) @ load.ts:121
    finale @ downloader.ts:409
    (anonymous) @ utilities.ts:80
    done @ downloader.ts:388
    loadCallback @ download-dom-image.ts:48
    load (async)
    downloadDomImage @ download-dom-image.ts:57
    downloadImage @ downloader.ts:58
    process @ downloader.ts:392
    retry @ utilities.ts:76
    download @ downloader.ts:413
    load @ pack-manager.ts:205
    fetch @ load.ts:119
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    (anonymous) @ load.ts:91
    forEach @ utilities.ts:225
    load @ load.ts:67
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    preprocess @ preprocess.ts:81
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    loadDepends @ load.ts:268
    (anonymous) @ load.ts:178
    (anonymous) @ parser.ts:412
    parseImport @ parser.ts:329
    parse @ parser.ts:404
    parse @ load.ts:173
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    (anonymous) @ load.ts:121
    finale @ downloader.ts:409
    (anonymous) @ utilities.ts:80
    done @ downloader.ts:388
    xhr.onload @ download-file.ts:57
    load (async)
    downloadFile @ download-file.ts:55
    downloadJson @ downloader.ts:68
    process @ downloader.ts:392
    retry @ utilities.ts:76
    download @ downloader.ts:413
    load @ pack-manager.ts:205
    fetch @ load.ts:119
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    (anonymous) @ load.ts:91
    forEach @ utilities.ts:225
    load @ load.ts:67
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    preprocess @ preprocess.ts:81
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    loadDepends @ load.ts:268
    (anonymous) @ load.ts:178
    (anonymous) @ parser.ts:412
    parseImport @ parser.ts:329
    parse @ parser.ts:404
    parse @ load.ts:173
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    (anonymous) @ load.ts:121
    finale @ downloader.ts:409
    (anonymous) @ utilities.ts:80
    done @ downloader.ts:388
    xhr.onload @ download-file.ts:57
    load (async)
    downloadFile @ download-file.ts:55
    downloadJson @ downloader.ts:68
    process @ downloader.ts:392
    retry @ utilities.ts:76
    download @ downloader.ts:413
    load @ pack-manager.ts:205
    fetch @ load.ts:119
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    (anonymous) @ load.ts:91
    forEach @ utilities.ts:225
    load @ load.ts:67
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    preprocess @ preprocess.ts:81
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    loadDepends @ load.ts:268
    (anonymous) @ load.ts:178
    (anonymous) @ parser.ts:412
    parseImport @ parser.ts:329
    parse @ parser.ts:404
    parse @ load.ts:173
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    (anonymous) @ load.ts:121
    finale @ downloader.ts:409
    (anonymous) @ utilities.ts:80
    done @ downloader.ts:388
    xhr.onload @ download-file.ts:57
    load (async)
    downloadFile @ download-file.ts:55
    downloadJson @ downloader.ts:68
    process @ downloader.ts:392
    retry @ utilities.ts:76
    download @ downloader.ts:413
    load @ pack-manager.ts:205
    fetch @ load.ts:119
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    (anonymous) @ load.ts:91
    forEach @ utilities.ts:225
    load @ load.ts:67
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    preprocess @ preprocess.ts:81
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    loadDepends @ load.ts:268
    (anonymous) @ load.ts:178
    (anonymous) @ parser.ts:412
    parseImport @ parser.ts:329
    parse @ parser.ts:404
    parse @ load.ts:173
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    (anonymous) @ load.ts:121
    finale @ downloader.ts:409
    (anonymous) @ utilities.ts:80
    done @ downloader.ts:388
    xhr.onload @ download-file.ts:57
    load (async)
    downloadFile @ download-file.ts:55
    downloadJson @ downloader.ts:68
    process @ downloader.ts:392
    retry @ utilities.ts:76
    download @ downloader.ts:413
    load @ pack-manager.ts:205
    fetch @ load.ts:119
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    (anonymous) @ load.ts:91
    forEach @ utilities.ts:225
    load @ load.ts:67
    _flow @ pipeline.ts:262
    (anonymous) @ pipeline.ts:272
    preprocess @ preprocess.ts:81
    _flow @ pipeline.ts:262
    async @ pipeline.ts:257
    loadAny @ asset-manager.ts:457
    load @ bundle.ts:239
    initPlayerPosition @ DSceneBase.ts:331
    onHandle @ DSceneBase.ts:94
    onHandle @ DSceneNoviceVillage_control.ts:45
    update @ control.ts:415
    update @ DSceneBase.ts:89
    (anonymous) @ component-scheduler.ts:281
    (anonymous) @ component-scheduler.ts:233
    invoke @ component-scheduler.ts:195
    updatePhase @ component-scheduler.ts:480
    mainLoop @ director.ts:885
    _callback @ game.ts:706
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    requestAnimationFrame (async)
    (anonymous) @ game.ts:662
    setTimeout (async)
    _stTimeWithRAF @ game.ts:661
    _callback @ game.ts:705
    Show 39 more frames
    vconsole.min.js:10 Please try asset type of …/WalkPoint.jpg to ‘sprite-frame’

  • 之前哪个版本是正常的:2.x都正常

  • 手机型号:

  • 手机浏览器: Chrome

  • 编辑器操作系统:

  • 重现概率:

{87AA3AED-E569-494B-A35C-BEE60BFE0CAC}
看报错的意思应该是和

  // 加载 sprite frame
  // v2.x
  resources.load('background', cc.SpriteFrame, () => {});
  // v3.0
  resources.load('background/spriteFrame', SpriteFrame, () => {});

这个API变动有关 哎
这肯定不是3.0的BUG 估计是tileMap这个软件太老了 跟不上cocos的步伐了 毕竟面向未来嘛
但是后面明明已经加了SpriteFrame参数类型了 真不知道这个/spriteFrame的意义何在

截图有点难 描述一下这个BUG
第一步


1:spriteFrameMap中的key是XXX.jpg
2:tileMap导出的str是…/XXX.jpg
3:第一步获取不到 使用getShortName方法 返回的是xxx
4:该方法看了一下 去头去尾 取最后一个斜杠到点的长度
5:…/xxx.jpg xxx.jpg xxx 三者完美错过
6:不知道是getShortName画蛇添足 还是spriteFrameMap太调皮 总之BUG还是很好改的

其实2.x很多坑都躺过一遍了 为什么升级3.0还要趟一遍

最后曲线救国
var tileAsset = res

            for(var k in tileAsset.spriteFrameNames){

                tileAsset.spriteFrameNames[k] = tileAsset.spriteFrameNames[k].split(".")[0]

            }

       
            this.mainLand.getComponent(TiledMap).tmxAsset = tileAsset

请问这个改的哪里?我在引擎里没有搜索到相关代码。我遇到类似问题,是否可以帮忙看一下呢?
https://forum.cocos.org/t/topic/108244

tileMap有个纹理集,改下纹理集的key就好了 ,

感谢反馈, 下个版本修复

虽然3.0 bug还很多,但是很感谢还有你们一群人在坚持。。

1赞