OpenXcom Forum

Modding => Help => Topic started by: Blazen on February 15, 2021, 12:18:49 am

Title: Accessing Map Tiles in MapView
Post by: Blazen 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.
Title: Re: Accessing Map Tiles in MapView
Post by: kevL 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.

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


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,
Title: Re: Accessing Map Tiles in MapView
Post by: Blazen 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.
Title: Re: Accessing Map Tiles in MapView
Post by: kevL on February 15, 2021, 11:21:02 pm
okay, ill have a look at it today,
Title: Re: Accessing Map Tiles in MapView
Post by: Blazen on February 15, 2021, 11:47:08 pm
I solved the problem actually so its fine.
Thanks for the help.
Title: Re: Accessing Map Tiles in MapView
Post by: kevL on February 16, 2021, 12:53:14 am
okay :)

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

I find "terrains" in


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).