Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sun Feb 24, 2019 12:07 am

All times are UTC




Post new topic  Reply to topic  [ 713 posts ]  Go to page Previous 132 33 34 35 36
Author Message
PostPosted: Wed Feb 13, 2019 4:16 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9178
Location: Sol d
GarryG wrote:
Quast65 wrote:
LSF_ONLY_ON_FLAT_LAND


thanks for that.

I've have got that line in the code, but the split industries sometimes still built 2 levels.


I guess you have to add to the location_check a comparison between the tiles and an arbitrary tile, preferentially with (0,0) the origin of the industry layout, or maybe in the tiles' tile_check callbacks, comparing nearby_tile_height of the current and the origin tile.

Cheers,
pm

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Wed Feb 13, 2019 8:53 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Feb 14, 2015 12:44 am
Posts: 2858
Location: Newcastle, Australia
planetmaker wrote:
I guess you have to add to the location_check a comparison between the tiles and an arbitrary tile, preferentially with (0,0) the origin of the industry layout, or maybe in the tiles' tile_check callbacks, comparing nearby_tile_height of the current and the origin tile.


I copied some of the code from FIRS 1.4.3 with the Industry called Stockyard as it is it 2 sections like I been doing.

Code:
switch(FEAT_INDUSTRYTILES, SELF, stockyard_nearby_industry, (nearby_tile_class( 1, 1) == TILE_CLASS_INDUSTRY) | (nearby_tile_class( 1, 0) == TILE_CLASS_INDUSTRY) | (nearby_tile_class( 1, -1) == TILE_CLASS_INDUSTRY) | (nearby_tile_class( 0, -1) == TILE_CLASS_INDUSTRY) | (nearby_tile_class(-1, -1) == TILE_CLASS_INDUSTRY) | (nearby_tile_class(-1, 0) == TILE_CLASS_INDUSTRY) | (nearby_tile_class(-1, 1) == TILE_CLASS_INDUSTRY) | (nearby_tile_class( 0, 1) == TILE_CLASS_INDUSTRY)) { 1: return CB_RESULT_LOCATION_DISALLOW; return CB_RESULT_LOCATION_ALLOW; }
switch (FEAT_INDUSTRYTILES, PARENT, stockyard_player_check, ( (((extra_callback_info2 & 0xFF00) >> 8) == IND_CREATION_FUND) || (((extra_callback_info2 & 0xFF00) >> 8) == IND_CREATION_PROSPECT) ) ) { 1: return CB_RESULT_LOCATION_ALLOW; stockyard_nearby_industry; }
switch (FEAT_INDUSTRYTILES, SELF, stockyard_location_check, nearby_tile_slope(0,0) == SLOPE_FLAT) { 1: stockyard_player_check; return CB_RESULT_LOCATION_DISALLOW; }


and also have

Code:
 land_shape_flags: bitmask(LSF_ONLY_ON_FLAT_LAND);


In game settings under Environment/Industries. If set "Flat area around industries: 2 tiles" seems to fix the problem.

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: Wed Feb 13, 2019 9:30 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1644
Location: The Netherlands
Quote:
In game settings under Environment/Industries. If set "Flat area around industries: 2 tiles" seems to fix the problem.

Not a fix, in this case just a work-around for your issue…
Enabling this setting just prevents industries being built in too hilly areas. (thus you wont need too much landscaping to place rails/roads, thus easier gameplay ;-) ).

_________________
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: Wed Feb 13, 2019 9:42 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Feb 14, 2015 12:44 am
Posts: 2858
Location: Newcastle, Australia
Quast65 wrote:
Not a fix, in this case just a work-around for your issue…


If I make some the Industries with the overlaps, might be a good idea if I include a message to tell players to change that setting to 2 Tiles to help prevent the problem.

For Industries that I make with 2 roads or 2 tracks, I will pace these along the NE and NW edges so players can bulldoze the slope easy.

_________________
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: Wed Feb 13, 2019 9:56 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9178
Location: Sol d
GarryG wrote:
Quast65 wrote:
Not a fix, in this case just a work-around for your issue…


If I make some the Industries with the overlaps, might be a good idea if I include a message to tell players to change that setting to 2 Tiles to help prevent the problem.

For Industries that I make with 2 roads or 2 tracks, I will pace these along the NE and NW edges so players can bulldoze the slope easy.


Honestly, that is a terrible solution. Save yourself and players pain: Don't tell players that your set requires a certain setting when you can use a proper location check to not require doing so. Players will not read that anyway ;) And you won't have to answer support requests you can easily avoid.

What you copied from FIRS does absolutely nothing to solve or tackle the problem you describe. FIRS doesn't try to draw over the tiles between and thus doesn't care about height level differences. You should really look at what it checks. And what you want to check. Probably something like
Code:
nearby_tile_height(0,0) == nearby_tile_height(3,2)
with appropriate offsets would do the trick. Or
Code:
nearby_tile_slope(-1,0) ==  SLOPE_FLAT
for some tiles with appropriate offsets to check the tiles in between:

The land under the industry being flat is required (you check that) - but that is not sufficient.
Additionally you either need to require to be no slopes on certain tiles adjacent of your industry.
Or you need to require additionally identical height for at least two tiles in the disjunct parts of your industry.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Wed Feb 13, 2019 10:07 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Feb 14, 2015 12:44 am
Posts: 2858
Location: Newcastle, Australia
planetmaker wrote:
The land under the industry being flat is required (you check that) - but that is not sufficient.
You either need to require to be no slopes on certain tiles adjacent of your industry.
Or you need to require identical height for at least two tiles in the disjunct parts of your industry.


Next question how do I do that? :D

I tried to understand the NML Tutorial but just doesn't register in this brain of mine. :roll:

_________________
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: Wed Feb 13, 2019 10:20 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9178
Location: Sol d
I don't know you industry layout.

Play around with modifying the switch which governs the location_check callback of the industry or the tile_check of the industry tile - that's the lowest most one you quote from FIRS.

Make sure you use different tile types for the disjunct parts of your industry. Then the industry tile location check can check for tiles at a given offset being of a certain property.

E.g. assume for the Southern part of the industry to be of a tile type which checks the tiles North of it being flat:
Code:
switch(FEAT_INDUSTRYTILES, SELF, my_industrytile_location_check, nearby_tile_slope(-1,0) == SLOPE_FLAT) {
    1: return CB_RESULT_LOCATION_ALLOW;
    return CB_RESULT_LOCATION_DISALLOW;
}

(...)
    tile_check: my_industrytile_location_check;
(...)


EDIT:
You can simply combine different conditions by either calling subsequent switches (instead of allow). Or you can also combine simple tests in the actual check. FIRS uses both to make quite a lot of checks in the part you quoted - but not for slopes or height. Just for tile types, etc..

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Wed Feb 13, 2019 10:28 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Feb 14, 2015 12:44 am
Posts: 2858
Location: Newcastle, Australia
Thank you kindly ..

I about to go catch a bus to town as have a few medical appointments and to be tortured (visit Physio). Will give this a try when I get home.

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: Thu Feb 14, 2019 9:28 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Feb 14, 2015 12:44 am
Posts: 2858
Location: Newcastle, Australia
planetmaker wrote:
Play around with modifying the switch which governs the location_check callback of the industry or the tile_check of the industry tile - that's the lowest most one you quote from FIRS.


Been fiddling around with what you suggested.

Looks like on the right track.

Just the W corners some times is up a level like in this pic.
Attachment:
Slope W corners-1.png
Slope W corners-1.png [ 25.95 KiB | Viewed 443 times ]

I using this code:

Code:
switch (FEAT_INDUSTRYTILES, SELF, CoalMine_tile_height_check, nearby_tile_height(0,0) == nearby_tile_height(2,2)) { 1: CoalMine_player_check; return CB_RESULT_LOCATION_DISALLOW; }
switch (FEAT_INDUSTRYTILES, SELF, CoalMine_location_check, nearby_tile_slope(-1,0) == SLOPE_FLAT) { 1: CoalMine_tile_height_check; return CB_RESULT_LOCATION_DISALLOW; }

  tile_check: CoalMine_tile_height_check;


I tried nearby_tile_height(3,2) and nearby_tile_height(2,2) but these seem to make no difference.

But I intend to keep seeing if I can work it out .. so don't tell me where I going wyong just yet :D

One funny thing has come from this strange idea of mine with the overlaps. Having the Overlap along the north-west and north-east slopes has another problem. They overlap rivers and other Industries and buildings in towns. :D

I keep trying for awhile and see if this is worth continuing on with it.

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: Fri Feb 15, 2019 5:29 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Feb 14, 2015 12:44 am
Posts: 2858
Location: Newcastle, Australia
Touch wood .. I think I might have won with the slope problem. I loaded game several times and no Overlap Industries was on any slopes except those with the overlap along the north-west and north-east edges. In some places the overlap was on a slope, or over top of other buildings.

So I will change those Industries so that the over laps go through the middle.

One other problem .. they must have had a lot of rain near this coal mine as they have water running through the middle.
Just hope the miners escaped.
Attachment:
Flooding-5.png
Flooding-5.png [ 78.64 KiB | Viewed 330 times ]


I been playing around with the graphics to see how I could make some industries.

As long as I have ground tiles in the southern section like in these images the RVs and trains enter the overlaps as if they are part of the Industry.
Attachment:
Overlaps in Middle-1.png
Overlaps in Middle-1.png [ 30.4 KiB | Viewed 330 times ]

Attachment:
Overlaps in Middle-2.png
Overlaps in Middle-2.png [ 22.58 KiB | Viewed 330 times ]


Shall see what else I can do.

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: Tue Feb 19, 2019 3:53 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Feb 14, 2015 12:44 am
Posts: 2858
Location: Newcastle, Australia
Haven't did much to the Industry set for several days because of personal things in the way.

I done 3 Industries with the overlaps.

The Cold Storage.
Attachment:
Cold Storage.png
Cold Storage.png [ 29.03 KiB | Viewed 225 times ]

Distribution Centre.
Attachment:
Distribution Center-3.png
Distribution Center-3.png [ 75.25 KiB | Viewed 225 times ]

And a Coal Mine. (One of the smokes is just a bit out of alignment )
Attachment:
Coal Mine-2.png
Coal Mine-2.png [ 303.31 KiB | Viewed 225 times ]


I think the coal mine can be improved. as the ground is to neat. Maybe I'll put some fake rust rail tracks on it. Also not sure if have the rusty roof or a cleaner roof.

I'll be busy most of this week and not get much time to do much to this project or any others. But see how things go.

_________________
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 Feb 23, 2019 10:42 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Feb 14, 2015 12:44 am
Posts: 2858
Location: Newcastle, Australia
Hi all,

Just to let you know ALL my projects are on hold for a while due to health issues that making it hard for me to sit at computer and do any of this work.

Not sure how long I be out of action.

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 Feb 23, 2019 11:01 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 31, 2007 2:23 pm
Posts: 4795
Location: Lost in Music
Sorry to hear that GarryG :(

I do enjoy your posts ;)

_________________
FIRS Industry Replacement Set (Released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (Finished)
Squid Ate FISH (ships) (Released) | CHIPS Has Improved Players' Stations (Finished)
Iron Horse (trains, released) | Termite (tracks for Iron Horse, released) | Busy Bee (game script, released)

Road Hog (road vehicles, released)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 713 posts ]  Go to page Previous 132 33 34 35 36

All times are UTC


Who is online

Users browsing this forum: No registered users and 9 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.