GarryG wrote:Shall see what I can do about that .. my knowledge of coding isn't very good .. most of my work the codes I use are from other peoples object sets .. but I learning a wee bit.
I'm not doing anything different so I wouldn't suggest anything that I thought would be fiendishly complex

And honestly I don't know all the details either, but:
Basically, if for example you look at water_tiles.png and the objects you coded with that, then your object code looks like this:
Code: Select all
spritelayout spritelayout_water_tiles_1 {
ground {
// normal ground sprite - always draw
sprite: LOAD_TEMP(0) + LOAD_TEMP(1);
}
building {
sprite: spriteset_water_tiles(0);
hide_sprite: nearby_tile_height(0, 0) >= snowline_height;
xoffset: 0; //from NE edge
yoffset: 0; //from NW edge
zoffset: 0;
xextent: 16;
yextent: 16;
zextent: 16;
}
"Ground" is ... the groundtile the game draws (like grass or snow or desert). "Building" is the object you put on it.
But you've drawn for example the sailing ship with water, so you don't see anything from the groundtile anyway. However, if you removed that self-drawn water and replaced it with transparency (usual blue background), you'd see the groundtile.
After doing that, you have two ways to get water as a groundtile:
As it is now, you load that switch with its temporary variables that calculate the groundsprite it draws - usually you want that for sloped objects and to make the ground snow-aware. That object doesn't have slopes and snow-awareness is done with your ..._SNOW building, so you can just replace "LOAD_TEMP(0) + LOAD_TEMP(1)" with "GROUNDSPRITE_WATER" (the other pre-defined possible choices are here btw:
https://newgrf-specs.tt-wiki.net/wiki/NML:Spritelayout ).
When doing that, no matter where you build the object, it'll draw water under the object (as provided by the baseset so it always fits the rest of the graphics).
Alternatively you can do it like your reef objects, and add OBJ_FLAG_DRAW_WATER to the object flags. Then it draws water when the object is build on water but otherwise loads the normal groundsprite (so you could build ships on land if you wanted - or forbid building on land by also adding OBJ_FLAG_NOT_ON_LAND).
It's no big deal and largely water blends anyway; not really something that's massively noticeable. Just thought I'd mention it

(also, for your _PURCHASE sprites, you can do the same and replace GROUNDSPRITE_NORMAL with GROUNDSPRITE_WATER; for example for your ships or oyster floats)
ps: the default values for x-, y-, zoffset and x, y, z-extend are 0, 0, 0 and 16, 16, 16 respectively, so if your object uses these values if you feel like it you can remove the lines from the building { } block. Doesn't hurt anything having them, but if you think your .nml file is getting too long or something you can get rid of those lines
