Export to file
Shazbot opened this issue · 8 comments
I have a suggestion to add an option to the planner view to export the map to a json file. I would then be able to make a mod that consumes that file ingame and recreates the region ownership for factions.
It'd be nice if the json used ingame db keys for regions and factions, to make my job easier.
Thanks, and really impressed with the map.
Hey @Shazbot,
Thank you for opening an issue!
I have a suggestion to add an option to the planner view to export the map to a json file. I would then be able to make a mod that consumes that file ingame and recreates the region ownership for factions.
Nice, I've always wanted to do something like that.
It'd be nice if the json used ingame db keys for regions and factions, to make my job easier.
I use the database keys from the assembly kit
throughout the app, so that should not be a problem. The format is:
{
"db_region_key": "db_faction_key",
...
}
Latest version of app, with the export button, should be live now. Let me know if that works for you.
Thanks!
Thanks for this, it's exactly what I needed.
Made the mod, and it works fine: https://steamcommunity.com/sharedfiles/filedetails/?id=2154921490
An idea I have from here is to add importing, where I create the same kind of json file ingame and the user imports it into your app. It would enable users to edit their campaign mid-save.
I also had a request for supporting custom factions that some mods add, notable OvN Lost Factions, but this is probably not that easy for you to include. But if you want, you can get all the faction keys and localized faction names, without the banner, from the Mixu Unlocker mod, for example wh2_main_ovn_chaos_dwarfs for Chaos Dwarfs.
Thanks again, works great.
Thanks for this, it's exactly what I needed.
Made the mod, and it works fine: https://steamcommunity.com/sharedfiles/filedetails/?id=2154921490
Wow, great work. Just tested it out, amazing!
An idea I have from here is to add importing, where I create the same kind of json file ingame and the user imports it into your app. It would enable users to edit their campaign mid-save.
Yeah, I can look into that, shouldn't be that difficult to implement.
I also have a project that can read save files directly in the browser. I used it in older versions of the app, but it was slow. And usually breaks with every new patch. And it still can't write to save files at the moment, something I still have to implement. But yeah, JSON import/export is a nice alternative.
I also had a request for supporting custom factions that some mods add, notable OvN Lost Factions, but this is probably not that easy for you to include. But if you want, you can get all the faction keys and localized faction names, without the banner, from the Mixu Unlocker mod, for example wh2_main_ovn_chaos_dwarfs for Chaos Dwarfs.
That is also something I can investigate further, will need to rearrange some stuff, but definitely doable.
I tried the import feature and it errors out with this (renamed to txt so I can attach it):
Alright, fixed it I hope. The keys have to be sorted alphabetically for some reason, must be some strange keyed thing I am doing somewhere else in the code.
Hey @Shazbot,
After a lot of delaying and procrastinating I have managed to rewrite the map painter in a separate app. I had difficulties trying to add more functionality to the painter and it was hard to do even basic changes without running in to problems elsewhere.
Anyway, check it out here: https://imrz.github.io/tww2-map-painter/
It's still a work in progress, but it has the same functionalities as the current map painter and more. Users can even import factions that are not on the list, and will be automatically added to the dropdown, this should be a nice workaround for any modded/future factions or any faction I missed.
Peace
That looks amazing, thanks a lot! You really went above and beyond with all this.
And this doesn't really matter, but what made you pick React now instead of Vue?
No problem, these are fun projects to do. Why React instead of Vue? Re-evaluating react in combination with libraries like leaflet. Also waiting for Vue 3 release to drop. And I just needed something fresh to get me started really.