Expose default cover tile for packed ice

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Xcone
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Sep 29, 2018 9:09 am
Contact:

Expose default cover tile for packed ice

Post by Xcone »

Hello,

For my mod P.U.M.P. I place pump- and pipe ghosts on liquid resources. I also place landfill, packed ice, or foundation using the default-cover-tile exposed in the API for the tiles that need it.

However, there doesn't appear to be a way find which tile to use to cover meltable tiles. I can see a tile is meltable by checking the "meltable" property in the collision mask. I suppose I can figure out which tiles could be used as cover for meltable tiles, using the thawed property.

But that doesn't help figure out which I should be using. So far I am just using hard-coded concrete. But a user pointed out there's a hidden variable that tracks which tile was used last: https://mods.factorio.com/mod/pump/disc ... 24980b9cdf
This is backed up by a (not-a-) bug report I found: viewtopic.php?t=118642

I asked in discord, and Xorimuth confidently replied that it's not exposed: https://discord.com/channels/1396775903 ... 3527109642

I would like access to that variable, so I can offer the same tile-covering experience using my mod, as the players already can with building regularly using forced-build.

Thanks!
Xcone
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat Sep 29, 2018 9:09 am
Contact:

Re: Expose default cover tile for packed ice

Post by Xcone »

It seems surface.can_place_entity is also affected by this mechanic.

When you're new to Aquilo this function will return false on ammonia and ice. I guess that makes sense. Hoever, it does mean P.U.M.P. just refuses to work until you put down a couple of tiles. This can be (and has already been) a little confusing.

I can see a couple solution that would improve this:
1. Give the variable that controls this behavior a default, so it's always at least concrete until the user does something else
2. Expose the variable in the API; that way I can check in the mod if it has a value, and work around it.
3. Give (packed) ice a default cover tile, like water/lava/ammonia has (though I suppose there's a reason it doesn't already have this).
4. Expose a method that explains why the result is true or false.

For the last one I was thinking a method that returns an object like:
{
can-place = true,
requires-forced=true,
tile="ammonia",
cover_tiles = ["packed-ice", "concrete"]
}

or

{
can-place = false,
requires-forced=true,
tile="ammonia",
reason="meltable-tile-cover-not-selected"
}

or

{
can-place = true,
requires-forced=true,
tile="water"
cover_tiles = ["landfill"]
}

or

{
can-place = false,
requires-forced=true,
tile="lava"
reason="cover-tile-not-unlocked"
}

or

{
can-place = false,
requires-forced=false,
tile="space"
reason="tile-cant-be-covered"
}

or

{
can-place = true,
requires-forced=false,
tile="grass",
cover_tiles = []
}

I am confident you can come up with something better that more suited for future uses, too. But I do hope it illustrates the information-need I currently have. :-)
Post Reply

Return to “Modding interface requests”