Page 1 of 11

Patch: Found a town

Posted: 19 Apr 2007 13:06
by TheJosh
This patch allows you you to found a town.

This patch is now complete. If there are any issues, tell me. If you want features, ask

The fund a town option is available in the 'town directory' menu
The price is about $14.5 million dollars at the start of the game

Checked against nightly 10587.
This patch will bump your savegame. (v72)

Version History:
v13 - brought to r10587
v12 - brought to r10198
v11 - brought to 9961
v10 - brought to 9899
v9.1 - rooted from / not src/ (will now work in BuildOTTD)
v9 - brought to latest revision
v8 - Changed price, brought to latest revision
v7 - Updated to latest revision
v6 - Changed the way prices are handled
v5 - Code cleanup
v4 - Fixed inflation bug, added config option
v3 - Networking should work now. Changed menu option to be 'Found a town'
v2 - FundTown now has a price that inflates, etc.
v1 - Original

Known Issues:
None

Posted: 19 Apr 2007 14:20
by xmart2k
cool,you rock

Posted: 19 Apr 2007 14:37
by Digitalfox
Nice one :D

But one i miss A LOT also is funding banks :cry:

Posted: 19 Apr 2007 17:32
by Born Acorn
Wouldn't it be "Found" a town? Several towns in the US have been founded by the railways, as the workers had to sleep somewhere. :p

Posted: 20 Apr 2007 04:05
by Dopefish_lives
heh thanks for making my idea into practice!!

Found

Posted: 20 Apr 2007 09:04
by SuperVGA
Yup, i agree with Born Acorn.
Thejosh could the option go like "Found new town"
That'd be a little more realistic than a city,
based on a project donation alone. :)

Posted: 20 Apr 2007 10:52
by Dopefish_lives
sorry i dont mean to be rude, but how do install that patch? i google searched, i searched in the openntd readme, i even looked in the forum, but i still dont get it.

this line:

Code: Select all

patch -p0 -i new_patch.diff
what do i have to do with it?

Posted: 20 Apr 2007 15:29
by DaleStan
You type at a console (command prompt).

Posted: 20 Apr 2007 21:30
by TheJosh
Install Instructions:

Linux/Unix:
- Use SVN to get the latest source from svn://svn.openttd.com/trunk i think
- Go into the directory svn just created (cd trunk)
- I usually compile first to see its all alright (make)
- Look at the patch you are going to apply. If the first line contains src/ then your patch is src rooted. In that case, you need to be in the src directory (cd src)
- Apply the patch (patch -p0 -i <filename>)
- If it fails, use svn revert to clean up the mess and inform the developers
- if you are in the src directory, get out of it (cd ..)
- build again (make)
- test (bin/openttd)
- play for hours/days

Windows:
I do not use windows so I cant help much here, although you will need:
- a windows compiler (gcc? try this link http://sourceforge.net/projects/gcw/)
- windows make (Try this one http://www.steve.org.uk/Software/make/)
- windows svn (http://subversion.tigris.org/project_packages.html near the bottom)
- windows patch (http://gnuwin32.sourceforge.net/packages/patch.htm)
I dont know of the availability of these things, Sorry. The other alternative is to just install linux. You could put, say 10gig aside, buy another hard drive, or just go all out and wipe the whole thing. I recommend Ubuntu for beginners, I hear it is very easy to use.

Posted: 20 Apr 2007 23:42
by athanasios
Cool patch, but a small objection: OTTD already creates so many towns, so why the need for funding more? OK. In such a setting it might be useless but when playing with non random scenarios with a few towns it will be great. Thanks man, I always needed that, hope it goes into the trunk.

Request: Since you are good on patching, could you create a patch for adding companies in scenario editor when creating a new scenario, a capability that is missing in OTTD but existed somehow in TTD?

Posted: 23 Apr 2007 06:23
by peter1138
athanasios wrote:Cool patch, but a small objection:
Well there's nothing forcing you to use it...

But unfortunately CmdBuildTown() is not multiplayer safe :o

Posted: 23 Apr 2007 12:15
by JamieLei
if amount of towns is set to low it can be difficult to set up a passenger network. also i suggest that it be expensive to found a town, eg: say £20 millon / 40million euros

Posted: 23 Apr 2007 14:03
by matrixs
maybe just make found_town.exe and undo_found_town.exe it would be more easier to other people (newbies) to test your beautiful work???

Posted: 23 Apr 2007 15:34
by Ailure
Expect you can as well post the compiled binaries if you are meddling with... binaries patches. Besides a binary patch would require a specific build and even minor changes can compile a binary file so different it wouldn't be patchable. ;)

Posted: 23 Apr 2007 16:42
by RainierWatcher
athanasios wrote:Request: Since you are good on patching, could you create a patch for adding companies in scenario editor when creating a new scenario, a capability that is missing in OTTD but existed somehow in TTD?
if you mean like the scotland 1956 and Megarail scenarios, then I think they were savegames modified to come up as scenarios. I'm not sure though.

Posted: 23 Apr 2007 17:39
by CMircea
Savegames use the same format as scenarios, just the extension is changed.

Posted: 23 Apr 2007 20:54
by JamieLei
i tried the same trick in OpenTTD, it refuses to open in Scenario Editor. the bug must have been fixed

Posted: 24 Apr 2007 05:02
by athanasios
Really? I tried a long time ago and I got the land without the companies.
peter1138 wrote:
athanasios wrote:Cool patch, but a small objection:
Well there's nothing forcing you to use it...
Did you get into the trouble to read the following sentences of my post, or did you just started typing?

Posted: 24 Apr 2007 06:29
by peter1138
Yes, obviously. You contradicted yourself and then went off-topic.

Posted: 24 Apr 2007 13:07
by TheJosh
Can everyone please note that this patch is still in development.

And don't whatever you do use it it multiplayer. It kills your game (that will be fixed)

I would like to make a special binary, but I could only make a Linux one because I use Linux, not windows. (i might be able to cross-compile a windows one, so ill check it out)

I will probably release another version soon, once I work out how networking works, and cleanup my save game code.

God Bless,
Josh