[0.14] set_tiles() second param borkage

Bugs that are actually features.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

[0.14] set_tiles() second param borkage

Post by aubergine18 »

If I set the `correct_tiles` param = `false` when using the LuaSurface.set_tiles() method, grass tiles at water boundaries that are adjacent to the tiles I'm updating still get "corrected", wrongly.

What I expect to happen: If I set `correct_tiles` param to `false`, then I expect no tile corrections anywhere, regardless of where I place my tiles.

Specifically, the land tiles at edge of water (those that are styled as half-land, half-water) should not be changed in any way unless I specifically overwrite them (or have the `correct_tiles` param set as `true` or `nil`).

Example code, images, discussion, etc: viewtopic.php?f=25&t=34428
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5404
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.14] set_tiles() second param borkage

Post by Klonan »

I actually managed to reproduce the issue


though this will probably not be an easy fix unfortunately

Looking at the raw tiles, it doesn't seem to be adding or removing any tiles in the wrong places, it is just the edges that are visually affected
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: [0.14] set_tiles() second param borkage

Post by aubergine18 »

A alternate (and preferable from my perspective) solution would be a new method to change the collision layers of an existing tile (as that's essentially what I'm trying to achieve with the fake water tiles in my mod). It would avoid having to redraw tiles and thus avoid the side-effects on adjacent tiles.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15871
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.14] set_tiles() second param borkage

Post by Rseding91 »

That's not tile correction. That's just the tile variation system using the best "transition" tile when 2 different tiles connect.

What you can do is make your own tile and don't give it those sprites so it can't use them. Then, it will just use the fixed images you give it regardless.
If you want to get ahold of me I'm almost always on Discord.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: [0.14] set_tiles() second param borkage

Post by aubergine18 »

I tried setting the following to nil:

Code: Select all

* fake.variants.inner_corner = nil
* fake.variants.outer_corner = nil
* fake.variants.side = nil
Where `fake` is my clone (via `table.deepcopy()`) of the original prototype.

Game crashes on startup with "No such node" errors.

So then I copied the images for those properties to my mod, deleted their content (so empty image of same dimensions as originals):

Code: Select all

fake.variants.inner_corner.picture = '__Epoch__/graphics/water-inner-corner.png'
fake.variants.outer_corner.picture = '__Epoch__/graphics/water-outer-corner.png'
fake.variants.side.picture         = '__Epoch__/graphics/water-side.png'
Of course, this does nothing to the rest of the water in the lake, or the land surrounding the lake, so the problem persists (but possibly to a lesser extent)...

Before...

Image

After...

Image

Somewhat frustrating.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: [0.14] set_tiles() second param borkage

Post by aubergine18 »

Another alternative would be if I could somehow toggle a flag on the surrounding tiles to tell them not to ignore any calls to update while I place or remove my fake water.

If there's any other way (aside from swapping player.character) to make water walkable, that would also suffice.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Post Reply

Return to “Not a bug”