After starting my work with the Millenium conversion set, I realized that, to give full support to long format introduction dates, the model life value could not be limited to 254 years. I have written a patch that adds a new word sized Action 0 property for all vehicle types called long format model life. This property allows to set model life values between 0 and 5000 (88 13 in little endian byte order). This limit is set to prevent overflows calculating duration phases, and there's no interest for bigger values anyways. Any number greater than 5000 will be treated as 5000. A value of 0xFFFF means that the model never expires. This new property is compatible with all existing sets that use the standard model life property.
The long format model life property has the following property numbers:
Trains: 0x2B
Road vehicles: 0x21
Airplanes: 0x1C
Ships: 0x1C
I am providing a win32 binary in this post. The source code of the patch and two simple GRFs for testing purposes can be found on its Flyspray task [#3044]. In the next posts there are some GRFs that are more interesting to test this patch.
Patch: Long format model life for vehicles
Moderator: OpenTTD Developers
Patch: Long format model life for vehicles
- Attachments
-
- long_format_model_life_win32_r17273.rar
- (2.71 MiB) Downloaded 156 times
Last edited by Terkhen on 25 Aug 2009 07:06, edited 1 time in total.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Patch: Long format model life for vehicles
To test this patch, I am posting a complete version of the Millenium conversion set. Since it needs this patch to work properly, these GRF files are posted here instead of in their thread to prevent confusions.
In this post is a rar file that includes all parts of the MCS (standard trains, road vehicles, ships, planes, bridges and houses) each on its separate file. This is to allow anyone to select what parts of the game they want to be affected by the conversion. A single, complete GRF can be found at the next post. These GRFs accept a parameter that allows to set how many centuries you want to play.
If there's no parameter, a starting date of 1050 will be used. The GRFs scales the introduction dates and model life values to fit in the new time scale. The GRFs and their sources can be found below:
In this post is a rar file that includes all parts of the MCS (standard trains, road vehicles, ships, planes, bridges and houses) each on its separate file. This is to allow anyone to select what parts of the game they want to be affected by the conversion. A single, complete GRF can be found at the next post. These GRFs accept a parameter that allows to set how many centuries you want to play.
Code: Select all
Starting
Date Parameter
1950 1
1850 2
1750 3
1650 4
1550 5
1450 6
1350 7
1250 8
1150 9
1050 10
950 11
850 12
750 13
650 14
550 15
450 16
- Attachments
-
- Millenium_Conversion_Set_v3_nfo_(Modules).rar
- (28.56 KiB) Downloaded 151 times
-
- Millenium_Conversion_Set_v3_grf_(Modules).rar
- (14.01 KiB) Downloaded 165 times
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Patch: Long format model life for vehicles
Finally, here is a single GRF file that implements the complete MCS. This file makes life easier to anyone that wants to use the complete conversion without having to set 6 different GRF files with the same parameter.
As you may know, my aim with this patch and the MCS is to achieve the same goal as the different daylength patches (really long games) but changing OpenTTD source code as little as possible. With the current implementation this is already possible (only for standard vehicles), having the following issues (there may be more):
As you may know, my aim with this patch and the MCS is to achieve the same goal as the different daylength patches (really long games) but changing OpenTTD source code as little as possible. With the current implementation this is already possible (only for standard vehicles), having the following issues (there may be more):
- Euro introduction date can be changed by GRF, but it is not implemented.
- New objects introduction dates can be changed by GRF, but they are not implemented.
- Oil wells can only be built before 1950, and oil rigs can only be built after 1960. These flags can't be changed by GRF, but variable limits could be coded with a callback. This is not implemented.
- Inflation still maxes out 170 years after game starts.
- Airport introduction dates can't be changed by GRF. Planes are still converted in the MCS.
- Attachments
-
- Millenium_Conversion_Set_v3.nfo
- (536.44 KiB) Downloaded 186 times
-
- Millenium_Conversion_Set_v3.grf
- (77.05 KiB) Downloaded 165 times
Last edited by Terkhen on 29 Aug 2009 07:39, edited 1 time in total.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Patch: Long format model life for vehicles
You can use a callback to set a custom date instead of using the industry flags.Terkhen wrote:Oil wells can only be built before 1950, and oil rigs can only be built after 1960. These values can't be changed by GRF...
Re: Patch: Long format model life for vehicles
Thanks, I have edited the issue.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Patch: Long format model life for vehicles
Good idea. I suggest to use 0x22 for the callback ID.FooBar wrote:You can use a callback to set a custom date instead of using the industry flags.Terkhen wrote:Oil wells can only be built before 1950, and oil rigs can only be built after 1960. These values can't be changed by GRF...

⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Who is online
Users browsing this forum: No registered users and 13 guests