Page 1 of 1

[0.14] set_tiles() second param borkage

Posted: Mon Oct 17, 2016 1:20 pm
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

Re: [0.14] set_tiles() second param borkage

Posted: Mon Oct 17, 2016 1:37 pm
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

Re: [0.14] set_tiles() second param borkage

Posted: Mon Oct 17, 2016 1:59 pm
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.

Re: [0.14] set_tiles() second param borkage

Posted: Mon Oct 17, 2016 3:51 pm
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.

Re: [0.14] set_tiles() second param borkage

Posted: Mon Oct 17, 2016 5:34 pm
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.

Re: [0.14] set_tiles() second param borkage

Posted: Tue Oct 18, 2016 3:48 am
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.