[TUTORIAL] Creating an addon (I): Introduction September 06, 2009, 06:10:30 pm Author: IgorTektonTranslation: VilvohAspect: developmentLevel: averageSummary: Introduction to the process of creating an addonNote: If you're going to use this content, please mention the author of the content or place a link to the original source where you get this content.1. IntroductionThis tutorial is the first part of a series of four that will show you how to create an addon on pak format. This one is short but it's focused on the stuff you need to start creating an addons.2. Choosing the right toolsFor creating an addon, you need at least three kinds of programs:Image Editor: it's necessary to make the png images of vehicles, tracks o any other object from the game. We recommend you to use GIMP, Paint.net, MS Paint, Photoshop or PaintShop Pro. The images must be saved in png format. Text editor: it will be necessary to create the dat files. A dat file is just a text file saved with dat file extension, that containts simple instructions to help Simutrans to recreate the object on the scenario from the images and the attributes. We recommend you to use Notepad, Notepad++, PSPad or Vim.Makeobj: this program will merge the png images with the attributes contained in the dat file, in order to create a file in pak format, that will be used by the game to represent the object. This time there's no alternative but don't worry, this program has been developed by the Simutrans developers. 3. A quick overview of the addon's creation process.3.1. What does a pak file contain?The pak file simply hosts the information from two different files:An file of images in PNG format: it's the visual representation that will be used by the game engine to represent the object inside the game.A text file in dat format: it's a small file that contains the attributes and instructions that define the object and its behaviour inside the game. Otherwise, how is Simutrans engine going to know who's who?Above, you can see a screenshot that shows part of a dat file on the left side and the png file that contains several views of a highway.3.2. The process, step by stepThis is a brief summary of the process. Each step will be explained in deep with an independent tutorial.You must paint the different images of the object using the image editor. The images must be saved in PNG format.You must create and write the DAT file, using the png images as reference. You may need to include several extra attributes depending on the type of object you want to create. Now you have the PNG and DAT files, you need to merge them in a pak file using Makeobj Quote Selected Last Edit: September 09, 2009, 05:53:06 pm by vilvoh
Re: [TUTORIAL] Creating an addon (I): Introduction Reply #1 – September 06, 2009, 06:18:41 pm This was not translated! Quote from: vilvoh – on September 06, 2009, 06:10:30 pm3.1. What does a pak file contain?Um arquivo pak nada mais é que uma junção de dois arquivos: Quote Selected
Re: [TUTORIAL] Creating an addon (I): Introduction Reply #2 – September 06, 2009, 06:29:16 pm Opsss!! don't blame me.. it's copy-and-paste fault! Quote Selected
Re: [TUTORIAL] Creating an addon (I): Introduction Reply #3 – September 06, 2009, 06:32:51 pm Quote Selected
Re: [TUTORIAL] Creating an addon (I): Introduction Reply #4 – November 14, 2009, 05:35:59 pm Where can I find a FULL and TRUE list of parameters and its values in the .dat files? For instance, the FREIGHT parameter - the general, multifreight values, elsewehere claimed to be named CATEGORY_01 through CATEGORY_06, actually make the game crash. Quote Selected
Re: [TUTORIAL] Creating an addon (I): Introduction Reply #5 – November 14, 2009, 05:38:35 pm It depends on the pakset. The best solution is to call the freight= parameter as the name of the correct type of good as defined in the goods.*.pak file(s).e.g. in pak128.Britain "meat" is a cooled good, so vehicles for transporting cooled goods have "freight=meat" set in the dat file. Quote Selected
Re: [TUTORIAL] Creating an addon (I): Introduction Reply #6 – November 14, 2009, 06:00:05 pm Quote from: leski – on November 14, 2009, 05:35:59 pmWhere can I find a FULL and TRUE list of parameters and its values in the .dat files?I calculate that there're more than 50 parameters and the double or more possible values, so right now it's quite difficult to gather all. Only some of them are common to all types of objects, the rest depends on the object you want to create.You've a short summary at http://simutrans-germany.com/wiki/wiki/tiki-index.php?page=de_dat-Dateien&bl=yQuote from: leski – on November 14, 2009, 05:35:59 pmFor instance, the FREIGHT parameter - the general, multifreight values, elsewehere claimed to be named CATEGORY_01 through CATEGORY_06, actually make the game crash.The wiki page with all possible values of freight parameter for the different paksets is this one: http://simutrans-germany.com/wiki/wiki/tiki-index.php?page=de_dat-Dateien&bl=y Quote Selected
Re: [TUTORIAL] Creating an addon (I): Introduction Reply #7 – November 14, 2009, 08:13:45 pm Quote from: The Hood – on November 14, 2009, 05:38:35 pmIt depends on the pakset. The best solution is to call the freight= parameter as the name of the correct type of good as defined in the goods.*.pak file(s).Well, I'm solely using pak64, still hardly running on my Athlon 1100 with DDR I 267 MHz RAM... But, it's not what I'm looking for. I'll be more precise in the next message Quote from: vilvoh – on November 14, 2009, 06:00:05 pmI calculate that there're more than 50 parameters and the double or more possible values, so right now it's quite difficult to gather all.Still should be possible Do U mean the only way is to examine the game source files?Quote from: vilvoh – on November 14, 2009, 06:00:05 pmOnly some of them are common to all types of objects, the rest depends on the object you want to create.Well, I mean vehicles Quote from: vilvoh – on November 14, 2009, 06:00:05 pmYou've a short summary at http://simutrans-germany.com/wiki/wiki/tiki-index.php?page=de_dat-Dateien&bl=yIt's still not what I need. The following page: http://en.wiki.simutrans.com/index.php/Freight_category lists, for instance, books, ink, chemicals, medicines, furniture etc. as belonging to one category - "Boxed goods". In the game, there obviously are rail cars capable of transporting any good belonging to this category. The question is, how to define the FREIGHT value in the vehicle's dat file so as to achieve this goal? Supposedly I should use the "Internal name", but CATEGORY_01 crashes the game. Should I try German KATEGORIE_01? Quote Selected Last Edit: November 14, 2009, 08:26:20 pm by IgorTekton
Re: [TUTORIAL] Creating an addon (I): Introduction Reply #8 – November 14, 2009, 09:44:15 pm No, you simply have to use one specific good that is part of the category you want, and all other goods from this category will be enabled to load as well. That's the only way it works. Quote Selected
Re: [TUTORIAL] Creating an addon (I): Introduction Reply #9 – November 15, 2009, 01:21:09 am Quote from: DirrrtyDirk – on November 14, 2009, 09:44:15 pmNo, you simply have to use one specific good that is part of the category you want, and all other goods from this category will be enabled to load as well. That's the only way it works.Well, I wouldn't guess Thanks, it works... Quote Selected