1 (edited by catpaw 2008-08-07 11:54:12)

Topic: [TOOL] map2xml converter

Okay, I'm gonna release that tool I wrote for my convenience. I wanted to improve it a bit more, but now releasized I currently don't have the time or leisure so I'll release what I have.

What does it do? It can convert a map file to a xml file containing all data and vice versa

What is it good for? You can edit the value of quads and envelopes by hand in a texteditor allowing you to make quads and animation with an yet unpreceded precission in teeworlds, see for example the sunrays template or as experiment I did a background animation by showing one out of a series of quads only 100ms each, so it results in an animation.

This is a tool for experts. You can dilberatly shoot in your feets with it, it wont stop you, nor does the teeworlds client or server do any real checks to make you stop from loading really broken maps. If you don't know what you do, you could accidently create maps that make the client just crash (like forgetting a games group) or behave ultimately akward (like having the gamesgroups with a parralax/y of not 100) Therefore I will also not provide any binaries with this release, if you cant compile it yourself, you are not ready for it smile

The embedded images are encoded as base64 into the xml file, so I decided also to do with tiles layers tiledata, so the xml file won't do you any good for editing tiledata. Its primary intended for quads and envelopes.

Source Download:
http://teecode.googlecode.com/files/xml … src.tar.gz

An Usage example:

./map2xml data/maps/[MAPNAME].map [MAPNAME].xml
vim [MAPNAme].xml     (or use any editor of your choice)
./xml2map [MAPNAME].xml data/maps/[MAPNAME]2.map

To give you an impression thats what ctf2 looks like as xml.

<?xml version="1.0" encoding="ISO-8859-1"?>
<teemap version="1" map-version="1">
 <envelopes>
  <envelope id="0" version="1" channels="4">
   <envpoint time="0" curvetype="smooth" v0="1026" v1="1026" v2="1027" v3="1026"/>
   <envpoint time="1016" curvetype="smooth" v0="1026" v1="1026" v2="1027" v3="611"/>
   <envpoint time="2000" curvetype="linear" v0="1027" v1="1027" v2="1025" v3="1092"/>
  </envelope>
 </envelopes>
 <images>
  <image name="winter_main" version="1" external="1" width="1024" height="1024"/>
  <image name="winter_doodads" version="1" external="1" width="1024" height="1024"/>
  <image name="moon" version="1" external="1" width="512" height="512"/>
  <image name="stars" version="1" external="1" width="128" height="64"/>
 </images>
 <groups>
  <group version="2" parallax_x="0" parallax_y="0" offset_x="0" offset_y="0" use_clipping="0" clip_x="0" clip_y="0" clip_w="0" clip_h="0">
   <layer type="quads" version="1" layer-flags="0">
    <quad pos-env="-1" pos-env-offset="0" color-env="-1" color-env-offset="0">
     <points>
      <point x="-787797" y="-557772"/>
      <point x="819646" y="-557772"/>
      <point x="-787797" y="565161"/>
      <point x="819646" y="565161"/>
      <point x="117046" y="-230103"/>
     </points>
     <colors>
      <color r="1" g="47" b="77" a="255"/>
      <color r="1" g="47" b="77" a="255"/>
      <color r="0" g="13" b="27" a="255"/>
      <color r="0" g="13" b="27" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="1024" y="0"/>
      <point x="0" y="1024"/>
      <point x="1024" y="1024"/>
     </texcoords>
    </quad>
   </layer>
  </group>
  <group version="2" parallax_x="20" parallax_y="20" offset_x="0" offset_y="0" use_clipping="0" clip_x="0" clip_y="0" clip_w="0" clip_h="0">
   <layer type="quads" version="1" layer-flags="1" image="stars">
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="262">
     <points>
      <point x="120706" y="-226118"/>
      <point x="186242" y="-226118"/>
      <point x="120706" y="-160582"/>
      <point x="186242" y="-160582"/>
      <point x="153474" y="-193350"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="482" y="-5"/>
      <point x="0" y="1024"/>
      <point x="482" y="1019"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="0">
     <points>
      <point x="274902" y="-46643"/>
      <point x="340438" y="-46643"/>
      <point x="274902" y="18893"/>
      <point x="340438" y="18893"/>
      <point x="307670" y="-13875"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="535" y="16"/>
      <point x="1017" y="11"/>
      <point x="535" y="1040"/>
      <point x="1017" y="1035"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="0">
     <points>
      <point x="-578396" y="-387322"/>
      <point x="-512860" y="-387322"/>
      <point x="-578396" y="-321786"/>
      <point x="-512860" y="-321786"/>
      <point x="-545628" y="-354554"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="482" y="-5"/>
      <point x="0" y="1024"/>
      <point x="482" y="1019"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="0">
     <points>
      <point x="1133514" y="587008"/>
      <point x="1199050" y="587008"/>
      <point x="1133514" y="652544"/>
      <point x="1199050" y="652544"/>
      <point x="1166282" y="619776"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="482" y="-5"/>
      <point x="0" y="1024"/>
      <point x="482" y="1019"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="736">
     <points>
      <point x="283280" y="545087"/>
      <point x="317131" y="601203"/>
      <point x="227164" y="578938"/>
      <point x="261015" y="635054"/>
      <point x="272148" y="590071"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="482" y="-5"/>
      <point x="0" y="1024"/>
      <point x="482" y="1019"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="837">
     <points>
      <point x="964151" y="-96560"/>
      <point x="937716" y="-36592"/>
      <point x="904184" y="-122995"/>
      <point x="877748" y="-63028"/>
      <point x="920950" y="-79794"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="482" y="-5"/>
      <point x="0" y="1024"/>
      <point x="482" y="1019"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="1190">
     <points>
      <point x="643828" y="34892"/>
      <point x="709364" y="34892"/>
      <point x="643828" y="100428"/>
      <point x="709364" y="100428"/>
      <point x="676596" y="67660"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="482" y="-5"/>
      <point x="0" y="1024"/>
      <point x="482" y="1019"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="0">
     <points>
      <point x="919781" y="286173"/>
      <point x="980495" y="310846"/>
      <point x="895108" y="346887"/>
      <point x="955822" y="371560"/>
      <point x="937802" y="328867"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="482" y="-5"/>
      <point x="0" y="1024"/>
      <point x="482" y="1019"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="0">
     <points>
      <point x="8760" y="331388"/>
      <point x="59305" y="289672"/>
      <point x="50476" y="381933"/>
      <point x="101021" y="340217"/>
      <point x="54891" y="335803"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="535" y="16"/>
      <point x="1017" y="11"/>
      <point x="535" y="1040"/>
      <point x="1017" y="1035"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="0">
     <points>
      <point x="-420241" y="412573"/>
      <point x="-354705" y="412573"/>
      <point x="-420241" y="478109"/>
      <point x="-354705" y="478109"/>
      <point x="-387473" y="445341"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="535" y="16"/>
      <point x="1017" y="11"/>
      <point x="535" y="1040"/>
      <point x="1017" y="1035"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="176">
     <points>
      <point x="632172" y="349626"/>
      <point x="681442" y="306413"/>
      <point x="675385" y="398896"/>
      <point x="724655" y="355683"/>
      <point x="678414" y="352655"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="535" y="16"/>
      <point x="1017" y="11"/>
      <point x="535" y="1040"/>
      <point x="1017" y="1035"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="166">
     <points>
      <point x="998633" y="119115"/>
      <point x="1046763" y="74636"/>
      <point x="1043112" y="167246"/>
      <point x="1091243" y="122766"/>
      <point x="1044938" y="120941"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="535" y="16"/>
      <point x="1017" y="11"/>
      <point x="535" y="1040"/>
      <point x="1017" y="1035"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="690">
     <points>
      <point x="-110297" y="-36728"/>
      <point x="-44761" y="-36728"/>
      <point x="-110297" y="28808"/>
      <point x="-44761" y="28808"/>
      <point x="-77529" y="-3960"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="482" y="-5"/>
      <point x="0" y="1024"/>
      <point x="482" y="1019"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="173">
     <points>
      <point x="-400994" y="-137840"/>
      <point x="-335458" y="-137840"/>
      <point x="-400994" y="-72304"/>
      <point x="-335458" y="-72304"/>
      <point x="-368226" y="-105072"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="482" y="-5"/>
      <point x="0" y="1024"/>
      <point x="482" y="1019"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="553">
     <points>
      <point x="-529042" y="113274"/>
      <point x="-463506" y="113274"/>
      <point x="-529042" y="178810"/>
      <point x="-463506" y="178810"/>
      <point x="-496274" y="146042"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="482" y="-5"/>
      <point x="0" y="1024"/>
      <point x="482" y="1019"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="424">
     <points>
      <point x="-240900" y="582581"/>
      <point x="-175364" y="582581"/>
      <point x="-240900" y="648117"/>
      <point x="-175364" y="648117"/>
      <point x="-208132" y="615349"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="482" y="-5"/>
      <point x="0" y="1024"/>
      <point x="482" y="1019"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="-262">
     <points>
      <point x="397079" y="-362618"/>
      <point x="462615" y="-362618"/>
      <point x="397079" y="-297082"/>
      <point x="462615" y="-297082"/>
      <point x="429847" y="-329850"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="535" y="16"/>
      <point x="1017" y="11"/>
      <point x="535" y="1040"/>
      <point x="1017" y="1035"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="1166">
     <points>
      <point x="1109075" y="-286784"/>
      <point x="1174611" y="-286784"/>
      <point x="1109075" y="-221248"/>
      <point x="1174611" y="-221248"/>
      <point x="1141843" y="-254016"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="535" y="16"/>
      <point x="1017" y="11"/>
      <point x="535" y="1040"/>
      <point x="1017" y="1035"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="1272">
     <points>
      <point x="376348" y="192888"/>
      <point x="416880" y="244387"/>
      <point x="324849" y="233420"/>
      <point x="365381" y="284919"/>
      <point x="370865" y="238904"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="535" y="16"/>
      <point x="1017" y="11"/>
      <point x="535" y="1040"/>
      <point x="1017" y="1035"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="0">
     <points>
      <point x="76891" y="109237"/>
      <point x="142427" y="109237"/>
      <point x="76891" y="174773"/>
      <point x="142427" y="174773"/>
      <point x="109659" y="142005"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="535" y="16"/>
      <point x="1017" y="11"/>
      <point x="535" y="1040"/>
      <point x="1017" y="1035"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="0">
     <points>
      <point x="691984" y="677141"/>
      <point x="757520" y="677141"/>
      <point x="691984" y="742677"/>
      <point x="757520" y="742677"/>
      <point x="724752" y="709909"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="535" y="16"/>
      <point x="1017" y="11"/>
      <point x="535" y="1040"/>
      <point x="1017" y="1035"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="0">
     <points>
      <point x="1406505" y="257541"/>
      <point x="1472041" y="257541"/>
      <point x="1406505" y="323077"/>
      <point x="1472041" y="323077"/>
      <point x="1439273" y="290309"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="535" y="16"/>
      <point x="1017" y="11"/>
      <point x="535" y="1040"/>
      <point x="1017" y="1035"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="0">
     <points>
      <point x="1752269" y="70468"/>
      <point x="1812983" y="95141"/>
      <point x="1727596" y="131182"/>
      <point x="1788310" y="155855"/>
      <point x="1770290" y="113162"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="482" y="-5"/>
      <point x="0" y="1024"/>
      <point x="482" y="1019"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="0">
     <points>
      <point x="1557863" y="-141096"/>
      <point x="1618577" y="-116423"/>
      <point x="1533190" y="-80382"/>
      <point x="1593904" y="-55709"/>
      <point x="1575884" y="-98402"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="482" y="-5"/>
      <point x="0" y="1024"/>
      <point x="482" y="1019"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="0" color-env-offset="0">
     <points>
      <point x="1660372" y="663708"/>
      <point x="1711577" y="622806"/>
      <point x="1701274" y="714913"/>
      <point x="1752479" y="674011"/>
      <point x="1706426" y="668860"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="482" y="-5"/>
      <point x="0" y="1024"/>
      <point x="482" y="1019"/>
     </texcoords>
    </quad>
   </layer>
  </group>
  <group version="2" parallax_x="40" parallax_y="40" offset_x="0" offset_y="0" use_clipping="0" clip_x="0" clip_y="0" clip_w="0" clip_h="0">
   <layer type="quads" version="1" layer-flags="1" image="moon">
    <quad pos-env="-1" pos-env-offset="0" color-env="-1" color-env-offset="0">
     <points>
      <point x="2348335" y="-185791"/>
      <point x="2956472" y="-185791"/>
      <point x="2348335" y="432443"/>
      <point x="2956472" y="432443"/>
      <point x="2822604" y="7052"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="1024" y="0"/>
      <point x="0" y="1024"/>
      <point x="1024" y="1024"/>
     </texcoords>
    </quad>
    <quad pos-env="-1" pos-env-offset="0" color-env="-1" color-env-offset="0">
     <points>
      <point x="-186957" y="-207688"/>
      <point x="453185" y="-207688"/>
      <point x="-186957" y="437506"/>
      <point x="453185" y="437506"/>
      <point x="10941" y="-50230"/>
     </points>
     <colors>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
      <color r="255" g="255" b="255" a="255"/>
     </colors>
     <texcoords>
      <point x="0" y="0"/>
      <point x="1024" y="0"/>
      <point x="0" y="1024"/>
      <point x="1024" y="1024"/>
     </texcoords>
    </quad>
   </layer>
  </group>
  <group version="2" parallax_x="100" parallax_y="100" offset_x="0" offset_y="0" use_clipping="0" clip_x="0" clip_y="0" clip_w="0" clip_h="0">
   <layer type="tiles" version="2" flags="0" layer-flags="1" width="220" height="90" image="winter_main" tiledata-id="0"/>
   <layer type="tiles" version="2" flags="0" layer-flags="1" width="220" height="90" image="winter_doodads" tiledata-id="1"/>
   <layer type="tiles" version="2" flags="0" layer-flags="1" width="220" height="90" image="winter_doodads" tiledata-id="2"/>
   <layer type="tiles" version="2" flags="1" layer-flags="0" width="220" height="90" tiledata-id="3"/>
   <layer type="tiles" version="2" flags="0" layer-flags="0" width="220" height="90" image="winter_main" tiledata-id="4"/>
   <layer type="tiles" version="2" flags="0" layer-flags="1" width="220" height="90" image="winter_main" tiledata-id="5"/>
  </group>
 </groups>
 <!--**************************************************************************************************
Attention: From here now follows encoded binary data!

It will likely not do you any good to even look at it or to worry with it or save you god if you even to try to alter it.
****************************************************************************************************-->
 <tiledata>
  <layer id="0" width="220" height="90"><![CDATA[
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
--- okay I deleted a lot of stuff here, this goes on like this a while ---
]]></layer>
 </tiledata>
</teemap>

TODOs :
* allow resizing of layers
* make more flexible id matching between envelopes and quads, layers and tiledata, images and imagedata

BTW: funny enough a gzipped map as xml file will not be that much larger than the binary map file by itself (aprox +50%)

2

Re: [TOOL] map2xml converter

not bad!
can it also be used as some kind of map-viewer?

3

Re: [TOOL] map2xml converter

Very impressive work. May be useful for the devs, too.

"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." - Terry Pratchett -

4

Re: [TOOL] map2xml converter

hrhr, i'm sure I am ready for it, but I am not in the compiling materia. So I'm gonna wait until I'll find some time.

Antoine de Saint Exupéry: It seems that perfection is reached not when there is nothing left to add, but when there is nothing left to take away.
Besides -  I am the gfx guy!

5

Re: [TOOL] map2xml converter

Does someone has  map2xml project with external libs under win32 ?
Thx!

6

Re: [TOOL] map2xml converter

I can't use the default.bam.patch is it for Windows? sad

Try to make a Windows patch please.

7

Re: [TOOL] map2xml converter

KillaBilla wrote:

I can't use the default.bam.patch is it for Windows? sad

Try to make a Windows patch please.

If I am not wrong, it is not created for compiling.
It is individual tool?!

Goodbye all. Account inactive since March 2011.

8

Re: [TOOL] map2xml converter

Great tool and still working with new TeeWorlds maps !
Since I use it, I decided to maintain it and to publish a new version :

Added
  • compiling with TeeWorlds 0.5.2

  • tile layers are now translated in xml too (and not in base64 as before)

Example of tile layers with dm1 :

 <tiledata>
  <layer id="0" width="60" height="50">
   <tile x="1" y="32" index="13" flags="4"/>
   <tile x="1" y="33" index="13" flags="4"/>
   <tile x="1" y="34" index="13" flags="4"/>
   <tile x="1" y="35" index="13" flags="4"/>
   <tile x="1" y="36" index="13" flags="4"/>
   <tile x="2" y="32" index="13" flags="4"/>
   <tile x="2" y="33" index="13" flags="4"/>
   <tile x="2" y="34" index="13" flags="4"/>
   <tile x="2" y="35" index="13" flags="4"/>
   ...
  </layer>
 </tiledata>
Download

/* The first post should be updated with the new links */

9

Re: [TOOL] map2xml converter

I am a map-editor, but i cannot compile yet. (But I have BAM and Python big_smile)
I think this would be a usefull tool for me. big_smile
So: How do ya compile?
And for my maps: i couldn't find any nice tutorial (on youtube and google and this forum) where the people explain how to create those nice quads.
Thanx for the help big_smile

10

Re: [TOOL] map2xml converter

I think this would be a usefull tool for me

Yes, I hope it will help pro mappers like you.

So: How do ya compile?

It is only designed to be compiled under Linux-like systems. What do you use ?
Else, I think the easiest way for you would be to install Linux since I provide binaries for it.

11 (edited by R&B-guy 2009-12-22 17:34:45)

Re: [TOOL] map2xml converter

clarus wrote:

I think this would be a usefull tool for me

Yes, I hope it will help pro mappers like you.

So: How do ya compile?

It is only designed to be compiled under Linux-like systems. What do you use ?
Else, I think the easiest way for you would be to install Linux since I provide binaries for it.

I use Windows (Xp, Vista ( and 7 in the nearby future)
But I am going to install ubuntu or some kind of linux on my thumb-drive big_smile

Edit: I am not a pro-mapper cuz i can't create quads and such things.
I even have several questions: 1) How do ya create tile sets
2) Is it possible to make a mod that combines [N]Race, instagib and other mods to one mod-package so you can play them all on one map

12 (edited by Slinack 2009-12-24 01:52:13)

Re: [TOOL] map2xml converter

Yesterday I was trying to compile this tool to windows and kept failing until Rajh helped me. He modified the sources so they could be compiled under windows and released the binaries.

Download (source + win32 binaries)

You may need the following DLLs (to run the binaries): libxml2.dll, iconv.dll and zlib1.dll.

Thanks Rajh! big_smile

check out these maps: infiltrate - choco - dustycloud

13 (edited by ayu 2010-07-11 16:22:22)

Re: [TOOL] map2xml converter

I know some time passed, between the last post on this thread and this one, but I'd be happy if someone could offer me some help.
My problem is, that the map2xml works great but the xml2map doesn't do it's job properly. Everytime I try to convert an xml file to a map file, I get an error message: "Cannot create output map-file".
I already took a look at the source code, provided by Slinack (with credits going to Rajh), but it didn't help me either.
The critical part is

char current_dir[1024];
    _getcwd(current_dir, sizeof(current_dir));
    char output_filename[1024];
    str_format(output_filename, sizeof(output_filename), "%s/%s", current_dir, argv[2]);
    DATAFILE_OUT *df = datafile_create(output_filename);
    if(!df) {
        printf("Cannot create output map-file '%s'\n", argv[2]);
        return -1;
    }

(at least I think it is...)

Since I'm not so into C and C++, I can't really understand what actually is the problem.
I already ran it as an administrator and with compability mode (Windows XP) but still... no outcome.
Is there anything I did wrong? And by the way, I'm using Windows 7 64-bit.

I hope, you people can help me, and please don't write anything like "get yourself Linux", or "this is only for pr00000000000000sssss!!!!1111oneoneeleven²"

14

Re: [TOOL] map2xml converter

i've the same problem, can anyone please fix that?
greets,
syrws