Hello Guest

Author Topic: Importing huge .tmx throws error  (Read 4591 times)

bitsofbas

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 13
    • View Profile
    • bitsofbas
Importing huge .tmx throws error
« on: February 09, 2014, 01:08:28 pm »
Hi,

I'd like to import a big .tmx map ( 3 layers, 4 high, 2000 wide ) but it's throwing an error.
The same map, with a drastically reduced width, works ok.

Is there a solution to get it to work with larger maps?

Cheers,
bas


Code: [Select]
IndexOutOfRangeException: Array index is out of range.
tk2dRuntime.TileMap.Layer.FindChunkAndCoordinate (Int32 x, Int32 y, System.Int32& offset) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapChunks.cs:372)
tk2dRuntime.TileMap.Layer.GetRawTileValue (Int32 x, Int32 y, System.Int32& value) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapChunks.cs:384)
tk2dRuntime.TileMap.Layer.GetTileFlags (Int32 x, Int32 y) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapChunks.cs:428)
tk2dRuntime.TileMap.Layer.SetTile (Int32 x, Int32 y, Int32 tile) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapChunks.cs:450)
tk2dEditor.TileMap.Importer.PopulateTilemap (.tk2dTileMap tileMap) (at Assets/TK2DROOT/tk2dTileMap/Editor/Importer/tk2dTileMapImporter.cs:179)
tk2dEditor.TileMap.Importer.Import (.tk2dTileMap tileMap, Format format) (at Assets/TK2DROOT/tk2dTileMap/Editor/Importer/tk2dTileMapImporter.cs:242)
tk2dTileMapEditor.DrawSettingsPanel () (at Assets/TK2DROOT/tk2dTileMap/Editor/tk2dTileMapEditor.cs:818)
tk2dTileMapEditor.OnInspectorGUI () (at Assets/TK2DROOT/tk2dTileMap/Editor/tk2dTileMapEditor.cs:1218)
UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty) (at C:/BuildAgent/work/d3d49558e4d408f4/Editor/Mono/Inspector/InspectorWindow.cs:850)
UnityEditor.DockArea:OnGUI()

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Importing huge .tmx throws error
« Reply #1 on: February 09, 2014, 10:00:26 pm »
tk2dTileMapUtility.cs
MaxWidth and MaxHeight are defines as 1024, increase it to what you need it to be. Subsequent reimports will use this maximum size.

bitsofbas

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 13
    • View Profile
    • bitsofbas
Re: Importing huge .tmx throws error
« Reply #2 on: February 10, 2014, 05:52:44 pm »
Like a charm! Thanks!