Author Topic: How to add .dat files without driving me bonkers  (Read 10977 times)

0 Members and 1 Guest are viewing this topic.

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Total likes: 0
  • Helpful: 28
  • Nathanael Nerode
How to add .dat files without driving me bonkers
« on: June 17, 2012, 10:06:08 PM »
This is a suggested sticky.

How to add dat files without driving me bonkers

1. All dat files must end with a line of two or more dashes:
Code: [Select]
--Simutrans doesn't care, but Simutranslator *does*.  This is in addition to the lines of dashes which are used as separators between multiple objects in the same file.

2. Object "name"s should not have spaces in them.  They can have dashes, underscores, and parentheses.  Underscores are preferred over dashes.
Code: [Select]
name=Boeing_747_100(BOAC)
The spaces will be added in the translations.

3. City building objects have to follow a specific name format.
Code: [Select]
XXX_YYYY_LLzzzzwhere XXX is COM, IND, or RES; YYYY is anything, including underscores; zzzz does not contain underscores or numerals; and LL is the 'level', which should be at least 01.  In pak128.Britain the format is stricter, and it will probably become stricter yet in the future as new features are added.  So ask before naming a city building.

4. Line endings.  If you're working with TortoiseSVN or subversion, before you commit any files:
 
 First, find the configuration settings in TortoiseSVN, using these instructions:
 http://www.mediawiki.org/wiki/Subversion/auto-props
 
 Or find the configuration file from the command line for command-line subversion, which is at:
 
Code: [Select]
~/.subversion/config or
 
Code: [Select]
/etc/subversion/config
 In [miscellany] uncomment/add this line:
Code: [Select]
enable-auto-props = yes
 In the [auto-props] section, uncomment the default bits and also add:
 
Code: [Select]
*.dat = svn:eol-style=native
 You only have to do this once.
 
 5. Line endings again!  If you're working with git, before you add any files, set the core.autocrlf option appropriately for whichever system you're on:
 
 Windows:
 
Code: [Select]
git config --global core.autocrlf true Linux/UNIX/Mac:
 
Code: [Select]
git config --global core.autocrlf input
 You only have to do this once.
 
 6. You shouldn't need to touch the Makefile unless you add a new directory.  But if you add a new directory, please either update the Makefile or let me (or someone else who understands Makefiles) update it.

7. Finally, please check your spelling for typos, as mis-spelled names are confusing and hard to remember.  I have recently fixed a "clanlline-steamer.dat" (clan-line-steamer), a "Boeing_747_200_BritishCalendonian.dat", a "name=Cemetry" object, etc.
 
 I think this is everything, though I or someone else may think of more things later.

Offline The Hood

Re: How to add .dat files without driving me bonkers
« Reply #1 on: June 18, 2012, 07:07:56 AM »
Thanks for this. I'm setting it sticky for easy reference for contributers.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14763
  • Total likes: 307
  • Helpful: 143
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How to add .dat files without driving me bonkers
« Reply #2 on: June 22, 2012, 08:55:07 AM »
May I ask - what is the reason that underscores are preferred over dashes? Dashes are what is predominately used in Pak128.Britain.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline The Hood

Re: How to add .dat files without driving me bonkers
« Reply #3 on: August 30, 2012, 05:12:54 PM »
In going through the new railway vehicles I noticed a lot of files did not end in "---" - please can we ensure this as it's quite tedious for me to add them before putting into SVN (and I probably missed some too).

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14763
  • Total likes: 307
  • Helpful: 143
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How to add .dat files without driving me bonkers
« Reply #4 on: August 30, 2012, 05:51:39 PM »
Ohh, I didn't realise that they had to have that at the end - apologies. May I ask - what function does this have?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Moderator
  • *
  • Posts: 2248
  • Total likes: 46
  • Helpful: 90
Re: How to add .dat files without driving me bonkers
« Reply #5 on: August 30, 2012, 06:30:07 PM »
May I ask - what function does this have?
See nerodens comment above:
1. All dat files must end with a line of two or more dashes:
Code: [Select]
--Simutrans doesn't care, but Simutranslator *does*.  This is in addition to the lines of dashes which are used as separators between multiple objects in the same file.
It will be something to do with an assumption the simutranslator code makes.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14763
  • Total likes: 307
  • Helpful: 143
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How to add .dat files without driving me bonkers
« Reply #6 on: August 30, 2012, 07:48:54 PM »
Ahh, interesting. I thought that this was only required between objects in the same file.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline The Hood

Re: How to add .dat files without driving me bonkers
« Reply #7 on: August 30, 2012, 09:16:08 PM »
No, think of it as an end-of-file marker for simutranslator. Makeobj isn't bothered, which is why you probably haven't noticed...

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14763
  • Total likes: 307
  • Helpful: 143
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How to add .dat files without driving me bonkers
« Reply #8 on: August 30, 2012, 09:38:21 PM »
Right. Will add it in future. Thank you for letting me know!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Drewthegreat87

Re: How to add .dat files without driving me bonkers
« Reply #9 on: August 27, 2013, 09:23:29 PM »
Hello!

I've been reading about adding .dat files and the best I can seem to understand is that the program will have to be complied. I've been reading over this thread (http://forum.simutrans.com/index.php?topic=652.0) and I'm curious if this is how you add new items (trains, buildings etc) available on the sourceforge SVN (Examples: Zeppelin/ new Mk 1 carriages etc) to a pakset.

I would like to know if that's the process I need to follow to figure it out. Any help would be greatly appreciated!

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14763
  • Total likes: 307
  • Helpful: 143
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How to add .dat files without driving me bonkers
« Reply #10 on: August 27, 2013, 10:06:52 PM »
What you need to do is (1) obtain the sources (the .dat and .png files); (2) compile them using Makeobj (make sure to use the correct version, depending on whether you are running Standard or Experimental); and (3) add the resulting .pak files to your pakset addons directory.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Drewthegreat87

Re: How to add .dat files without driving me bonkers
« Reply #11 on: August 28, 2013, 02:16:50 AM »
Thanks James! That's exactly what I was looking for and I've gotten it to work! I greatly appreciate your help!

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14763
  • Total likes: 307
  • Helpful: 143
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How to add .dat files without driving me bonkers
« Reply #12 on: August 28, 2013, 09:33:12 AM »
Splendid!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline thunderkiller1996

Re: How to add .dat files without driving me bonkers
« Reply #13 on: February 06, 2015, 06:04:54 AM »
I've been trying to follow the method of adding things to pak128.Britain as described above to add the new DC6B model, but when I try to load the thing in Simutrans it doesn't appear. Any ideas on what I'm doing wrong?
Here's what I punch into makeobj: makeobj pak128 DC6B.pak Douglas_DC6B_BritishEagleAirways.dat

When I do so, it says it's missing data in "Simutrans object file".

Offline Milko

Re: How to add .dat files without driving me bonkers
« Reply #14 on: February 06, 2015, 08:26:33 AM »
Hello

I believe that the problem is this: the files are made to be inserted directly into the pak, if you want to compile them externally, you must do one of two things: 1) create a folder images and put the pictures 2) modify the dat file by removing "./images/"

Giuseppe

Offline thunderkiller1996

Re: How to add .dat files without driving me bonkers
« Reply #15 on: February 06, 2015, 08:37:53 AM »
I tried compiling your DC-3 model instead, and yup I did make a new "images" folder when creating the pakfile, but then it began spitting out error after error. Might have something to do with the version of Simutrans I am using-I'm using the latest version of makeobj and Simutrans.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14763
  • Total likes: 307
  • Helpful: 143
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How to add .dat files without driving me bonkers
« Reply #16 on: February 06, 2015, 09:30:11 AM »
If you are using Makeobj for Simutrans-Standard, this is normal and you should not worry: those extra parameters are intended only for Simutrans-Experimental.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline thunderkiller1996

Re: How to add .dat files without driving me bonkers
« Reply #17 on: February 08, 2015, 04:21:35 AM »
Managed to get the pakfiles into Simutrans, DC-3 mail version works, but passenger planes (i.e. DC-3, Viking) won't work; their vehicle marker in a depot will show up but they cannot be selectable and their graphics don't show up either. Must be something to do with Experimental features.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14763
  • Total likes: 307
  • Helpful: 143
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How to add .dat files without driving me bonkers
« Reply #18 on: February 08, 2015, 09:32:34 AM »
Managed to get the pakfiles into Simutrans, DC-3 mail version works, but passenger planes (i.e. DC-3, Viking) won't work; their vehicle marker in a depot will show up but they cannot be selectable and their graphics don't show up either. Must be something to do with Experimental features.

Can you elaborate a little more about what exactly you are doing? When you say that they are not selectable, what exactly happens when you try?

If you are using Standard Makeobj and the Standard executable, the Experimental .dat lines will simply be ignored and will have no effect other than generating warnings.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline thunderkiller1996

Re: How to add .dat files without driving me bonkers
« Reply #19 on: February 08, 2015, 12:34:42 PM »
Can you elaborate a little more about what exactly you are doing? When you say that they are not selectable, what exactly happens when you try?

If you are using Standard Makeobj and the Standard executable, the Experimental .dat lines will simply be ignored and will have no effect other than generating warnings.
The planes "appear" in the hangar menu-the Mail DC-3 appears OK, but there is no image or model for the DC-3 or DC-3A. When I hover my cursor over the DC-3 or DC-3A, no information comes up about the aircraft, and I cannot select the plane either.

(Ignore the info box at the bottom about a Viscount type)

EDIT 23:44 Sydney time, 8/2/15: I've tried it with the DC-6 too, that doesn't work either.
« Last Edit: February 08, 2015, 12:45:14 PM by thunderkiller1996 »

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14763
  • Total likes: 307
  • Helpful: 143
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How to add .dat files without driving me bonkers
« Reply #20 on: February 08, 2015, 12:50:15 PM »
That looks like a problem with the graphics - are there any graphics related warnings in Makeobj? Have you amended the .dat files at all?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline thunderkiller1996

Re: How to add .dat files without driving me bonkers
« Reply #21 on: February 08, 2015, 01:33:59 PM »
Well makeobj does yell at me about some graphics related stuff and whatnot but I thought it would have been something to do with the livery system.

And nope, I haven't edited the .dat files.

EDIT: Had a look at the dat files... Simutrans must be ignoring the graphics because of all the Experimental-related stuff.

Offline The Hood

Re: How to add .dat files without driving me bonkers
« Reply #22 on: February 08, 2015, 02:54:40 PM »
Experimental supports multiple liveries but standard does not. If an experimental dat has multiple liveries defined standard makeobj will not understand. E.g.

Experimental:

EmptyImage[N][0]=....

Standard

EmptyImage[N]=....

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14763
  • Total likes: 307
  • Helpful: 143
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: How to add .dat files without driving me bonkers
« Reply #23 on: February 08, 2015, 10:49:51 PM »
I don't think that the DC-6 has multiple liveries; I think that only the 707 and the DC-3 at present have multiple liveries.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.