Author Topic: Accessing Map Tiles in MapView  (Read 3142 times)

Offline Blazen

  • Sergeant
  • **
  • Posts: 36
    • View Profile
Accessing Map Tiles in MapView
« on: February 15, 2021, 12:18:49 am »
I've downloaded 'MapView' and it seems to work fine, I can edit the maps that it has. It only has however the default vanilla maps and I can't work out how to get it to see any others.
Specifically I've got the Piratez mod installed, which has a bunch of none vanilla maps but I can't get 'MapView' to see them. I've tried directing the resource path to the Piratez UFO folder but that didn't seem to help, however it did do something as it then complained it didn't have the cursor.pck/.tab. But after adding those it still wouldn't see the maps.
Any help would be appreciated.

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: Accessing Map Tiles in MapView
« Reply #1 on: February 15, 2021, 12:54:23 am »
i think you'll have to use RulesetConverter.exe

browse though its RulesetConverter.txt and stuff and i can give a hand if req'd.
https://github.com/kevL/OpenXCOM.Tools/blob/master/RulesetConverter/RulesetConverter.txt


note: I successfully used the RulesetConverter on Piratez and loaded its maps several months ago ...



edit

that's complicated so i'll try to rephrase it. Hunt around in your Piratez directories for the ruleset (.RUL) that contains its terrains. There may be more than one. but may be not.

Leave MapView's Configuration as is -- that is, configured to open Maps in your standard Xcom installation dir. (or wherever if you'd prefer to edit files in a /scratch directory, instead of making backups)

Once you've found a Piratez ruleset that contains terrains, run RulesetConverter.exe

browse to the ruleset
choose GameType UFO
click add Basepath
browse to the *parent folder* of the Piratez MAPS/ROUTES/TERRAIN directories

Click Convert and a MapTilesets.tpl file ought appear in the RulesetConverter's current directory.

Then open it in a texteditor like Notepad++

Also open the MapTilesets.yml file that's in the subfolder /settings of MapView.

Copy the stuff in the .TPL file into your MapTilesets.yml file, obeying the laws of thermodynamics YAML.

Save it and try running MapView


if you find more than one ruleset that you'd like to import, Rinse & Repeat...

ps. That's off the cuff of my head, play around with it and i'll give advice if ya want,
« Last Edit: February 15, 2021, 01:13:17 am by kevL »

Offline Blazen

  • Sergeant
  • **
  • Posts: 36
    • View Profile
Re: Accessing Map Tiles in MapView
« Reply #2 on: February 15, 2021, 10:58:13 pm »
Thanks for the help but it's still not working completely.
I tried using the RulesetConverter and a couple of things happened.
I found the .RUL file in the piratez folder and ran the converter and it gave me an error message. See 1st attachment. I told it to continue but it didn't create the .TPL file.
To see if the problem was the file or if I'd just not done it properly I tried it on the the 'Xcom Files' ruleset and this time it made the .TPL file. I then copied the contents into the MapTilesets.yml and now when I try to run MapView I have the Xcom files maps so that works.

[Edit] I fixed the problem, there was a duplicate line in the file and when I commented it out, it found another duplicate line but at 39007, when I commented that out too it worked. I was converting the piratez.rul file.
When adding the contents of the .tpl file into the .yml and then running mapview I also got another duplicate key error. Due to me copying everything across verbatim, including the key 'tileset' at the top of the file, commenting that out fixed it.
« Last Edit: February 15, 2021, 11:57:42 pm by Blazen »

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: Accessing Map Tiles in MapView
« Reply #3 on: February 15, 2021, 11:21:02 pm »
okay, ill have a look at it today,

Offline Blazen

  • Sergeant
  • **
  • Posts: 36
    • View Profile
Re: Accessing Map Tiles in MapView
« Reply #4 on: February 15, 2021, 11:47:08 pm »
I solved the problem actually so its fine.
Thanks for the help.

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: Accessing Map Tiles in MapView
« Reply #5 on: February 16, 2021, 12:53:14 am »
okay :)

here's info i gathered for anyone else who attempts it:

I find "terrains" in

C:\0xC_kL\editors\MapView_kL\Dioxine_XPiratez\standard\xcom1\terrains.rul
C:\0xC_kL\editors\MapView_kL\Dioxine_XPiratez\standard\xcom2\terrains.rul
C:\0xC_kL\editors\MapView_kL\Dioxine_XPiratez\user\mods\Piratez\Ruleset\Piratez.rul
C:\0xC_kL\editors\MapView_kL\Dioxine_XPiratez\user\mods\Piratez\Ruleset\Piratez_Planet.rul

The 1st and 2nd rulesets appear to be duplicates or pseudo-duplicates of stock UFO, TFTD blocks.

The 3rd appears to contains "XBR" Base blocks.

The 4th is the big one. That's the primary one you want, i believe.

I got it all to load in Mapview - except the TFTD 'cause i don't have TFTD resources (the entries appear in Mapview's tree but the maps won't load ofc).

re. The error
The YamlDotNet library (not my code) that Mapview uses is throwing an exception when trying to read Piratez.rul. Fortunately the glitch is not in the "terrains" section. So I copied out the "terrains" section to a new textfile and sent that through the RulesetConverter, and got a valid MapTilesets.tpl ...


try something like that, just the "terrains" section(s)


ps. Note that Piratez_Planet.rul calls delete on several of the stock UFO blocks. Not sure what the far-reaching significance of that is but thought i'd mention it (either Piratez doesn't use them or Piratez replaces them &tc).
« Last Edit: February 16, 2021, 12:59:27 am by kevL »