TMX file, load fail

Topics: Content Building and Deploying, Sprites and SpriteBatch
Mar 15, 2014 at 12:00 PM
Hello!

Since some days, i tried unsuccessful to load and display a tiled map with cocos2d xna.

I have tried, .tmx empty, with ressources, with ressources .xnb. also i never find how to convert the .tmx into .xnb (i see somebody speak about it here).

About the code i used the obsolete CCTMXTiledMap.Create

And after this i update my cocos2d dll to the last version, and now i just use the constructor like this :

CCTMXTiledMap map = new CCTMXTiledMap("MapTest.tmx");


But my game always crash at this line, the lastet error that i have see (with .xnb ressources) is :

System.ArgumentException
An element with the same key already exists in the dictionary.


It's different of the other times, so i hope it will be possible to load this.

Thanks in advance


See you
Coordinator
Mar 17, 2014 at 6:59 PM
An element with the same key already exists in the dictionary.
This is likely a plist dictionary error. You might have items in your map texture dictionary that have the same name. I recommend that you use unique names for your texture names to discourage unexpected errors like this.
Mar 18, 2014 at 9:49 AM
Thanks for your answer.
Because it wasn't my tmx (so i haven't .png) i tried to make the same with a tmx wihch i have the ressources files.
But my beautiful error is coming back : Null reference exeption...

There is somebody who can give me a simple .tmx which work on his cocos2d xna project?
mvannev@hotmail.fr Thanks in advance
Coordinator
Mar 18, 2014 at 4:04 PM
There are many tmx files available for you to look at. They are all in the test projects.
Mar 18, 2014 at 6:55 PM
Edited Mar 19, 2014 at 10:13 AM
I just what was "test project"...
I had not noticed that folder sorry..

And it's an amazing way to learn cocos2d xna ^^
Thanks a lot and sorry for that!


Edit :
I think i'm a little unlucky...
This morning i have runned the test project.
All worked fine, except the TiledMapTest..... i tried some differents map, but they never loaded.

[TEXT]([0:]
[0:] cocos2d : getActionByTag: Target not found

cocos2d : getActionByTag: Target not found
[0:]
[0:] cocos2d : removeActionByTag: Target not found

cocos2d : removeActionByTag: Target not found
[Mono] Unloading image mscorlib.dll [0x2106810].
[Mono] The request to load the assembly System v2.0.5.0 was remapped to v2.0.0.0
[Mono] Unloading image System.dll [0x21a6898].
[Mono] Image addref System[0x21abf70] -> System.dll[0x1b01988]: 6
[Mono] Assembly Ref addref System.Xml[0x1ecedf8] -> System[0x1b021c0]: 5
[Mono] GC_BRIDGE num-objects 20 num_hash_entries 21 sccs size 21 init 0.00ms df1 0.24ms sort 0.24ms dfs2 0.24ms setup-cb 0.00ms free-data 0.06ms user-cb 91.49ms clenanup 0.76ms links 1/1/1/1 dfs passes 42/22
[Mono] GC_MAJOR: (LOS overflow) pause 52.92ms, total 53.16ms, bridge 95.46ms major 1248K/288K los 8375K/18195K
[0:]
cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from [51] to [69].
[0:] cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from [51] to [69].

[Mono] GC_BRIDGE num-objects 17 num_hash_entries 17 sccs size 17 init 0.00ms df1 0.24ms sort 0.03ms dfs2 0.31ms setup-cb 0.00ms free-data 0.06ms user-cb 32.07ms clenanup 0.27ms links 1/1/1/1 dfs passes 76/39
[Mono] GC_MAJOR: (user request) pause 13.95ms, total 14.37ms, bridge 32.87ms major 1104K/1264K los 8375K/12471K
[Mono] Unloading image mscorlib.dll [0x1f448a0].
[Mono] Unloading image mscorlib.dll [0x1f448a0].)


Somebody have an idea of that meaning of this log? Sorry for that.