Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

Several internal format bugs which should be fixed

Started by neroden, January 18, 2012, 10:28:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


First of all, there are a bunch of .dat files which need to have the terminating "----" added, for simutranslator.  This patch fixes *some* of them.
Second, there are two comment fixes you still need to make.  This patch does those.
Third, two files have a terminating "----", but don't have a terminating newline.  This patch tries to add those, but I'm not sure if it will patch correctly, so you should check them by hand:

Fourth, a bunch of .dat files, specifically including the ones in this patch, ended up saved in DOS format.  Please don't do this.  The patch may fix this or it may not.  If you can convert them back to UNIX/Windows format, it would be good.

I will have more patches to fix .dat files later, but this was what I got to before dinner tonight. 

These are all relatively new files.  Please remember the following when adding new .dat files:
(1) Always end a .dat file with (newline) ---- (newline) for the benefit of simutranslator
(2) Always save in Windows/UNIX format (line ending LF), not DOS format (line ending CR LF).

Thank you.

EDIT: patch didn't form correctly, revised patch attached now.  The Makefile in particular needed to be converted back to UNIX format.  I'm not sure which .dat files still need UNIX/DOS line ending fixes, but if you can go through all of them, that would be best.

EDIT: second patch attached to rename the AEC Standard STL to a legal name without spaces.

EDIT: third patch atttached to terminate citycar .dat files correctly for simutranslator

Edit: fourth patch attached to fix the BAC_111_500 .dat file.

There will be more.

Edit: fifth patch to fix .dat files for attractions (apart from the one I fixed in the first patch).

Edit: sixth patch to fix .dat files for boats.  Note that the mersey ferry is being converted back from DOS format to UNIX/Windows format.

Edit: seventh patch to add terminating lines to the .dat files for buses.  Note that one file is converted from DOS format to UNIX/Windows format.

Edit: I'm rethinking this.  There seems to be some subtlety in the rules for when separators are needed.  Of course this is totally undocumented.

The Hood

Great - only I can't get any of these to work. I'm using Tortoise SVN in windows - they just won't show up. Any ideas?


 :o   You do have a way of applying diff files using 'patch' or something similar, I hope?

EDIT: Perhaps if you tell me *exactly* what you're doing I can figure out where it's going wrong.  From what you've said I don't have enough detail to debug.  EDIT: it might be bad arguments to patch... or if TortoiseSVN is driving the patching, it might have bad arguments hidden in the setting somewhere... anyway I need to know exactly what you're doing in order to debug it.

The Hood

I open up TortoiseMerge (which should apply patches) and open the diff file, but instead of seeing the diff file once opened up and being given the option to start merging changes, I just get a blank window...


OK.  Can you open the diff file in a text editor (like WordPad)?  Does it have text? 

If it does have text, then it's a problem with TortoiseMerge, which I don't know very well, but I'll try to figure it out.

If not, it may be an upload problem, in which case I'll try uploading them again.

The Hood

Diff file itself is fine - I can understand it no problem myself. I'm just clueless with TortoiseSVN when it comes to patching...


It might be easier to send complete files instead of diffs, if you have them reasonably separate and didn't touch them lately...

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!


I needed, I can apply these fixes too ... (and vs too btw)

The Hood

You would both be welcome to.  Only a few files have changed recently, it's mostly additions.


Maybe TortoiseMerge is picky about its diff format.  I find this in the manual:


Currently, only patch files in Unified Diff Format are supported. And only files which were generated from a Subversion working copy. Other formats like patch files generated by CVS are currently not supported! "

So that's your problem.  TortoiseMerge won't accept "raw" Unified Diff format patches, it requires SVN annotations for some reason.  This is not so great.  This is the only patch program I've ever heard of which is that picky.  Can you get a copy of 'patch'?

The Hood

Thanks. Got myself a copy of patch - now to try and use it...

EDIT: can't figure out what to stick in the command line in windows - could you help?


open command window (execute 'cmd'), change to the right directory, type

patch -p1 < patchfile
Parsley, sage, rosemary, and maggikraut.