Soldat 2 - map2svg2map

map in inkscape / illustrator & convert to soldat map
source code (AGPL-3.0-or-later) (if you find bugs, fix them. or let me know (@norwin#89xx))

what it does

  • convert any SVG shapes to polygons
  • generate a ready to use map file
  • provide JSON of the generated polygons, to copypaste into an existing map
  • apply fill color and attributes from SVG to individual shapes.
    use the following attributes to override the parameters specified in this tool:
    details
    • data-s2-collisionmodel:
      'solid', 'none', 'platform', 'bullets collide', 'players collide',
      'climbable', 'items collide', 'area', 'deadly'
    • data-s2-renderinglayer:
      'foreground', 'background', 'original', 'color', 'none'
    • data-s2-material:
      'rock', 'metal', 'sand', 'wood'
    • data-s2-mirror:
      'true', 'false'
    • data-s2-depth:
      number
    you can set these attributes in inkscape via the xml-editor (ctrl+shift+x).
    attributes are inherited from groups + layers, no need to add them to each shape

what it does not

  • handle nested <svg> elements
  • automatically scale the resulting map to usable dimensions
    • 1 'mapsize' unit (using default scaling=2.0) corresponds to 14 SVG units
    • use the scale parameter here or later in the map editor to adjust
    • a midsized CTF map would have SVG dimensions of around 200 x 60
  • feed your cat
  • send your data anywhere

map2svg

note: this only converts protoshapes. you can use the tool below
to merge your edited SVG back with the original map .json

svg2map