[Request] Screenshot / mapping mod

This is the place to request new mods or give ideas about what could be done.
Post Reply
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

[Request] Screenshot / mapping mod

Post by cube »

This mod should add a button to the game that generates a google map in the script output directory. Scripting interface already supports this for some time:
https://forums.factorio.com/wiki/inde ... screenshot
https://forums.factorio.com/wiki/inde ... e#makefile

(I'm too busy / lazy to do this myself :-) )

drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: [Request] Screenshot / mapping mod

Post by drs9999 »

slpwnd mentioned google map export before. I doubt that it would be too hard to do, but I failed to find any information what it actually is.

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: [Request] Screenshot / mapping mod

Post by cube »

Yeah, I couldn't find too much details about the format too, but imho it will be just multi resolution tiles with some json or xml metadata.

jeroon
Filter Inserter
Filter Inserter
Posts: 351
Joined: Sun Jan 26, 2014 10:18 am
Contact:

Re: [Request] Screenshot / mapping mod

Post by jeroon »

I've found a way to generate a map with the Google API, and I'm now trying to get the screenshots in. One thing I can't find: is there a way to determine if a tile is generated (to determine the edge of the map)? Something like "ischunkgenerated"? If not, how hard would it be to put it in 0.10.10?
*puppyeyes, and something with sugar on top*
Image

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: [Request] Screenshot / mapping mod

Post by cube »

I need a break from MP, I'll do it now.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Request] Screenshot / mapping mod

Post by Rseding91 »

cube wrote:I need a break from MP, I'll do it now.
Would these work?

Goes in LuaGameScript:

Code: Select all

int32_t LuaGameScript::luaIsChunkGenerated(lua_State* L)
{
  luaL_argcheck(L, lua_gettop(L) == 2, 0, "Wrong number of arguments.");
  lua_pushboolean(L, !!this->getMap().getTileOptional(RealPosition(luaL_checknumber(L, -2), luaL_checknumber(L, -1))));
  return 1;
}
Goes in LuaPlayer:

Code: Select all

int32_t LuaPlayer::luaIsChunkCharted(lua_State* L)
{
  luaL_argcheck(L, lua_gettop(L) == 2, 0, "Wrong number of arguments.");
  SubChart* subChart = this->map.getForceData(this->player->forceID)->chart->getSubChart(RealPosition(luaL_checknumber(L, -2), luaL_checknumber(L, -1)));
  lua_pushboolean(L, !(subChart == NULL || subChart->videoSprite == NULL));
  return 1;
}
If you want to get ahold of me I'm almost always on Discord.

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: [Request] Screenshot / mapping mod

Post by cube »

Yes, but you wouldn't know boundaries of the area to test, I'm thinking about iterator over generated chunks. Also the charted test should be a part of force, not player.
But something like what you wrote will definitely be there. Will you make a pull request, or should I put it in myself?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Request] Screenshot / mapping mod

Post by Rseding91 »

cube wrote:Yes, but you wouldn't know boundaries of the area to test, I'm thinking about iterator over generated chunks. Also the charted test should be a part of force, not player.
But something like what you wrote will definitely be there. Will you make a pull request, or should I put it in myself?
It's a simple mater to find all generated chunks by starting at chunk 0,0 and searching outwards fractaly. That can be done in LUA without any issues provided the "ischunkgenerated"/"ischunkcharged" function exists. I use a similar method myself to find all connecting water tiles for a given body of water in the Landfill 2 mod.

Regarding the pull request: you can put it in yourself. I'm working on a bunch of other modding interfaces and I'll submit them all at once when they're ready.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Skellitor301
Fast Inserter
Fast Inserter
Posts: 140
Joined: Mon Aug 04, 2014 10:04 pm
Contact:

Re: [Request] Screenshot / mapping mod

Post by Skellitor301 »

You do realize you can already make labeled markers in the game right?

Image

Just place a single track and put down a trainstop next to it, then remove the track, and finally rename the stop.


jeroon
Filter Inserter
Filter Inserter
Posts: 351
Joined: Sun Jan 26, 2014 10:18 am
Contact:

Re: [Request] Screenshot / mapping mod

Post by jeroon »

It is done. (Well, a first version is ;) ). https://forums.factorio.com/forum/vie ... =14&t=5812

Post Reply

Return to “Ideas and Requests For Mods”