Municipal(Town Owned) Airports
Moderator: OpenTTD Developers
Municipal(Town Owned) Airports
Hi All,
Ok here goes...
I come from a delphi background and Im a pretty amateur programmer anyway, however using C++ for dummies and a bit of a crumby laptop Ive made a patch (hooray)
This is what it does...
(1.) as of 1990 every month find a town with a population of at least 15000
and find a nice flat non player owned area.
(2.) build an international airport and make the town the owner.
(3.) report in the news that a municipal airport has been built
(4.) allow any 5 planes of a user to use the airport
(5.) tax any plane that is dropping off or picking up cargo approximatly 20% of the income for that journey.
(6.) tax any plane that is serviced at a public hanger 20% of its value
(7.)prevents players from stopping there planes in a public airport for fairness
(8.) destroy all town owned airports and cover the bald spot if the patch is disabled during a game (at the end of the month)
i think thats about it.
Known Bug(s):-
(1.) cannot add goto hanger order on any airport (i think this is unrelated to me because its the same in a clean svn checkout).
So please guys, try it out, see what you think, post bug reports and pass on suggestions.
[EDIT] ps in my opinion this would probably do better if it was merged with CobraA1's aircraft queueing patch because as im sure you can imagine, 8 players sending 5 planes each to one airport, some of them aint gonna land.
Ok here goes...
I come from a delphi background and Im a pretty amateur programmer anyway, however using C++ for dummies and a bit of a crumby laptop Ive made a patch (hooray)
This is what it does...
(1.) as of 1990 every month find a town with a population of at least 15000
and find a nice flat non player owned area.
(2.) build an international airport and make the town the owner.
(3.) report in the news that a municipal airport has been built
(4.) allow any 5 planes of a user to use the airport
(5.) tax any plane that is dropping off or picking up cargo approximatly 20% of the income for that journey.
(6.) tax any plane that is serviced at a public hanger 20% of its value
(7.)prevents players from stopping there planes in a public airport for fairness
(8.) destroy all town owned airports and cover the bald spot if the patch is disabled during a game (at the end of the month)
i think thats about it.
Known Bug(s):-
(1.) cannot add goto hanger order on any airport (i think this is unrelated to me because its the same in a clean svn checkout).
So please guys, try it out, see what you think, post bug reports and pass on suggestions.
[EDIT] ps in my opinion this would probably do better if it was merged with CobraA1's aircraft queueing patch because as im sure you can imagine, 8 players sending 5 planes each to one airport, some of them aint gonna land.
- Attachments
-
- m_airport.diff
- against r3066
- (51.27 KiB) Downloaded 636 times
-
- m_airport.zip
- for those without a compiler
- (455.96 KiB) Downloaded 746 times
Last edited by JimboTG on 20 Oct 2005 07:30, edited 18 times in total.
I cant put a signature here, I dropped my pen
- Born Acorn
- Tycoon
- Posts: 7597
- Joined: 10 Dec 2002 20:36
- Skype: bornacorn
- Location: Wrexham, Wales
- Contact:
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
Re: Municipal Airports
sounds good. but maybe this percentage should be set by a patch option, like in the subsidiaries patch.JimboTG wrote: 4) tax any plane that is dropping off or picking up cargo approximatly 20% of the income for that journey.
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
Re: Municipal Airports
thanks for the input, the reason i set the percentage so high is that i didnt want to make it to easy. Bear in mind that if possible the airport will be built slap bang in the centre of the town and passenger/mail generation is extraordinarily high (even with 80 planes servicing it!) hence forth without even trying you can fill a boeing 747 every time it lands there. however will give it a bashbobingabout wrote: maybe this percentage should be set by a patch option, like in the subsidiaries patch.

I cant put a signature here, I dropped my pen
-
- Traffic Manager
- Posts: 175
- Joined: 19 Jan 2004 17:25
- Location: kotka or Savitaipale, Finland
- Contact:
This patch sounds really good. I think there could same kind of system for bus stations as well, but without cargo pickup tax. This is the way how bus stations actually work in reality here. They are built by city, not bus companies. That would give to busses a small advantage over trains, because you don't need to destroy half of the downtown to get your station built.
P.S. JimboTG: I am coming with Delphi background as well and afaik there's at least two others here.
P.S. JimboTG: I am coming with Delphi background as well and afaik there's at least two others here.

-
- Traffic Manager
- Posts: 175
- Joined: 19 Jan 2004 17:25
- Location: kotka or Savitaipale, Finland
- Contact:
sure thing. It's better have one fully working feature instead of two that work when moon and stars are in correct position.JimboTG wrote:i think the system could easily be converted for bus's, maybe even combining the two, however i wanna get the bugs out first before i introduce a whole bundle more of them.

got an update,
The setting "Towns can build municipal airport" is remembered and set to on by default,
you can change the tax rate in the openttd.cfg file (kind of a compromise) under value municipal_airports_tax, the default is 20
also just did a bit of code tidying, there are some things that are a bit messy.
Have fun
The setting "Towns can build municipal airport" is remembered and set to on by default,
you can change the tax rate in the openttd.cfg file (kind of a compromise) under value municipal_airports_tax, the default is 20
also just did a bit of code tidying, there are some things that are a bit messy.
Have fun
I cant put a signature here, I dropped my pen
either ive written a truly brilliant patch with absoloutly no bugs or errors (laughable) or no one is trying it out, c'mon guys make it crash or do something strange I know you've all got it in you
anyway its totally been rewritten to make it a little more efficient and Ive added a news item so you will be informed when a new airport is built.
Im eagerly awaiting any comments... get typing!
find the latest version in the first post.

anyway its totally been rewritten to make it a little more efficient and Ive added a news item so you will be informed when a new airport is built.
Im eagerly awaiting any comments... get typing!
find the latest version in the first post.
I cant put a signature here, I dropped my pen
Hmm I've seen the diff file and seems your differ compared all files, even these unchanged.
Also I think you're patch is that universal so one can use it for docks, train stations and bus stations.
Please take a look at http://wiki.openttd.com/index.php/New_AI_/_Airport for more tips on future-AI-building airports
Great job, I'd like o see it in trunk or at least Integrated nightly.
Also I think you're patch is that universal so one can use it for docks, train stations and bus stations.
Please take a look at http://wiki.openttd.com/index.php/New_AI_/_Airport for more tips on future-AI-building airports
Great job, I'd like o see it in trunk or at least Integrated nightly.
- Born Acorn
- Tycoon
- Posts: 7597
- Joined: 10 Dec 2002 20:36
- Skype: bornacorn
- Location: Wrexham, Wales
- Contact:
Well I fast forwarded it and played it for 50 game years from 2000-2050, no crashes.JimboTG wrote:either ive written a truly brilliant patch with absoloutly no bugs or errors (laughable) or no one is trying it out, c'mon guys make it crash or do something strange I know you've all got it in you![]()
anyway its totally been rewritten to make it a little more efficient and Ive added a news item so you will be informed when a new airport is built.
Im eagerly awaiting any comments... get typing!
find the latest version in the first post.
My only prob is that the Airport Sign and box have the dark blue company colour.
- lucaspiller
- Tycoon
- Posts: 1228
- Joined: 18 Apr 2004 20:27
I get a few linker errors with gcc:
Nice idea though. 
Code: Select all
===> Linking openttd
aircraft_cmd.o(.text+0x1f24): In function `AircraftEventHandler_Flying':
: undefined reference to `MA_OwnerHandler'
economy.o(.text+0x21fa): In function `LoadUnloadVehicle':
: undefined reference to `MA_Tax'
economy.o(.text+0x220b): In function `LoadUnloadVehicle':
: undefined reference to `MA_Tax'
order_cmd.o(.text+0xb61): In function `CmdInsertOrder':
: undefined reference to `MA_OwnerHandler'
order_gui.o(.text+0x9dd): In function `OrdersWndProc':
: undefined reference to `MA_OwnerHandler'
town_cmd.o(.text+0x3eb5): In function `TownsMonthlyLoop':
: undefined reference to `MunicipalAirport'
collect2: ld returned 1 exit status
make: *** [openttd] Error 1

No longer active here, but you can still reach me via email: luca[at]stackednotion[dot]com
I noticd that the airport is built right in the middle of the city (covers the name), i havn't had time to play a full game but was wondering if this affects city growth as in this post
Town Growth Problem
As i dont know if this bug was fixed, if it wasnt then this patch may have a detromental effect of town growth.
Town Growth Problem
As i dont know if this bug was fixed, if it wasnt then this patch may have a detromental effect of town growth.
Did you add the new source file (m_airport.c) to the makefile?lucaspiller wrote:I get a few linker errors with gcc:
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
regarding sign color,
i can do it by just setting the owner to OWNER_NONE. however by doing that any player could claim the airport as there own by building any other type of station next to it.
this applies to other things to for example:-
imagine someone likes ships and builds a buoy by the coast to guide there ships, but before they can set the orders another player builds a bus station on the tile next to it, are you with me so far? the buoys sign changes colour and the player who built the bus station owns it, which means that the original or any other player can't use it. I know you could just build another buoy near it and problem solved, but it shouldnt happen.
Ive found the code responsible but im not sure if this a bug or intentional for future features.
so if any devs are monitoring this perhaps they would be so kind as to inform me whats what?
i can do it by just setting the owner to OWNER_NONE. however by doing that any player could claim the airport as there own by building any other type of station next to it.
this applies to other things to for example:-
imagine someone likes ships and builds a buoy by the coast to guide there ships, but before they can set the orders another player builds a bus station on the tile next to it, are you with me so far? the buoys sign changes colour and the player who built the bus station owns it, which means that the original or any other player can't use it. I know you could just build another buoy near it and problem solved, but it shouldnt happen.
Ive found the code responsible but im not sure if this a bug or intentional for future features.

Last edited by JimboTG on 12 Oct 2005 23:18, edited 1 time in total.
I cant put a signature here, I dropped my pen
Wow - very nice patch!
I'll see to it getting included in the next Integrated_nightly build - the OpenTTD build with coolest patches.
BTW - I humbly ask you, DaleStan to review the code and fix possible "weak spots".
EDIT#2
- JimboTG could you possibly add a button to enable/disable the feature (this goes from amateur to amateur
)?
I'll see to it getting included in the next Integrated_nightly build - the OpenTTD build with coolest patches.

BTW - I humbly ask you, DaleStan to review the code and fix possible "weak spots".

EDIT#2


NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
I remember I've made track reconstruction disaster similiar way - the track is being claimed by a nearby town (blue fences) for a moment when bulldozers run around the tile. I was also wondering about the colour, but it's blue...JimboTG wrote:regarding sign color,
i can do it by just setting the owner to OWNER_NONE. however by doing that any player could claim the airport as there own by building any other type of station next to it.
How about an option for scenario editor to spawn the municipial airport? Also how about town action to fund such a airport (like fund new buildings or build statue)?
Who is online
Users browsing this forum: Semrush [Bot] and 20 guests