Patch to buy an area of land

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
pavel1269
Route Supervisor
Route Supervisor
Posts: 473
Joined: 03 Dec 2006 13:22
Location: Czech Republic
Contact:

Re: Patch to buy an area of land

Post by pavel1269 »

Desolator wrote:Are you sure you applied it on r10220?
no, 11340, thats why i ask for an update. i want to play with this patch so much ;)

chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Re: Patch to buy an area of land

Post by chrissicom »

Maybe there's only a CMD_AUTO too much in the original patch. I have this patch in ChrisIN and it also works with ChrisIN applied to r11340 and newer.

User avatar
pavel1269
Route Supervisor
Route Supervisor
Posts: 473
Joined: 03 Dec 2006 13:22
Location: Czech Republic
Contact:

Re: Patch to buy an area of land

Post by pavel1269 »

Finaly i made it. 8)
Here's that patch, just update, but working :wink:
buy_an_area_r11444.patch

User avatar
pavel1269
Route Supervisor
Route Supervisor
Posts: 473
Joined: 03 Dec 2006 13:22
Location: Czech Republic
Contact:

Re: Patch to buy an area of land

Post by pavel1269 »

I just made an update. I really like this patch and i hope, i am not alone ;)

chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Re: Patch to buy an area of land

Post by chrissicom »

Sorry to revive this old thread, but as I see that this is still not working in trunk an update would be really nice :) it really annoys me to buy every tile with an extra click and I use this a lot in large games to limit city growth to a certain area.

Agent_N
Engineer
Engineer
Posts: 4
Joined: 18 Aug 2008 15:17

Re: Patch to buy an area of land

Post by Agent_N »

I just made an update the the current revision.
Attachments
BuyLandArea_15599.patch
(4.29 KiB) Downloaded 86 times


2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06

Re: Patch to buy an area of land

Post by 2007Alain2007 »

updated to R15821

Is there any one who can fence off the land we are buying ?
Attachments
buy_area_r15821.patch
buy an area of land R15821
(4.29 KiB) Downloaded 95 times
For Community Integrated Version http://code.google.com/p/civopenttd/

User avatar
Pizen
Engineer
Engineer
Posts: 4
Joined: 26 May 2009 05:48

r16447

Post by Pizen »

Updated to r16447.

Supplying two patches; one with DOS CRLF, and one with UNIX LF.
Attachments
buy_area_r16447_dos.patch
(4.28 KiB) Downloaded 78 times
buy_area_r16447_unix.patch
(4.26 KiB) Downloaded 73 times

xZise
Engineer
Engineer
Posts: 57
Joined: 19 Mar 2009 16:52
Location: Bad Schwartau

Re: Patch to buy an area of land

Post by xZise »

Great Idea!

But could you implement to buy only the border of the land instead of buying the complete rectangle? For example if you are pressing ctrl, when you build it?

Sincerely
xZise

Auge
Route Supervisor
Route Supervisor
Posts: 396
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Patch to buy an area of land

Post by Auge »

Hello
xZise wrote: But could you implement to buy only the border of the land instead of buying the complete rectangle? For example if you are pressing ctrl, when you build it?
I think, this is not possible. As an analogy: If you build a diagonal train track you buy the whole tile, not only one side of the tile. If you buy an area of some tiles, tile per tile, you buy every tile with its whole area. In every single case it's the same behaviour.

Tschö, Auge

micomico
Engineer
Engineer
Posts: 18
Joined: 25 Apr 2007 01:19
Location: Portugal

Re: Patch to buy an area of land

Post by micomico »

Auge wrote:
xZise wrote: But could you implement to buy only the border of the land instead of buying the complete rectangle? For example if you are pressing ctrl, when you build it?
I think, this is not possible. As an analogy: If you build a diagonal train track you buy the whole tile, not only one side of the tile. If you buy an area of some tiles, tile per tile, you buy every tile with its whole area. In every single case it's the same behaviour.
I think he meant this
border.png
border.png (2.58 KiB) Viewed 2381 times
instead of this
full.png
full.png (2.54 KiB) Viewed 2381 times
I can see the problem with buying half or part of the tile as you are saying (not sure why anyone would want that), but i don't think it applies here.

Auge
Route Supervisor
Route Supervisor
Posts: 396
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Patch to buy an area of land

Post by Auge »

Hello
micomico wrote:
Auge wrote:
xZise wrote: But could you implement to buy only the border of the land instead of buying the complete rectangle? ...
I think, this is not possible. ...
I think he meant this
border.png
Oh, I see, yes you are right.

Tschö, Auge

xZise
Engineer
Engineer
Posts: 57
Joined: 19 Mar 2009 16:52
Location: Bad Schwartau

Re: Patch to buy an area of land

Post by xZise »

micomico wrote:[...]I think he meant this[...]
Jep I meant this :) Not the border of a tile (did you mean this Auge?) the border of the rectangle. For example if you only want to lock a area for a bigger airport. If you are playing fair (in MP) or without AI (in SP/MP) this is saving much money.

Sincerely
xZise

User avatar
pavel1269
Route Supervisor
Route Supervisor
Posts: 473
Joined: 03 Dec 2006 13:22
Location: Czech Republic
Contact:

Re: Patch to buy an area of land

Post by pavel1269 »

xZise wrote:...If you are playing fair (in MP) ...
Just wondering, but, whats the difference between buying whole 11x10 lot (not sure if this is the size) or just its borders?

xZise
Engineer
Engineer
Posts: 57
Joined: 19 Mar 2009 16:52
Location: Bad Schwartau

Re: Patch to buy an area of land

Post by xZise »

You don't have to pay for the 9x8 tiles in the borders?

Sincerely
xZise

User avatar
pavel1269
Route Supervisor
Route Supervisor
Posts: 473
Joined: 03 Dec 2006 13:22
Location: Czech Republic
Contact:

Re: Patch to buy an area of land

Post by pavel1269 »

I really should read everything twice, especialy with my bad english :-) ... From your sentence, I understood the meaning a bit different way :-) Sry for OT

micomico
Engineer
Engineer
Posts: 18
Joined: 25 Apr 2007 01:19
Location: Portugal

Re: Patch to buy an area of land

Post by micomico »

Hello all,

I conjured up some "buy only borders on ctrl" functionality on this patch.

Enjoy.
Attachments
buy_area_r16521.diff
Patch for rev. 16521
(4.37 KiB) Downloaded 77 times
buy_area_v070.diff
Patch for version 0.7.0
(4.37 KiB) Downloaded 73 times

micomico
Engineer
Engineer
Posts: 18
Joined: 25 Apr 2007 01:19
Location: Portugal

Re: Patch to buy an area of land

Post by micomico »

Hello and sorry for the double post (soon to be triple). I want to keep the previous post, just in case.

I decided there was still something missing in this patch. Although the "buy only border on ctrl" was an excellent idea, what i found missing was "ignore measly tiles that can't be bought in the area".

So i've implemented it. I've tried to change the patch to follow "The coding style" also.

Now it allows fun things like:
Selection with CTRL
Selection with CTRL
selection1.png (35.47 KiB) Viewed 2199 times
(continues on the next post)
Attachments
better_buy_area_v070.diff
Patch for v.0.7.0
(4.82 KiB) Downloaded 71 times
better_buy_area_r16525.diff
Patch for rev. 16525
(4.82 KiB) Downloaded 73 times

micomico
Engineer
Engineer
Posts: 18
Joined: 25 Apr 2007 01:19
Location: Portugal

Re: Patch to buy an area of land

Post by micomico »

(continued)

which gives:
Only the border was bought
Only the border was bought
border.png (35.73 KiB) Viewed 2207 times
and also:
Selection without CTRL
Selection without CTRL
selection2.png (18.1 KiB) Viewed 2206 times
with the nice result:
Only the free tiles were bought
Only the free tiles were bought
full.png (17.3 KiB) Viewed 2207 times
The operation only shows an error when no tile could be bought.

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 6 guests