Earlier & Improved (for DB Set XL) Road Vehicles

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

User avatar
Putcha
Engineer
Engineer
Posts: 101
Joined: 02 Apr 2004 09:40
Location: Bratislava, Slovakia, Europe, Earth
Contact:

Earlier & Improved (for DB Set XL) Road Vehicles

Post by Putcha »

I changed capacity of transported cargo for dbsetxl so the RVs are not useless, mainly goods trucks. For example goods truck can now carry 60 goods, because there is wagon that carry 80 goods. I also changed introduce year and speed (see below).

There are 2 versions:
Earlier Road Vehicles v1.0 - changed only introduce year and speed. Download ERV
Improved Road Vehicles (for DB Set XL) v1.0 - changed introduce year, speed and capacities. Download IRV

List of changes:

Code: Select all

Generation of vehicle:           1st   2nd   3rd   4th    
Introduce year for buses are:   1925, 1955, 1985, 2005
Introduce year for trucks are:  1925, 1965, 2005
Speed of buses [kph]            60,   90,   110,  125
Speed of trucks [kph]           50,   90,   110 

capacities:
Buses                           35,   48,   56,   62
Coal                            20,   26,   30
Mail                            20,   26,   30
Oil                             15,   21,   25
Livestock                       15,   21,   25
Goods                           40,   52,   60
Grain                           20,   26,   30
Wood                            15,   19,   22
Iron ore                        20,   26,   30
Steel                           15,   19,   22
Valuables                       10,   14,   17
Food                            15,   21,   25
Paper                           15,   19,   22
Copper ore                      20,   26,   30
Water                           15,   21,   25
Fruit                           15,   21,   25
Rubber                          15,   21,   25
Any Suggestions?




---------------------------------------------------------------------------------------------------------------------------
old msg:
In which program I can change the speed and and capacity of basic road vehicles? Or there are some other road vehicle set besides Georges longvehicle?
Attachments
erv.grf
Earlier Road Vehicles v1.0
(741 Bytes) Downloaded 3331 times
irv.grf
Improved Road Vehicles (for DB Set XL) v1.0
(862 Bytes) Downloaded 4364 times
Last edited by Putcha on 03 May 2009 11:04, edited 5 times in total.
My english isn´t good.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: Vehicle stats...

Post by Zephyris »

No programs are available which alter vehicle stats in OpenTTD, and other than longvehicles there aren't many truck newgrfs around. You may want to try my one I am currently developing (see "generic road vehicles" in the ttdpatch/graphics forum) *shameless advertising*, but you will need to use a nightly version of openttd.
User avatar
Putcha
Engineer
Engineer
Posts: 101
Joined: 02 Apr 2004 09:40
Location: Bratislava, Slovakia, Europe, Earth
Contact:

Re: Vehicle stats...

Post by Putcha »

Zephyris wrote:No programs are available which alter vehicle stats in OpenTTD...

And its possible to extract that original vehicle set, change stats and export it as standalone grf or edit the game grf (i think its trg1r.grf)?
My english isn´t good.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: Vehicle stats...

Post by Zephyris »

Unlike downloaded vehicle sets the game graphics are not newgrfs, but just grfs. The original vehicle stastics are hard coded into the game itself and the grf simply contains the graphics; vehicle statistics cannont be modified by modifying the grf. Downloaded newgrfs do, however, also code for the vehicle statistics.
User avatar
Putcha
Engineer
Engineer
Posts: 101
Joined: 02 Apr 2004 09:40
Location: Bratislava, Slovakia, Europe, Earth
Contact:

Re: Vehicle stats...

Post by Putcha »

OK. Then I will use the old, but they are in "late game" useless with that low capacities...
My english isn´t good.
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: Vehicle stats...

Post by George »

Zephyris wrote:Unlike downloaded vehicle sets the game graphics are not newgrfs, but just grfs. The original vehicle stastics are hard coded into the game itself and the grf simply contains the graphics; vehicle statistics cannont be modified by modifying the grf. Downloaded newgrfs do, however, also code for the vehicle statistics.
You can make a new grf that change stats for default RVs. It will work fine if there are no other RVs sets loaded.
Image Image Image Image
User avatar
Putcha
Engineer
Engineer
Posts: 101
Joined: 02 Apr 2004 09:40
Location: Bratislava, Slovakia, Europe, Earth
Contact:

Re: Vehicle stats...

Post by Putcha »

Heh Im not coder :)
If you can write some tutorial how to change it, I would try it, but i havent any experience.

Thanx anyway.
My english isn´t good.
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: Vehicle stats...

Post by George »

Putcha wrote:Heh Im not coder :)
If you can write some tutorial how to change it, I would try it, but i havent any experience.
http://wiki.ttdpatch.net/tiki-index.php ... phicsSpecs
http://wiki.ttdpatch.net/tiki-index.php ... adVehicles
Image Image Image Image
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: Vehicle stats...

Post by Zephyris »

its supprisingly simple...
User avatar
Putcha
Engineer
Engineer
Posts: 101
Joined: 02 Apr 2004 09:40
Location: Bratislava, Slovakia, Europe, Earth
Contact:

Re: Vehicle stats...

Post by Putcha »

Thanx for quick answer, but look at my sig... :roll:
My english isn´t good.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: Vehicle stats...

Post by Zephyris »

Hopefully this may be some use for you, otherwise you'll just have to wait for someone else to make a suitable grf I'm afraid :(.

Example code for a basic vehicle statistic alteration. Put in a text file, rename to *grfname*.nfo then encode with grfcodec.

Code: Select all

// Automatically generated by GRFCODEC. Do not modify!
// (Info version 7)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel

// Number of sprites in the grf
    0 * 4	 02 00 00 00

// Action 8: Defines DRF details; GRF ID (AA BB CC DD) and name (Simple Vehicle Demos: Changing Vehicle Properties)
    1 * 56	 08 06 AA BB CC DD "Simple Vehicle Demos: Changing Vehicle Properties" 00

//  Action 0: Change vehicle properties; Train 00 speed to 100mph and make double headed
//  Sprite number
//  |   Number of bytes in this sprite
//  |   |        
//  |   |        Action 00: Change vehicle properties
//  |   |        |  Feature 00: Trains
//  |   |        |  |  02 properties: Two properties altered
//  |   |        |  |  |  01 vehicles: On one vehicle
//  |   |        |  |  |  |  Vehicle 00: Trains, so Kirby Paul Tank (Steam)
//  |   |        |  |  |  |  |  Property 09: Maximum speed
//  |   |        |  |  |  |  |  |  Value A0: 100 mph (A0 (Hexadecimal) = 160 (Decimal) = 100 mph * 1.6)
//  |   |        |  |  |  |  |  |  |  Property 13: Double headed?
//  |   |        |  |  |  |  |  |  |  |  Value 01: Double headed (00 = no, 01 = yes)
//  |   |        |  |  |  |  |  |  |  |  |
    2 * 9        00 00 02 01 00 09 A0 13 01

//Thats it!
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: Vehicle stats...

Post by George »

Putcha wrote:Thanx for quick answer, but look at my sig... :roll:
I do not know a good tutorial for learning to read English :roll:
Image Image Image Image
User avatar
Putcha
Engineer
Engineer
Posts: 101
Joined: 02 Apr 2004 09:40
Location: Bratislava, Slovakia, Europe, Earth
Contact:

Re: Vehicle stats...

Post by Putcha »

first attemp - 3 parameters change...
Image

Code: Select all

// Automatically generated by GRFCODEC. Do not modify!
// (Info version 7)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel

// Number of sprites in the grf
    0 * 4    02 00 00 00

// Action 8: Defines DRF details; GRF ID (AA BB CC DD) and name (Test - MPS Regal Bus)
//<sprite-number> * <length> 08 <version> <grf-id> <name> <description>    
    1 * 56    08 06 AA BB CC DD "Test - MPS Regal Bus" 00

//  Action 0: Change vehicle properties; RV 00 speed to 60kph and 100 passengers capacity and introduce year is 1925
//  Sprite number
//  |   Number of bytes in this sprite
//  |   |        
//  |   |        Action 00: Change vehicle properties
//  |   |        |  Feature 01: Road vehicle
//  |   |        |  |  03 properties: Two properties altered
//  |   |        |  |  |  01 vehicles: On one vehicle
//  |   |        |  |  |  |  Vehicle 00: MPS Regal Bus
//  |   |        |  |  |  |  |  Property 08: Speed
//  |   |        |  |  |  |  |  |  Value 78: 60kph...   kph*2 -> hex
//  |   |        |  |  |  |  |  |  |  Property 0F: Capacity
//  |   |        |  |  |  |  |  |  |  |  Value 64: 100 people -> hex
//  |   |        |  |  |  |  |  |  |  |  |  Property 00: date of introduction
//  |   |        |  |  |  |  |  |  |  |  |  |  Value 1925: 1925  -> hex
//  |   |        |  |  |  |  |  |  |  |  |  |  |
//  |   |        |  |  |  |  |  |  |  |  |  |  |
    2 * 9        00 01 03 01 00 08 78 0F 64 00 785

//Thats it!

Now Some questions:
I modified only Action0 and name in action8.
How can i know this:
1.

Code: Select all

 // Number of sprites in the grf
    0 * 4    02 00 00 00
2.

Code: Select all

// Action 8: Defines DRF details; GRF ID (AA BB CC DD) and name (Test - MPS Regal Bus)
//<sprite-number> * <length> 08 <version> <grf-id> <name> <description>    
    1 * 56    08 06 AA BB CC DD "Test - MPS Regal Bus" 00
3.

Code: Select all

    //  Sprite number                          ( 2 )
    //  Number of bytes in this sprite         ( 9 )
4. Its in Action0 ... If i want to change 2 properties for all RV it will be:

02 properties: Two properties altered
X vehicles: On X vehicles

or:

02*X properties: Two * X properties altered
X vehicles: On X vehicles
X - all vehicles

or:

again all Action0 section


After last value i can contiune with Vehicle 01: Hereford Leopard Bus ... or i must something add before new vehicle?
My english isn´t good.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Vehicle stats...

Post by DaleStan »

1&3: Ignore them. NFORenum will fix them for you automatically.

2. Read the docs. Action8 is among the simplest parts of NFO.

4. If you want to change two properties, then report 02 properties. If you want to change not-two properties then report not-02 properties. The number of vehicles is completely unrelated.

5. No. Go reread the Action0 spec. It's quite clear on the required order when setting a property for multiple vehicles.

If you have read the spec, and don't understand it, specify which sentence(s) (at most two or three per page) you don't understand.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
Putcha
Engineer
Engineer
Posts: 101
Joined: 02 Apr 2004 09:40
Location: Bratislava, Slovakia, Europe, Earth
Contact:

Re: Vehicle stats...

Post by Putcha »

OK, i have code. I have 53 sprites in grf and dont know what should be here:

Code: Select all

// Number of sprites in the grf
    0 * 4    02 00 00 00
My english isn´t good.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: Vehicle stats...

Post by Zephyris »

53 (Decimal)
--->
35 (Hexadecimal)
--->
00000035 (Add preceding zeros so there are 8 digits; it is a doubleword/dword/D )
--->
35 00 00 00 (Reorder into little endian)

See:
"2) Add the special first pseudosprite" at http://wiki.ttdpatch.net/tiki-index.php ... rstVehicle
"Byte order" at http://wiki.ttdpatch.net/tiki-index.php ... ght=endian

edit:
Alternatively use NfoRenum (http://www.tt-forums.net/viewtopic.php?t=11711), which automatically renumbers all sprites into order, corrects their byte length and changes the number of sprites in the grf to be correct.

edit (again!):
It should look like this once done:

Code: Select all

// Number of sprites in the grf
    0 * 4    35 00 00 00
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Vehicle stats...

Post by Lakie »

Change the number 0x00000002 to 0x00000035 (53 in hex) which should look something like:

Code: Select all

    0 * 4        35 00 00 00
Quite simple when you get used to it, you can use Window's Calculator to convert the decimal to hexadecimal.
Alternately you could be lazy and jut run DaleStan's Renum over it and that would correct it and the length of sprites, and their sprite numbers. ;)

[Edit] Renum would also give you warnings around code which it considers to be wrong, which may help you...

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
User avatar
Putcha
Engineer
Engineer
Posts: 101
Joined: 02 Apr 2004 09:40
Location: Bratislava, Slovakia, Europe, Earth
Contact:

Re: Vehicle stats...

Post by Putcha »

thanx.
My english isn´t good.
User avatar
Putcha
Engineer
Engineer
Posts: 101
Joined: 02 Apr 2004 09:40
Location: Bratislava, Slovakia, Europe, Earth
Contact:

Re: Vehicle stats...

Post by Putcha »

So here is it.

I change values of cargo for dbsetxl so the RVs are not useless, mainly goods truck.


List of changes:

Code: Select all

Generation of vehicle:           1st   2nd   3rd   4th    
Introduce year for buses are:   1925, 1955, 1985, 2005
Introduce year for trucks are:  1925, 1965, 2005
Speed of buses [kph]            60,   90,   110,  125
Speed of trucks [kph]           50,   90,   110 

capacities:
Buses                           35,   48,   56,   62
Coal                            20,   26,   30
Mail                            20,   26,   30
Oil                             15,   21,   25
Livestock                       15,   21,   25
Goods                           40,   52,   60
Grain                           20,   26,   30
Wood                            15,   19,   22
Iron ore                        20,   26,   30
Steel                           15,   19,   22
Valuables                       10,   14,   17
Food                            15,   21,   25
Paper                           15,   19,   22
Copper ore                      20,   26,   30
Water                           15,   21,   25
Fruit                           15,   21,   25
Rubber                          15,   21,   25
Any Suggestions?
Attachments
irv.rar
Improved Road Vehicles, mainly for dbset.
(351 Bytes) Downloaded 424 times
My english isn´t good.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: Vehicle stats...

Post by Zephyris »

And you've just released your first grf! How does it feel?
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 8 guests