How to properly code coast-like tiles

Do you want to help out with Freeciv development? Then check out this forum.
Wahazar
Elite
Posts: 321
Joined: Mon Jul 02, 2018 1:49 pm

How to properly code coast-like tiles

Postby Wahazar » Sun Feb 09, 2020 1:43 pm

I would like to implement Mangrove tiles in hex topology, which should work like coast ocean tiles trees standing on ocean blend, sand beach along nearby land, not around trees).
I literally copied hexemplio water*.spec files and changed coast to mangrove:

Code: Select all

gfx = "hexemplio/water1"
...
 2, 0,  "t.l1.mangrove_cell_u000"
 2, 1,  "t.l1.mangrove_cell_u100"
 2, 2,  "t.l1.mangrove_cell_u010"
 2, 3,  "t.l1.mangrove_cell_u110"
 2, 4,  "t.l1.mangrove_cell_u001"
 2, 5,  "t.l1.mangrove_cell_u101"
 2, 6,  "t.l1.mangrove_cell_u011"
 2, 7,  "t.l1.mangrove_cell_u111"
...
}

of course same for tilespec file:

Code: Select all

[tile_mangrove]
tag = "mangrove"
blend_layer = 2
num_layers = 2
layer0_match_type = "coast"
layer1_match_type = "water"
layer1_match_with = "water"
layer1_sprite_type = "corner"


but client crashes with message:
Loading tileset "augmentedi".
0: Don't have graphics tags "t.l1.mangrove_cell_u000" or "" for same cell terrain "Mangrove".

No idea what is going wrong, surely I have t.l1.mangrove_cell_u000 (mangrove.spec is included in tileset files section).

Are coast tiles somewhat hardcoded? Version 2.6.

cazfi
Elite
Posts: 1753
Joined: Tue Jan 29, 2013 6:54 pm

Re: How to properly code coast-like tiles

Postby cazfi » Sun Feb 09, 2020 3:25 pm

Wahazar wrote:No idea what is going wrong, surely I have t.l1.mangrove_cell_u000 (mangrove.spec is included in tileset files section).

In most cases such problems have been caused by forgetting to add comma to the end of the line listing previously last filename in tilespec 'files', so the new filenames are not part of 'comma separated list'.

Wahazar
Elite
Posts: 321
Joined: Mon Jul 02, 2018 1:49 pm

Re: How to properly code coast-like tiles

Postby Wahazar » Sun Feb 09, 2020 7:02 pm

Not in this case:

Code: Select all

  ...
  "augmented2/terrain/taiga.spec",
  "augmented2/terrain/mangrove.spec",
  "augmented2/terrain/activities.spec",
  "augmented2/misc/techs.spec"
Augmented2 ruleset/modpack for freeciv2.6: viewtopic.php?f=11&t=91047