The International Simutrans Forum

Community => Simutrans Help Center => Tutorials => Topic started by: vilvoh on September 06, 2009, 06:10:30 pm

Title: [TUTORIAL] Creating an addon (I): Introduction
Post by: vilvoh on September 06, 2009, 06:10:30 pm
Author: IgorTekton
Translation: Vilvoh
Aspect: development
Level: average
Summary: Introduction to the process of creating an addon

Note: 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. Introduction

This 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 tools

For creating an addon, you need at least three kinds of programs:

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:


(http://www.simutrans.com/images/screenshot10_sm.jpg)

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 step

This is a brief summary of the process. Each step will be explained in deep with an independent tutorial.

Title: Re: [TUTORIAL] Creating an addon (I): Introduction
Post by: edson on September 06, 2009, 06:18:41 pm
This was not translated!  ;)
3.1. What does a pak file contain?
Um arquivo pak nada mais é que uma junção de dois arquivos:
Title: Re: [TUTORIAL] Creating an addon (I): Introduction
Post by: vilvoh on September 06, 2009, 06:29:16 pm
Opsss!! don't blame me.. it's copy-and-paste fault!  :P
Title: Re: [TUTORIAL] Creating an addon (I): Introduction
Post by: edson on September 06, 2009, 06:32:51 pm
(http://a.imagehost.org/0046/2_lol.gif)
Title: Re: [TUTORIAL] Creating an addon (I): Introduction
Post by: leski on 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.
Title: Re: [TUTORIAL] Creating an addon (I): Introduction
Post by: The Hood on 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.
Title: Re: [TUTORIAL] Creating an addon (I): Introduction
Post by: vilvoh on November 14, 2009, 06:00:05 pm
Where 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=y

For 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
Title: Re: [TUTORIAL] Creating an addon (I): Introduction
Post by: leski on November 14, 2009, 08:13:45 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).

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 :)



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.

Still should be possible :) Do U mean the only way is to examine the game source files?

Only some of them are common to all types of objects, the rest depends on the object you want to create.
Well, I mean vehicles :)

You've a short summary at http://simutrans-germany.com/wiki/wiki/tiki-index.php?page=de_dat-Dateien&bl=y

It'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? ;)
Title: Re: [TUTORIAL] Creating an addon (I): Introduction
Post by: DirrrtyDirk on 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.
Title: Re: [TUTORIAL] Creating an addon (I): Introduction
Post by: leski on November 15, 2009, 01:21:09 am
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.

Well, I wouldn't guess :) Thanks, it works...