Slick Forums

Discuss the Slick 2D Library
It is currently Mon Jun 18, 2018 7:46 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri May 30, 2014 6:06 am 
Offline

Joined: Fri May 30, 2014 6:01 am
Posts: 1
I am making a game in slick using a tiled map and when I try to add an object layer, the code passes the following error when i try to create a new map from the file:
Code:
Thu May 29 23:03:50 PDT 2014 ERROR:For input string: ""
java.lang.NumberFormatException: For input string: ""
   at java.lang.NumberFormatException.forInputString(Unknown Source)
   at java.lang.Integer.parseInt(Unknown Source)
   at java.lang.Integer.parseInt(Unknown Source)
   at org.newdawn.slick.tiled.TiledMap$GroupObject.<init>(TiledMap.java:1079)
   at org.newdawn.slick.tiled.TiledMap$ObjectGroup.<init>(TiledMap.java:1033)
   at org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:688)
   at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:106)
   at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:90)
   at mario.World.init(World.java:46)
   at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:393)
   at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:317)
   at mario.World.main(World.java:37)
Thu May 29 23:03:50 PDT 2014 ERROR:Failed to parse tilemap
org.newdawn.slick.SlickException: Failed to parse tilemap
   at org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:695)
   at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:106)
   at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:90)
   at mario.World.init(World.java:46)
   at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:393)
   at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:317)
   at mario.World.main(World.java:37)
Caused by: java.lang.NumberFormatException: For input string: ""
   at java.lang.NumberFormatException.forInputString(Unknown Source)
   at java.lang.Integer.parseInt(Unknown Source)
   at java.lang.Integer.parseInt(Unknown Source)
   at org.newdawn.slick.tiled.TiledMap$GroupObject.<init>(TiledMap.java:1079)
   at org.newdawn.slick.tiled.TiledMap$ObjectGroup.<init>(TiledMap.java:1033)
   at org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:688)
   ... 6 more


This is my map:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="223" height="15" tilewidth="16" tileheight="16">
 <tileset firstgid="1" name="Set" tilewidth="16" tileheight="16">
  <image source="tileSet.png" width="528" height="448"/>
  <tile id="0">
   <properties>
    <property name="blockType" value="rock"/>
    <property name="rockType" value="0"/>
   </properties>
  </tile>
  <tile id="1">
   <properties>
    <property name="blockType" value="brick"/>
   </properties>
  </tile>
  <tile id="2">
   <properties>
    <property name="blockType" value="brick"/>
   </properties>
  </tile>
  <tile id="24">
   <properties>
    <property name="blockType" value="qBlock"/>
   </properties>
  </tile>
  <tile id="33">
   <properties>
    <property name="blockType" value="rock"/>
    <property name="rockType" value="1"/>
   </properties>
  </tile>
  <tile id="264">
   <properties>
    <property name="blockType" value="pipe"/>
    <property name="pipeType" value="pipeTopL"/>
   </properties>
  </tile>
  <tile id="265">
   <properties>
    <property name="blockType" value="pipe"/>
    <property name="pipeType" value="pipeTopR"/>
   </properties>
  </tile>
  <tile id="297">
   <properties>
    <property name="blockType" value="pipe"/>
    <property name="pipeType" value="pipeSecL"/>
   </properties>
  </tile>
  <tile id="298">
   <properties>
    <property name="blockType" value="pipe"/>
    <property name="pipeType" value="pipeSecR"/>
   </properties>
  </tile>
 </tileset>
 <layer name="Tile Layer 1" width="223" height="15">
  <data encoding="base64" compression="gzip">
   H4sIAAAAAAAAC+2X0QqDMAxFq2/bH/jax+3//297UJCaNtlsslHPgaDQGiTegzQlAAAAAAAAAAD4d5Zfv0AQs1K1vZHzqb3PtrasJa2PRF4LAOLICfcAoskJ9wCiKb0byb3y3DLvrp5niNuU0n1yaq4wF1eP3iWL4d7Sp7a3tT9X7jXKrH+T+/35+NN5S96N5J4XmluP99rT4J51H8hI/ljyK2U9Mvs1767snvV/pTmDe/60/GlluJZ1z/zvc9Xy7sru9XIG93yx+CPluJV17dkz32p7VvPO6l6EoxN1qB6zYcZ950ldozZ69DjbZ4RiDnK9ALJkTYpENAAA
  </data>
 </layer>
 <objectgroup name="objs" width="223" height="15">
  <object name="qb" type="block" gid="25" x="336" y="160" width="256" height="256">
   <properties>
    <property name="itemType" value="1"/>
    <property name="objType" value="qBlock"/>
   </properties>
  </object>
  <object name="pt" type="block" gid="331" x="896" y="160" width="256" height="256">
   <properties>
    <property name="objType" value="pipeTop"/>
    <property name="pipeType" value="pipeTopL"/>
    <property name="warpNum" value="0"/>
   </properties>
  </object>
  <object name="pt" type="block" gid="332" x="912" y="160" width="256" height="256">
   <properties>
    <property name="objType" value="warpPipe"/>
    <property name="pipeType" value="pipeTopR"/>
    <property name="warpNum" value="0"/>
   </properties>
  </object>
  <object name="qb" type="block" gid="25" x="1024" y="144">
   <properties>
    <property name="itemType" value="4"/>
    <property name="objType" value="qBlock"/>
   </properties>
  </object>
  <object name="qb" type="block" gid="25" x="1616" y="160" width="256" height="256">
   <properties>
    <property name="itemType" value="3"/>
    <property name="objType" value="qBlock"/>
   </properties>
  </object>
  <object name="qb" type="block" gid="25" x="1744" y="96" width="256" height="256">
   <properties>
    <property name="itemType" value="2"/>
    <property name="objType" value="qBlock"/>
   </properties>
  </object>
  <object name="qb" type="block" gid="25" x="1248" y="160">
   <properties>
    <property name="itemType" value="2"/>
    <property name="objType" value="qBlock"/>
   </properties>
  </object>
  <object name="10c" type="block" gid="2" x="1504" y="160">
   <properties>
    <property name="itemType" value="2"/>
    <property name="objType" value="brick"/>
   </properties>
  </object>
  <object name="pt" type="block" gid="265" x="2608" y="192">
   <properties>
    <property name="objType" value="pipeTop"/>
    <property name="pipeType" value="pipeTopL"/>
    <property name="warpNum" value="3"/>
   </properties>
  </object>
  <object name="pt" type="block" gid="266" x="2624" y="192">
   <properties>
    <property name="objType" value="pipeTop"/>
    <property name="pipeType" value="pipeTopR"/>
    <property name="warpNum" value="3"/>
   </properties>
  </object>
 </objectgroup>
</map>


All objects have width and height > 0, and when I delete the object layer the map works fine.

Any and all help is appreciated, as this is a final project for my AP comp sci class.

Thanks!


Top
 Profile  
 
PostPosted: Sat Jun 14, 2014 4:26 pm 
Offline

Joined: Mon Jun 18, 2012 1:58 pm
Posts: 12
I'm having this same exact problem. It only started happening when I updated Tiled to the newest version. Any ideas on why this is happening?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group