Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu Nov 23, 2017 7:41 am

All times are UTC




Post new topic  Reply to topic  [ 33 posts ]  Go to page 1 2 Next
Author Message
PostPosted: Wed Aug 29, 2007 12:48 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Apr 02, 2004 9:40 am
Posts: 101
Location: Bratislava, Slovakia, Europe, Earth
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:
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:
File comment: Earlier Road Vehicles v1.0
erv.grf [741 Bytes]
Downloaded 1986 times
File comment: Improved Road Vehicles (for DB Set XL) v1.0
irv.grf [862 Bytes]
Downloaded 2733 times

_________________
My english isn´t good.


Last edited by Putcha on Sun May 03, 2009 11:04 am, edited 5 times in total.
Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Wed Aug 29, 2007 12:52 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed May 16, 2007 4:59 pm
Posts: 2774
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.

_________________
GRVTS/eGRVTS --- Generic Tram Set --- UK Town Set --- zBase ---RichardWheeler.net


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Wed Aug 29, 2007 1:05 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Apr 02, 2004 9:40 am
Posts: 101
Location: Bratislava, Slovakia, Europe, Earth
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.


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Wed Aug 29, 2007 1:15 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed May 16, 2007 4:59 pm
Posts: 2774
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.

_________________
GRVTS/eGRVTS --- Generic Tram Set --- UK Town Set --- zBase ---RichardWheeler.net


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Wed Aug 29, 2007 1:31 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Apr 02, 2004 9:40 am
Posts: 101
Location: Bratislava, Slovakia, Europe, Earth
OK. Then I will use the old, but they are in "late game" useless with that low capacities...

_________________
My english isn´t good.


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Wed Aug 29, 2007 2:42 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Apr 16, 2003 4:09 pm
Posts: 4291
Skype: george-vb
Location: SPb, Russia.
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


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Wed Aug 29, 2007 3:10 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Apr 02, 2004 9:40 am
Posts: 101
Location: Bratislava, Slovakia, Europe, Earth
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.


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Wed Aug 29, 2007 3:37 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Apr 16, 2003 4:09 pm
Posts: 4291
Skype: george-vb
Location: SPb, Russia.
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


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Wed Aug 29, 2007 3:46 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed May 16, 2007 4:59 pm
Posts: 2774
its supprisingly simple...

_________________
GRVTS/eGRVTS --- Generic Tram Set --- UK Town Set --- zBase ---RichardWheeler.net


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Wed Aug 29, 2007 4:22 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Apr 02, 2004 9:40 am
Posts: 101
Location: Bratislava, Slovakia, Europe, Earth
Thanx for quick answer, but look at my sig... :roll:

_________________
My english isn´t good.


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Wed Aug 29, 2007 4:45 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed May 16, 2007 4:59 pm
Posts: 2774
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:
// 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!

_________________
GRVTS/eGRVTS --- Generic Tram Set --- UK Town Set --- zBase ---RichardWheeler.net


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Wed Aug 29, 2007 4:49 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Apr 16, 2003 4:09 pm
Posts: 4291
Skype: george-vb
Location: SPb, Russia.
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


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Wed Aug 29, 2007 6:31 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Apr 02, 2004 9:40 am
Posts: 101
Location: Bratislava, Slovakia, Europe, Earth
first attemp - 3 parameters change...
Image
Code:
// 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:
 // Number of sprites in the grf
    0 * 4    02 00 00 00


2.
Code:
// 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:
    //  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.


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Wed Aug 29, 2007 7:32 pm 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
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


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Thu Aug 30, 2007 1:20 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Apr 02, 2004 9:40 am
Posts: 101
Location: Bratislava, Slovakia, Europe, Earth
OK, i have code. I have 53 sprites in grf and dont know what should be here:
Code:
// Number of sprites in the grf
    0 * 4    02 00 00 00

_________________
My english isn´t good.


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Thu Aug 30, 2007 1:44 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed May 16, 2007 4:59 pm
Posts: 2774
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 (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:
// Number of sprites in the grf
    0 * 4    35 00 00 00

_________________
GRVTS/eGRVTS --- Generic Tram Set --- UK Town Set --- zBase ---RichardWheeler.net


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Thu Aug 30, 2007 1:47 pm 
Offline
TTDPatch Developer
TTDPatch Developer
User avatar

Joined: Wed May 26, 2004 4:37 pm
Posts: 1802
Location: Britain
Change the number 0x00000002 to 0x00000035 (53 in hex) which should look something like:
Code:
    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."


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Thu Aug 30, 2007 1:49 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Apr 02, 2004 9:40 am
Posts: 101
Location: Bratislava, Slovakia, Europe, Earth
thanx.

_________________
My english isn´t good.


Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Thu Aug 30, 2007 2:22 pm 
Offline
Engineer
Engineer
User avatar

Joined: Fri Apr 02, 2004 9:40 am
Posts: 101
Location: Bratislava, Slovakia, Europe, Earth
So here is it.

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


List of changes:
Code:
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:
File comment: Improved Road Vehicles, mainly for dbset.
irv.rar [351 Bytes]
Downloaded 223 times

_________________
My english isn´t good.
Top
   
 Post subject: Re: Vehicle stats...
PostPosted: Thu Aug 30, 2007 2:49 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed May 16, 2007 4:59 pm
Posts: 2774
And you've just released your first grf! How does it feel?

_________________
GRVTS/eGRVTS --- Generic Tram Set --- UK Town Set --- zBase ---RichardWheeler.net


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 33 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2017 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2017.
Hosted by Zernebok Hosting.