Page 1 of 4

[MOD 0.12.x] Factorio Maps

Posted: Thu Aug 06, 2015 8:28 pm
by jeroon
Type: Mod
Name: Factorio Maps
Description: This mod creates a Google Map of your Factorio game. It will create a local html file, nothing has to be uploaded for it to work.
License: Free for all
Version: 0.5.9
Release: 2016-01-16
Tested-With-Factorio-Version: 0.12.24 (minimum required: 0.12.11, for older versions check here)
Category: Helper
Tags: Maps, Google
License
Pictures
Version history
Usage :

- use "Midday" so your images are nice and light.
- Click "Generate Images". This will start taking the screenshots, and generate an index.html in the script-output folder. Script-output is in the same folder as Saves.
- Open index.html in your browser (Double click it/Open With/Drag in browserwindow)
- For info on the advanced options, click Help.

[Warning: on bigger maps it might take a while, and take up quite a bit of discspace.
Works in singleplayer, should work in multi player (use at own risk!), though people might disconnect. Does not work with headless server. You can always load multiplayer maps in singleplayer and make maps that way.]


ToDo:
- Local maps don't seem to work in Edge Browser for me, need to look into that further
- Add markers to the map/ set center of map (need to figure out Google Maps pixel to Latitude)
- Make advanced stuff disappear with the click of a button ; )

Re: [MOD 0.12.x] Factorio Maps

Posted: Thu Aug 06, 2015 8:46 pm
by cengbrecht

Re: [MOD 0.12.x] Factorio Maps

Posted: Thu Aug 06, 2015 8:50 pm
by jeroon
mngrif found out the Alt info wasn't showing, fixed now in 0.5.2 .

Re: [MOD 0.12.x] Factorio Maps

Posted: Thu Aug 06, 2015 8:59 pm
by mngrif

Re: [MOD 0.12.x] Factorio Maps

Posted: Sat Aug 08, 2015 12:30 am
by Cooolaid
This is exactly how Maps "should" look like when pressing [ M } in game.

Really nice work (jeroon) :)

Re: [MOD 0.12.x] Factorio Maps

Posted: Fri Aug 14, 2015 10:49 pm
by billw
This doesn't work on MP maps even when loaded in SP :(

/edit I looked, the code half uses game.players[1]. the other half uses game.player. Search replaced game.player. with game.players[1]. and it works now on my MP map.

Re: [MOD 0.12.x] Factorio Maps

Posted: Sat Aug 15, 2015 5:22 pm
by cengbrecht
billw wrote:This doesn't work on MP maps even when loaded in SP :(

/edit I looked, the code half uses game.players[1]. the other half uses game.player. Search replaced game.player. with game.players[1]. and it works now on my MP map.

This should be a feature! :P

Re: [MOD 0.12.x] Factorio Maps

Posted: Sat Aug 15, 2015 7:37 pm
by jeroon
billw wrote:This doesn't work on MP maps even when loaded in SP :(

/edit I looked, the code half uses game.players[1]. the other half uses game.player. Search replaced game.player. with game.players[1]. and it works now on my MP map.
Thanks for that, I've updated the mod :)

It's only usable in singleplayer. You can however now load a multiplayer map in singleplayer and make a map that way.

Re: [MOD 0.12.x] Factorio Maps

Posted: Wed Aug 19, 2015 6:48 pm
by FISHMANPET
So this is probably a bug in the mod and not a bug in Factorio, but the game crashed building the map. Not sure if it generated all the images or not (my guess would be it did) but the index.html was gone from the script-output directory. Not sure if the log file (attached) is enough information but not sure if it's possible to get anything more detailed.

This is running 12.4 on Win7 x64, using the zip package, not the installer.

Re: [MOD 0.12.x] Factorio Maps

Posted: Thu Aug 20, 2015 10:27 am
by jeroon
I'm no expert on crash logs, but the only thing I see is :

luaremove_path error: Scripts can only use file space inside of C (requested path was C:/Users\FISHMANPET\Dropbox\Factorio_0.12.0\script-output\FactorioMaps/Map(96,55)1024)

Now i don't see anything weird there, except that you're using a dropbox folder. Can you try copying your entire factorio folder outside dropbox, and try again?

Re: [MOD 0.12.x] Factorio Maps

Posted: Tue Sep 08, 2015 10:11 am
by jeroon
Updated to 0.5.5.

Changelog:
Narc changed the javascript output, so now when you zoom in/out/move in your browser, the location in the browsers url bar updates, so you now can link to a specific position on the map. Very handy for pointing people to a point on your map. Thanks Narc!

Re: [MOD 0.12.x] Factorio Maps

Posted: Fri Sep 11, 2015 4:52 am
by Narc
Hey, I just got a multiplayer patch from YPetremann over on github. The diff looks like this: https://github.com/narc0tiq/FactorioMap ... b6689f?w=1

I went ahead and included a version bump and packed it up as a tentative v0.5.6 -- grab it from https://github.com/narc0tiq/FactorioMap ... _0.5.6.zip.

Everyone, be aware that I am not Jeroon and therefore this is not an official update.

Also please note that if you're using a headless server you cannot use FactorioMaps, as it will happily crash the headless peer when it tries to take screenshots. Notably, the confusing warning we saw earlier shows up again:

Code: Select all

 107.508 Warning LuaGameScript.cpp:1078: luaremove_path error: Scripts can only use file space inside of /home/narc/srv/factorio/script-output (requested path was /home/narc/srv/factorio/script-output/FactorioMaps/bob-world-3)
But this is not actually directly related to the crash that happens immediately thereafter:

Code: Select all

#0  0x7fbc88f2cd40 in ?? at ??:0
#1  0x5e1f8a in getWidth at /tmp/factorio-yavVX5/src/Graphics/Display.cpp:197
#2  0x4455ff in luaTakeScreenshot at /tmp/factorio-yavVX5/src/Script/LuaGameScript.cpp:990
#3  0xa8169e in callWrapper at /tmp/factorio-yavVX5/src/Script/LuaBinder.hpp:307
[...remainder ellided...]
That said, if you're doing multiplayer the classic way (with all peers playing), this will let any player trigger the map generation instead of requiring player 1 to do it. Do remember that all players will perform the same operations, and also that since the map generating process is usually quite long, it will likely result in everyone disconnecting from everyone else.

Re: [MOD 0.12.x] Factorio Maps

Posted: Sun Sep 13, 2015 7:50 pm
by jeroon
Thanks for the changes YPetremann, I've updated the first post. :)

Note that I haven't tested it myself in a Multi Player game, it crashed my game when I tried to use it with 2 local clients, so use at own risk, backup your backups bladibla.

As stated in the first post, you can always open your MP game in Single Player and use Factorio Maps that way.

Re: [MOD 0.12.x] Factorio Maps

Posted: Thu Sep 17, 2015 1:08 am
by HeilTec
Great work on creating this useful helper.

The ability to create and share map and coordinates has been a fantastic help in multiplayer games.

A slight issue with the browser history made me look for a fix.
Every move or zoom that changed the URL added a new history entry.
fix
I have made a pull request to Narc's github

(edit: Removed download - get the new version.)

Re: [MOD 0.12.x] Factorio Maps

Posted: Thu Sep 17, 2015 5:00 am
by Narc
HeilTec wrote:A slight issue with the browser history made me look for a fix.
[...]
I have made a pull request to Narc's github
And I've built it up into a v0.5.7: https://github.com/narc0tiq/FactorioMap ... _0.5.7.zip

Thank you very much for the fix!

Re: [MOD 0.12.x] Factorio Maps

Posted: Thu Sep 17, 2015 6:03 am
by HeilTec
Narc wrote:...
Thank you very much for the fix!
I hope for a bright future for this.

I wonder if more parts of the API can be used?

Re: [MOD 0.12.x] Factorio Maps

Posted: Thu Sep 17, 2015 6:53 am
by jeroon
Thanks for the changes, I've updated the first post :)

Re: [MOD 0.12.x] Factorio Maps

Posted: Thu Sep 17, 2015 7:03 am
by Narc
Hurrah for cooperative development!

Re: [MOD 0.12.x] Factorio Maps

Posted: Wed Sep 30, 2015 7:24 am
by Ezzue
Hey!
Man I love this mod!
But how do you upload it to a website? And any suggestions on which sites?
Thanks in advance.

Re: [MOD 0.12.x] Factorio Maps

Posted: Sat Oct 17, 2015 7:31 pm
by jeroon
Updated to 0.5.8 due to changes in Factorio 0.12.11: game.on_init has become script.on_init and game.makefile is now game.write_file.

Because of this changes the new version won't work for versions older than 0.12.11, I've attached the previous version (0.5.8) to this post.

WARNING: The file attached to this post is the old version, new version is in the first post!