Palats / mapshot

Factorio mod to export maps as zoomable html
Apache License 2.0
77 stars 12 forks source link

CMD window closes immediately on running mapshot.exe directly. #3

Closed cengbrecht closed 9 months ago

cengbrecht commented 3 years ago

Hello! I think this is a great mod, however, I am having trouble just viewing the default html file on windows. It should be able to run seeing the code there, however, it is unable to load the mapshot.json due to the link being a file:/// rather than http:// I have tried editing the js file that is generated from however it isn't following my change. I was wondering if you've tried this, or if this is not possible.

cengbrecht commented 3 years ago

Trying out the exe file... Read then comment.. Will see if that fixes the issues. :)

cengbrecht commented 3 years ago

Yeah, the exe fixes the problem. Sorry about that. Note, when loading the exe, run in a cmd window so you can see the output for anyone who doesnt know how to use the exe. You will probably have to point it at your factorio installation if its on steam. And you don't need to defign which map to show, it will list them.

Palats commented 3 years ago

Unfortunately (as you experienced), just loading through file:/// doesn't work. In practice, security on browsers makes it virtually impossible to make it work (beside having a single .html file and no other file) - hence requiring a webserver. This is what the .exe provides, though any other webserver would do the trick.

For the steam version - the .exe does not try to use the Steam version for now. If steam is not running, running the steam version does not work, so I haven't included it in the path to look for by default as it was not a great experience (whether the end result is better is up for debate).

For the cmd window - in theory, when run from the explorer, the window should stay open, giving the opportunity to see the output. If you had a case where it got closed immediately (thus requiring launching from cmd explictly) that would be a bug indeed.

cengbrecht commented 3 years ago

Hey Palats!

Fantastic mod!

Yes, the cmd window did immediately close. And I QUITE like the map tool. I would love to give you more feedback on it if you're interested, I have lots of ideas and questions.

The whole reason I was thinking of it, was to look for something like Dynmap for Minecraft.

On the maps I've rendered yesterday, they all had a 1px gap between the images on the map, is this normal?

Palats commented 3 years ago

Thanks for the feedback! I'm happy with ideas/questions - Github issues & Factorio mod discussion pages (https://mods.factorio.com/mod/mapshot/discussion) are fine places for those. Though of course I make no guarantees :) I tend to work on mapshot only periodically. I guess once Factorio 1.1 gets released I will do another pass.

For Dynmap - I've used it for Minecraft, it is nice. Unfortunately, it is not possible to do something similarly real-time with Factorio, as the plugins are much more limited (Minecraft plugins basically patch Minecraft code, while Factorio as a clean API surface). I have one idea to simulate it, but that would be a terrible hack.

For the gaps between tiles - indeed, that's an issue. It comes from Leaflet, the map library I'm using. I've open https://github.com/Palats/mapshot/issues/4 to track it (somehow I got use it and never took a stab so far).