Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu Mar 21, 2019 11:18 pm

All times are UTC




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat Dec 01, 2018 12:49 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Mon May 25, 2015 9:09 am
Posts: 354
Location: The Netherlands
Hey

Recently I've been working on a monorail track replacement newgrf. All I want to do is replace monorail. I don't want to add anything new. However when working on the tunnel portal, I came across this problem where it shows the grass tunnel portal that is used for the basegame standard rail portal, sticking through my tunnel portal.
Image
Would anyone know of a way to remove this grass tunnel portal in nml?

See the code for the railtype here:
[+] Spoiler
Code:
item(FEAT_RAILTYPES, MONO, 3) {
     property {
         label:                      "MONO";
         railtype_flags:             bitmask();            //Prevents other newgrfs from disabling level crossings
     }
     graphics {
         track_overlay:      MONO_overlay;            
         underlay:         MONO_underlay;            
         bridge_surfaces:   MONO_bridge;            
       tunnels:         MONO_tunnel;            
         depots:            switch_MONO_depot;          
       gui:            MONO_gui;               
       tunnel_overlay:   UM_tunnel_overlay;         
         fences:           NO_fences;                   
       level_crossings:   left_level_crossing_state_switch; //Allows me to change the level crossing sprite
     }
 }

_________________
No pics no clicks. Seriously.
ImageImageImageImageImageImage


Top
   
PostPosted: Sat Dec 01, 2018 1:22 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Feb 14, 2015 12:44 am
Posts: 2883
Location: Newcastle, Australia
I had similar problems when making my track set.

Quast65 came up with a solution with some sprites he did for the tracks and tunnels.

Can find his information at Railtype Templates in NML over on the Simuscape Website at
http://www.simuscape.net/simutalk/viewt ... 4df68fb9d6

Hope it might help you.

Cheers

_________________
Soot Happens
All my projects are GPLv2 License unless stated.
Auz Project Releases: viewtopic.php?f=67&t=84725
AuzTrains: http://www.tt-forums.net/viewtopic.php?f=26&t=74193
Auz Industry Sets: http://www.tt-forums.net/viewtopic.php?f=26&t=74471
AuzObjects: viewtopic.php?f=26&t=75657
AuzBridges: viewtopic.php?f=26&t=75248
AuzStations: viewtopic.php?f=26&t=76390
AuzTracks: viewtopic.php?f=26&t=82691


Top
   
PostPosted: Sat Dec 01, 2018 2:54 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1646
Location: The Netherlands
The solution is indeed very simple, you need to replace the graphics from the OpenGFX-extra base set.
So you need to use:
Code:
replacenew(RAILTYPE_TUNNELS


To completely remove them use this code (change the path to the graphicsfile ofcourse to where your graphicsfile will be placed):
Code:
//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):
Attachment:
notracklesstunnels.png
notracklesstunnels.png [ 3.49 KiB | Viewed 872 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:
Attachment:
Example525.png
Example525.png [ 61.06 KiB | Viewed 872 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:
//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:
Attachment:
tracklesstunnel-overlay-sprites.png [115.52 KiB]
Not downloaded yet

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! :tongue:

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Sat Dec 01, 2018 5:00 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Mon May 25, 2015 9:09 am
Posts: 354
Location: The Netherlands
Quast65 wrote:
The solution is indeed very simple, you need to replace the graphics from the OpenGFX-extra base set.
So you need to use:
Code:
replacenew(RAILTYPE_TUNNELS


To completely remove them use this code (change the path to the graphicsfile ofcourse to where your graphicsfile will be placed):
Code:
//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]
}

<snip>

Thanks! This worked!

_________________
No pics no clicks. Seriously.
ImageImageImageImageImageImage


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2019 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2019.
Hosted by Zernebok Hosting.