Howto apply a patch/diff file

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

DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Howto apply a patch/diff file

Post by DaleStan »

technosnorunt58 wrote:Copy <something> to Relece/Debug.
Unless the devs are doing something very exceedingly strange, that folder isn't generated by the compile. We recommend that you copy the data folder somewhere that is generated by the compile.
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
acidboy
Engineer
Engineer
Posts: 3
Joined: 18 Jul 2009 09:33

Re: Howto apply a patch/diff file

Post by acidboy »

ive been trying to add a patch using tortise svn folowed the steps untill i hit a prolem. I found the patch in the brouse window and then hit open and all i got was a load of white boxs help!!! :?:
prob.JPG
prob.JPG (48.67 KiB) Viewed 1261 times
Last edited by acidboy on 20 Jul 2009 10:37, edited 2 times in total.
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: Howto apply a patch/diff file

Post by Terkhen »

You can't show images that are in your hard drive that way, Jez. Upload the file to your post if you want to show us that image.
acidboy
Engineer
Engineer
Posts: 3
Joined: 18 Jul 2009 09:33

Re: Howto apply a patch/diff file

Post by acidboy »

acidboy wrote:ive been trying to add a patch using tortise svn folowed the steps untill i hit a prolem. I found the patch in the brouse window and then hit open and all i got was a load of white boxs help!!! :?:
prob.JPG

can someone help
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Howto apply a patch/diff file

Post by planetmaker »

Jesus, have a BIT of patience. You don't expect in a forum a reply within the hour, do you?

I'm not much familiar with the windows dev tools, but to me it very much looks like you haven't checked out the source code prior to patching... or try to patch a different dir or alike.
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Howto apply a patch/diff file

Post by Roujin »

Are you able to compile the game without applying a patch? You should try to do so first. If it doesn't work, try to fix that first until it compiles successfully. Then you can try applying a patch before compiling again.

If compiling already works - are you sure this is all that's opened? A little list with all files that are altered by the patch should pop up, too. You have to right click in that list and click "Patch all".
Or at least an error message should pop up that something went wrong.
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
PantyraiderZ
Engineer
Engineer
Posts: 32
Joined: 19 May 2007 00:49

Re: Howto apply a patch/diff file

Post by PantyraiderZ »

Alright, I'm stuck.

I'll start from last night/early this morning: I found the moreheightlevels patch to be worthy as my first ever ompiling attempt. So I followed the guide on the first post to the letter and have sucessfully merged the patch using TortoiseSVN.

Now, I'm going the C++ route for compiling, and have set up the parameters (include, Lib's, etc...) correctly, and set the configuration manager for release win32.

And it starts to compile. and at the end of the compiling, I get this:
openttd - 6 error(s), 0 warning(s)
========== Build: 3 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
AND the errors point to:
viewport.cpp
..\src\viewport.cpp(1330) : error C2057: expected constant expression
..\src\viewport.cpp(1330) : error C2466: cannot allocate an array of constant size 0
..\src\viewport.cpp(1330) : error C2133: 'top_row' : unknown size
..\src\viewport.cpp(1332) : error C2057: expected constant expression
..\src\viewport.cpp(1332) : error C2466: cannot allocate an array of constant size 0
..\src\viewport.cpp(1332) : error C2133: 'bottom_row' : unknown size
I'm not illiterate nor am i a buffoon, i have double-checked and triple-checked all the instructions. Everything is correct as I should have a complete build.

So I gave up for the night, and just finished going through the whole process EXACTLY the same as described, and have the EXCACT same results as posted above. No openttd.exe was compiled, just a folder of .obj files under \Release, totalling 136MB... for a game which usually doesn't take more than 15-20MB of space.

I don't know, i feel noobed out on this one, so am kindly requesting assistance from the devs. And please, be gentle with me :/
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Howto apply a patch/diff file

Post by Yexo »

PantyraiderZ: From what you post, it looks like that you might have done everything correct and that the problem is in the moreheightlevels patch. Maybe you can try compiling again without the more height levels patch applied? If that works we can be sure it's the moreheightlevels patch, and the author(s) of that patch should fix it. If compiling OpenTTD without any ptaches does still not work, it's most likely an error on your side, and we'll do our best to figure out how to correct it.
PantyraiderZ
Engineer
Engineer
Posts: 32
Joined: 19 May 2007 00:49

Re: Howto apply a patch/diff file

Post by PantyraiderZ »

Yexo: Exactly what i'm doing ATM. Will update when done.


EDIT: It's the patch. I successfully compiled OpenTTD from the revision the patch was matched to. Oh well, time to see what's going on over at the patch's topic. Much thanks Yexo.
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: Howto apply a patch/diff file

Post by Terkhen »

The more height levels patch don't compile correctly with visual studio / express, but it works with the rest of compilers. Check the patch thread for details.
bdp
Engineer
Engineer
Posts: 3
Joined: 30 Jul 2009 22:30

Re: Howto apply a patch/diff file

Post by bdp »

Thanks to the handy forum search function and the (sometimes misleading and outdated) info at the wiki, I went from "what is source code?" newb to applying patches and compiling my own openttd. Of course it took two days, four different compiling programs, a dozen+ source downloads, and a case of beer to do it.

Or to put it in American terms:

16 hours time = $320
1 Dozen Source Downloads = Free
1 Case Of Beer = $12

Compiling openttd with the patches and features that I want to use = priceless


Now if I can only figure out how to combine the kgat and RCPP patch packs...

bdp's Tip O' The Day#1: If you're using windoze, USE MinGW to compile. Just trust me on this one.
bdp's Tip O' The Day#2 BuildOTTD does not work! There is now way to make it work with current revisions, so do not waste your time. Just trust me on this one.
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: Howto apply a patch/diff file

Post by Terkhen »

What problems you had using Visual C++ 2008 Express?. I switched a few months ago, and besides the longer compiling time I had no problems to compile OpenTTD after following the wiki.
bdp
Engineer
Engineer
Posts: 3
Joined: 30 Jul 2009 22:30

Re: Howto apply a patch/diff file

Post by bdp »

I could probably have made it work using VC++E 2008, but I kept getting weird results. I think the initial setup for MinGW would be much simpler for newbs. But then again, true newbs would be put off by the command lines. You've inspired me to use VC++ again, thanks a lot. :lol:
Last edited by bdp on 04 Aug 2009 16:13, edited 1 time in total.
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Howto apply a patch/diff file

Post by belugas »

I think the case of beer was close to empty when it was time to setup Microsoft Visual ;)
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
bdp
Engineer
Engineer
Posts: 3
Joined: 30 Jul 2009 22:30

Re: Howto apply a patch/diff file

Post by bdp »

I could have started compiling, drove to the store for another case of beer, drove back, and drank half of it before the #$@&* thing was done.

But of course I did do it on my 1.6ghz eeepc 1000he.
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: Howto apply a patch/diff file

Post by Terkhen »

You still need to use the console to apply patches to OpenTTD, unless you want to trust that to TortoiseSVN... I use subversion and gnuwin32 patch. Since subversion uses windows style EOL in some places of the diff file and unix style in others, I have to convert them to windows format before using a diff with gnuwin32 patch.
User avatar
michielh
Engineer
Engineer
Posts: 22
Joined: 29 Apr 2009 13:17
Location: NL

Re: Howto apply a patch/diff file

Post by michielh »

Hi,

I've been trying to compile a version of OTTD with the cargodist and daylength patch, but everytime when I try to compile the file, it gives this error:
c:\documents and settings\****\bureaublad\svn.openttd.org\src\settings_type.h(13) : fatal error C1083: Cannot open include file: 'linkgraph/demand_settings.h': No such file or directory
So it's missing a file, but I can't find that file in the src directory either. I've downloaded and patched the source code with TortoiseSVN.

Does anybody know why I'm missing this file and where I can find it?

Greets,
Michiel

Ps: I'm completely new to coding and compiling, so I'm not really into technical terms etc. To know what I should do I've followed the VC++ tutorial at the wiki, which is quite good actually
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Howto apply a patch/diff file

Post by planetmaker »

Either you patch a version which the patch(es) is (are) not meant for or the patches are faulty. I strongly assume the first option to be the case.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Howto apply a patch/diff file

Post by Rubidium »

michielh wrote:So it's missing a file, but I can't find that file in the src directory either. I've downloaded and patched the source code with TortoiseSVN.
Most likely because the file was missing from the patch that you applied. Try to find a patch that does contain that file.
User avatar
michielh
Engineer
Engineer
Posts: 22
Joined: 29 Apr 2009 13:17
Location: NL

Re: Howto apply a patch/diff file

Post by michielh »

I'm using the r17081 B patch for Cargodist and the r17064 patch for Daylength. Should they be the same revision?
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 15 guests