GarryG wrote: ↑25 Jan 2023 22:08
Must be something else in code to get it to use the snow one as as it still gives the default roads
What happens when you change:
Code: Select all
//calculate ground sprite for object
switch (FEAT_OBJECTS, SELF, switch_fences12_object, [
STORE_TEMP(0, 0),
STORE_TEMP(GROUNDSPRITE_NORMAL, 1),
STORE_TEMP(terrain_type == TILETYPE_DESERT ? GROUNDSPRITE_DESERT : LOAD_TEMP(1), 1),
STORE_TEMP(terrain_type == TILETYPE_SNOW ? 1352 : LOAD_TEMP(1), 1),
STORE_TEMP(snowline_height == 0xFF ? 0xFF : nearby_tile_height(0,0) - snowline_height, 255),
STORE_TEMP((LOAD_TEMP(255) == -1) ? 1351 : LOAD_TEMP(1), 1),
STORE_TEMP((LOAD_TEMP(255) == 0) ? 1352 : LOAD_TEMP(1), 1),
STORE_TEMP((LOAD_TEMP(255) == 1) ? 1351 : LOAD_TEMP(1), 1)
]) {
switch_fences12_view;
}
To
Code: Select all
//calculate ground sprite for object
switch (FEAT_OBJECTS, SELF, switch_fences12_object, [
STORE_TEMP(0, 0),
STORE_TEMP(1313, 1),
STORE_TEMP(terrain_type == TILETYPE_DESERT ? GROUNDSPRITE_DESERT : LOAD_TEMP(1), 1),
STORE_TEMP(terrain_type == TILETYPE_SNOW ? 1352 : LOAD_TEMP(1), 1),
STORE_TEMP(snowline_height == 0xFF ? 0xFF : nearby_tile_height(0,0) - snowline_height, 255),
STORE_TEMP((LOAD_TEMP(255) == -1) ? 1351 : LOAD_TEMP(1), 1),
STORE_TEMP((LOAD_TEMP(255) == 0) ? 1352 : LOAD_TEMP(1), 1),
STORE_TEMP((LOAD_TEMP(255) == 1) ? 1351 : LOAD_TEMP(1), 1)
]) {
switch_fences12_view;
}
I think this way you tell it to replace a 1313 tile with a snowversion (originally you were telling it to change a regular grass basetile to change to snow road, but you are not using grass basetile in this object)
EDIT:
It could be, that this only works for one direction.
The way these objects are coded, the snow-variant is for all 4 views.
So you can only make 4 views of one direction (I hope I explain it clear enough) with snow-awareness
So, you should make a set with 4 graphics with only 1313 and 1351, just with 4 \-directions
And another with only 1314 and 1352 with the other 4 /-directions
Tried what you suggested .. it almost works.
It chooses the default game roads .. not the roads players using.
Not even when you load a roadtypeset?
Is there a difference if the roadtypeset is before or after the objectset in the GRF-list?