How to properly code coast-like tiles

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

How to properly code coast-like tiles

Post by Wahazar »

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: 3069
Joined: Tue Jan 29, 2013 6:54 pm

Re: How to properly code coast-like tiles

Post by cazfi »

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: 362
Joined: Mon Jul 02, 2018 1:49 pm

Re: How to properly code coast-like tiles

Post by Wahazar »

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: http://forum.freeciv.org/f/viewtopic.php?f=11&t=91047
Post Reply