-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A error when load a json tilemap #388
Comments
share the map and the code you used |
my code to import: map = new FlxOgmo3Loader(Paths.levelProject__ogmo, jsonPaths); |
or the .zip file: |
can you share the tilemap 1 png and the ogmo file? |
here: |
this works for me, I see some issues but not the one you're experiencing. This error typically happens when there's an error finding the tiles graphic, I see you're using Paths, so it seems unlikely but lets double check. try commenting out the following lines walls.setTileProperties(1, NONE);
walls.setTileProperties(2, ANY); and add the following line: var bmd = flixel.system.FlxAssets.getBitmapData(Paths.tilemap_1__png);
if (bmd == null)
throw "missing asset: " + Paths.tilemap_1__png;
else
trace('asset found, width:${bmd.width} height:${bmd.height}'); // should be 48x64 make sure you compile in debug mode |
This give me a log: source/lev/PlayState.hx:116: load: assets/data/lev/freeplay/lev1.json and crash again |
Its really hard to diagnose bugs by proxy. Can you put your project on a public github repo and link it here? |
your map = new FlxOgmo3Loader(Paths.levelProject__ogmo, jsonPaths); with map = new FlxOgmo3Loader(Paths.levelProject__ogmo, "assets/data/lev/freeplay/lev1.json"); It doesn't fail on the that line but it then errors on setTileProperties, but not for "walls", but for "fruitShop". this makes sense because shop.png only has one frame, or a frame index of 0. also flixel takes all tiles -1 and makes them tile 0, your tile 0 in tilemap_1.png is a grass tile, I recommend adding an empty frame as the "empty" 0 frame. also why are you calling the following on every tilemap? stone.setTileProperties(1, NONE);
stone.setTileProperties(2, ANY); this doesn't really fit your tiles |
I tried to load a json tilemap using json file, after build game, the game got crash and give me:
i tried to rebuild game, fixing stuff but still give me the same dialogue box
im using Ogmo Editior 3 to make tilemap!
The text was updated successfully, but these errors were encountered: