The solution is indeed very simple, you need to replace the graphics from the OpenGFX-extra base set.
So you need to use:
To completely remove them use this code (change the path to the graphicsfile ofcourse to where your graphicsfile will be placed):
Code: Select all
//Remove trackless tunnelgraphics from OpenGFX-extra
replacenew (RAILTYPE_TUNNELS, "FARTStest/gfx/notracklesstunnels.png") {
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
[ 0,0,1,1,0,0]
}
And this graphic (difficult to see, but its a single transparent blue pixel):
- notracklesstunnels.png (3.49 KiB) Viewed 3347 times
You only have to do this once in your GRF, so not for each railtype you add.
Do keep in mind that you then have to provide full-tile graphics for your custom tunnels, otherwise you get some strange glitches
And keep in mind that this will remove all of the tunnel base-graphics for all tracksets you will load into your game (also vanilla tracks by the way)!!
In most cases that will not be an issue, as almost all tracksets (and also vanilla tracks) provide full-tile custom tunnels, but there is at least one exception and that is WIRED.
This is what happens with WIRED:
- Example525.png (61.06 KiB) Viewed 3347 times
As you can see, WIRED has no custom tunnel graphics, so you get some weird glitches.
I was already planning to contact McZapkie when I am ready to release my trackset to ask him to provide custom tunnels for his GRF so that removing the tunnel base graphics wont be an issue anymore with his GRF, but maybe he will read this post in the meantime
AFAIK I dont think there are any other current tracksets that have no custom tunnels...
But maybe you do want to use some sort of tunnel base graphics (and then design custom tunnels for your railtypes around those) and want them to be climate aware...
This is the code I used for the trackset I am currently working on:
Code: Select all
//Parameter to manually set Alpine climate
param 7 {
param_alpine {
name: string(STR_PARAM_NAME_ALPINE);
desc: string(STR_PARAM_DESC_ALPINE);
min_value: 0;
max_value: 1;
def_value: 0;
names: {
0: string(STR_PARAM_ALPINE_NONE);
1: string(STR_PARAM_ALPINE_CUSTOM);
};
}
}
}
//Replace trackless tunnelgraphics from OpenGFX-extra
template tmpl_trackless_tunnel(y) {
[ 10, y, 64, 39, -31, -8]
[ 84, y, 64, 39, -31, -38]
[158, y, 64, 23, -31, 0]
[232, y, 64, 23, -31, -30]
[306, y, 64, 23, -31, 0]
[380, y, 64, 23, -31, -30]
[454, y, 64, 39, -31, -8]
[528, y, 64, 39, -31, -38]
}
if (param[7] == 1) {
replacenew(RAILTYPE_TUNNELS, "FARTS/gfx/tracklesstunnel-overlay-sprites.png") { tmpl_trackless_tunnel(10)
tmpl_trackless_tunnel(265)
}
} else {
if (climate == CLIMATE_TROPICAL) {
replacenew(RAILTYPE_TUNNELS, "FARTS/gfx/tracklesstunnel-overlay-sprites.png") { tmpl_trackless_tunnel(180)
tmpl_trackless_tunnel(350)
}
}
else {
replacenew(RAILTYPE_TUNNELS, "FARTS/gfx/tracklesstunnel-overlay-sprites.png") { tmpl_trackless_tunnel(10)
tmpl_trackless_tunnel(265)
}
if (climate == CLIMATE_ARCTIC) {
replacenew(RAILTYPE_TUNNELS, "FARTS/gfx/tracklesstunnel-overlay-sprites.png") { tmpl_trackless_tunnel(95)
}
}
if (climate == CLIMATE_TOYLAND) {
replacenew(RAILTYPE_TUNNELS, "FARTS/gfx/tracklesstunnel-overlay-sprites.png") { tmpl_trackless_tunnel(435)
}
}
}
}
And these are the graphics I replaced them with:
So in my case I replace the tunnelgraphics with walls with (climate aware) grass on them, I can then design my custom tunnels using those as a base.
I also wanted them to be able to adapt to Alpine climate (so Temperate grass in Arctic), but a player has to do that manually, so thats why there is a parameter.
Hope this helps!