Increase or remove oil refinary limit over 48 tiles
Moderator: OpenTTD Developers
- NekoMaster
- Tycoon
- Posts: 4001
- Joined: 16 Aug 2008 22:26
- Skype: neko-master
- Location: Oshawa, Ontario, CANADA
Increase or remove oil refinary limit over 48 tiles
OpenTTD Is almost a Full v1.0.0 and yet there still the annoying limit of 48 tiles away from the map edges for oil refineries.
IRL As far as I know, oil refineries are usually near a large source of water (usually oceans or seas)
Anyways, could someone tell me how I would remove that limit (like which file in the source code has the limit) or could someone make a simple patch to fix this
IRL As far as I know, oil refineries are usually near a large source of water (usually oceans or seas)
Anyways, could someone tell me how I would remove that limit (like which file in the source code has the limit) or could someone make a simple patch to fix this


Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Re: Increase or remove oil refinary limit over 48 tiles
This line of code looks like it deals with the limit and returning errors:
http://hg.openttd.org/openttd/trunk.hg/ ... .cpp#l1169
http://hg.openttd.org/openttd/trunk.hg/ ... .cpp#l1169
- NekoMaster
- Tycoon
- Posts: 4001
- Joined: 16 Aug 2008 22:26
- Skype: neko-master
- Location: Oshawa, Ontario, CANADA
Re: Increase or remove oil refinary limit over 48 tiles
Ok, im having A LOT of trouble with this since I know nothing about C\C+
What do I need to change to remove the limit or make it higher?
What do I need to change to remove the limit or make it higher?


Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Re: Increase or remove oil refinary limit over 48 tiles
From what my limited knowledge of coding can determine:NekoMaster wrote:What do I need to change to remove the limit or make it higher?
Code: Select all
if // if xx is true
(DistanceFromEdge(TILE_ADDXY(tile, 1, 1)) // The distrance from the edge (TILE_ADD X+Y)
< _settings_game.game_creation.oil_refinery_limit) // is less that that defined in _settings_game.game_creation....
return CommandCost() // Return the Command Cost
return_cmd_error(STR_ERROR_CAN_ONLY_BE_POSITIONED); // Other wise, find and return STR_ERROR_CAN_ONLY_BE_POSITIONED
}
You'd have to do this many times, as the oil refinery code isn't all in one place: http://hg.openttd.org/openttd/trunk.hg/ ... .cpp#l1183
On another note, you sound like you want someone to just do it for you, without actually trying to understand the code. The developers have lives, they just do this in their free time. Perhaps you should try to invest some of yours to figure it out.
- NekoMaster
- Tycoon
- Posts: 4001
- Joined: 16 Aug 2008 22:26
- Skype: neko-master
- Location: Oshawa, Ontario, CANADA
Re: Increase or remove oil refinary limit over 48 tiles
Ok I got it, I also removed the limitations of some other industries that should be able to build anywhere, like the forest in subarctic and and the water supply in subtropic


Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Re: Increase or remove oil refinary limit over 48 tiles
Could you provide a patch, if at all possible?NekoMaster wrote:Ok I got it, I also removed the limitations of some other industries that should be able to build anywhere, like the forest in subarctic and and the water supply in subtropic
With TortoiseSVN: Right Click -> TortoiseSVN -> Create Patch
Command-line: svn diff > patchfile.diff
- NekoMaster
- Tycoon
- Posts: 4001
- Joined: 16 Aug 2008 22:26
- Skype: neko-master
- Location: Oshawa, Ontario, CANADA
Re: Increase or remove oil refinary limit over 48 tiles
currently when I try to make a patch it wont compile when I patch openttd with it, but when I edit industry_cmd.cpp by hand it works :\petert wrote:Could you provide a patch, if at all possible?NekoMaster wrote:Ok I got it, I also removed the limitations of some other industries that should be able to build anywhere, like the forest in subarctic and and the water supply in subtropic
With TortoiseSVN: Right Click -> TortoiseSVN -> Create Patch
Command-line: svn diff > patchfile.diff
could I just post the modified industry_cmd.cpp?


Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Re: Increase or remove oil refinary limit over 48 tiles
Who says where they should be? There are gameplay reasons for these limitations. [I'm not one of them but] quite some people like these restrictions in arctic and tropic. It's arguable though that the oil refinery limitation got broken by large maps anyway.NekoMaster wrote:Ok I got it, I also removed the limitations of some other industries that should be able to build anywhere, like the forest in subarctic and and the water supply in subtropic
- NekoMaster
- Tycoon
- Posts: 4001
- Joined: 16 Aug 2008 22:26
- Skype: neko-master
- Location: Oshawa, Ontario, CANADA
Re: Increase or remove oil refinary limit over 48 tiles
The problem with having forests only above the snow line is stupid, IRL not all forest's in that climate will grow above the Snow line, after all the Sub-Arctic Climate is suppose to mimic North America, where you can find forests far below the snow line in many places.Roujin wrote:Who says where they should be? There are gameplay reasons for these limitations. [I'm not one of them but] quite some people like these restrictions in arctic and tropic. It's arguable though that the oil refinery limitation got broken by large maps anyway.NekoMaster wrote:Ok I got it, I also removed the limitations of some other industries that should be able to build anywhere, like the forest in subarctic and and the water supply in subtropic
As for the water supply, ground water can happen anywhere, it doesn't have to be just under desert's.


Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Re: Increase or remove oil refinary limit over 48 tiles
It is even less probably to find water on desert.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
- NekoMaster
- Tycoon
- Posts: 4001
- Joined: 16 Aug 2008 22:26
- Skype: neko-master
- Location: Oshawa, Ontario, CANADA
Re: Increase or remove oil refinary limit over 48 tiles
True, now with the patch I made water supplies can be built on tropical grass.Kogut wrote:It is even less probably to find water on desert.
One thing I found is that Oil Refinaries wont spawn on map generation beyond 48 tiles, so you have to build them your self if you need a oil refinary beyond the 48 tile limit


Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Re: Increase or remove oil refinary limit over 48 tiles
Here is the patch for refinery. I followed petert instructions. If you have problem with the patch, I think i can`t help you very much. I don`t know anything about c++.
patch revision 19378
patch revision 19378
- Attachments
-
- patch_refinery.patch
- (832 Bytes) Downloaded 167 times
The rest is confetti!
- NekoMaster
- Tycoon
- Posts: 4001
- Joined: 16 Aug 2008 22:26
- Skype: neko-master
- Location: Oshawa, Ontario, CANADA
Re: Increase or remove oil refinary limit over 48 tiles
Heres my patch, Less Restrictive Industries (Removes placement limits\restrictions for refinaries, forests and water supplies)
- Attachments
-
- LRI_r19375.diff
- (1.13 KiB) Downloaded 153 times


Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Re: Increase or remove oil refinary limit over 48 tiles
Code: Select all
...
+ if (_settings_game.game_creation.landscape == LT_ARCTIC) {}
...
+ if (GetTropicZone(tile) != TROPICZONE_DESERT) {}
The only thing the above code does for the moment is stressing the processor needlessly.
Anyway I think you will have a hard time convincing the devs to include this into trunk.(I wouldn't.)
Maybe the oil refinery limit but not in this form.
If you could make it a configurable setting in advanced setting ...
You should go look here "_settings_game.game_creation.oil_refinery_limit" and change oil_refinery_limit where it is declared if you want to change the max distance from the edge.
Changing the forest and the water supply placement will break something, if not in the code it will remove the reason they have been coded this way, different gameplay strategy for different climates.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Re: Increase or remove oil refinary limit over 48 tiles
Even then it wouldn't be included in trunk. If you want to disable the limits create a simple newgrf that doesn't have those limits. I think that as soon as your newgrf overrides an industry some of the limits are already gone and you have to implement them again in the newgrf if you want them.
Re: Increase or remove oil refinary limit over 48 tiles
Given large map sizes it would make a nice feature to allow oil rigs to be built far from the map edge, but have a requirement to be at least a certain distance away from land...
- NekoMaster
- Tycoon
- Posts: 4001
- Joined: 16 Aug 2008 22:26
- Skype: neko-master
- Location: Oshawa, Ontario, CANADA
Re: Increase or remove oil refinary limit over 48 tiles
What are you talking about, Im tlaking about removing the oil refinery limitsZephyris wrote:Given large map sizes it would make a nice feature to allow oil rigs to be built far from the map edge, but have a requirement to be at least a certain distance away from land...


Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Re: Increase or remove oil refinary limit over 48 tiles
And he was merely suggesting something that has to do with your topic, without opening a new one.NekoMaster wrote:What are you talking about, Im tlaking about removing the oil refinery limits
- NekoMaster
- Tycoon
- Posts: 4001
- Joined: 16 Aug 2008 22:26
- Skype: neko-master
- Location: Oshawa, Ontario, CANADA
Re: Increase or remove oil refinary limit over 48 tiles
What, is there a limit for Oil Rig's too like the limit for Oil Refineries?petert wrote:And he was merely suggesting something that has to do with your topic, without opening a new one.NekoMaster wrote:What are you talking about, Im tlaking about removing the oil refinery limits


Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
- jonty-comp
- Tycoon
- Posts: 2542
- Joined: 22 Oct 2005 16:05
- Location: Chesterfield, England
- Contact:
Re: Increase or remove oil refinary limit over 48 tiles
I think it's more the point that they only need the water in the desert parts, in general tropical rainforest has quite a lot of water anyway.Kogut wrote:It is even less probably to find water on desert.

Who is online
Users browsing this forum: No registered users and 8 guests