Action0, need help, coding price
Moderator: Graphics Moderators
Action0, need help, coding price
hello,
need help. Want to code the price of my train-engine.
I thougt this must work, anyway...
13 * 31 00 00 09 01 16 00 42 0E 09 3C 00 0B 90 00 14 28 15 00 16 14 19 08 12 FD 0D 01 0E 3C 4C 00 00
price is now $ 281.250.- but i need a price of $ 10.000.
How do i do that??
need help. Want to code the price of my train-engine.
I thougt this must work, anyway...
13 * 31 00 00 09 01 16 00 42 0E 09 3C 00 0B 90 00 14 28 15 00 16 14 19 08 12 FD 0D 01 0E 3C 4C 00 00
price is now $ 281.250.- but i need a price of $ 10.000.
How do i do that??
Last edited by Bernhard on 11 Jan 2005 07:11, edited 1 time in total.
You don't code the price in absolute dollars. I believe the price is expressed in British pounds, date 1921. Thereafter it is adjusted by the inflation set in the individual game settings.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
No, price is actually set by "Cost factor", which is therefore a factor rather than an absolute value. I did do some research some time ago into prices and put the running costs on the Wiki but for some reason I never put build costs on there. This is what I found, with cost factor on the left and price on the right (all prices 1920, pre-inflation, US dollars, vary with difficulty level):
The cost factor is a linear scaling of the price so, to approximate, do price divided by $3124 and convert to hex to get a reasonable value of cost in Medium difficulty.
Code: Select all
Easy:
01 $ 2342
10 $ 37500
20 $ 75000
80 $300000
A0 $375000
FF $597656
Medium:
01 $ 3124
10 $ 50000
20 $100000
80 $400000
A0 $500000
FF $796874
Hard:
01 $ 3514
10 $ 56250
20 $112500
80 $450000
A0 $562500
FF $896484
US Train Set v0.87.1 now released: http://www.tt-forums.net/viewtopic.php?t=8754
Don't forget to read the manual: http://wiki.ttdpatch.net/tiki-index.php?page=Manual
Don't forget to read the manual: http://wiki.ttdpatch.net/tiki-index.php?page=Manual
Note that the dbset xl modifies the base costs (using a new action 0 type), so if you load your train with the db set xl active, the prices will probably be much higher than you want/expect.
(For testing, it's always best to deactivate all other graphics anyway to eliminate this kind of interference.)
(For testing, it's always best to deactivate all other graphics anyway to eliminate this kind of interference.)
@ Oracle... thanx. i had read your explanations in the wiki, they are good. But i didn' understood why it doesn't work as i thought. Perhaps is the dbset the reason, as Patchman said.
@ Patchman... thanx too. Do you have a idea how i could change that back? I need a price of max. 20.000 DEM in 1930 for my VT133 ( http://ttdgraphics.cjb.net/graphid.php?id=98 ). It was a very cheap railbus.
@ krtaylor, thanks to you too. What currency is the base is not so importent. If i have the way to code, i can figure out. (is that right for try until it is right?)
@ Patchman... thanx too. Do you have a idea how i could change that back? I need a price of max. 20.000 DEM in 1930 for my VT133 ( http://ttdgraphics.cjb.net/graphid.php?id=98 ). It was a very cheap railbus.
@ krtaylor, thanks to you too. What currency is the base is not so importent. If i have the way to code, i can figure out. (is that right for try until it is right?)
Well, empty out your newgrfw.cfg file and only leave your test grf in there. Then try again.Bernhard wrote:@ Patchman... thanx too. Do you have a idea how i could change that back? I need a price of max. 20.000 DEM in 1930 for my VT133 ( http://ttdgraphics.cjb.net/graphid.php?id=98 ). It was a very cheap railbus.
Re: Action0, need help, coding price
if i had understood the wiki right, this is the part where the costs are defined: 0D 01 0E 3C 4C 00 00
but it doesn't work.
With DB-Set active the price is 580.000DEM, without the price is 250.000DEM.
and it is regardless of which values i add. 0D FF 0E 3C 4C 00 00 will have the same resulat as 0D 00 0E 3C 4C 00 00
is it possible that the price comes from the train-id?
i've coded the train to replace id 16................
ok i will try............
but it doesn't work.
With DB-Set active the price is 580.000DEM, without the price is 250.000DEM.
and it is regardless of which values i add. 0D FF 0E 3C 4C 00 00 will have the same resulat as 0D 00 0E 3C 4C 00 00
is it possible that the price comes from the train-id?
i've coded the train to replace id 16................
ok i will try............
Re: Action0, need help, coding price
Properties 0d and 0e are for running cost (how much the thing costs to maintain). To set the purchase price you need to use property 17 - this is the 'cost factor' that Oracle mentioned.Bernhard wrote:if i had understood the wiki right, this is the part where the costs are defined: 0D 01 0E 3C 4C 00 00
but it doesn't work.
With DB-Set active the price is 580.000DEM, without the price is 250.000DEM.
and it is regardless of which values i add. 0D FF 0E 3C 4C 00 00 will have the same resulat as 0D 00 0E 3C 4C 00 00
is it possible that the price comes from the train-id?
i've coded the train to replace id 16................
ok i will try............
I don't want to make new topic to don't make mess and write my problem here. I'm begginer in coding and need some help. I spent half night studing wiki graphics specs and other sets but i don't know where is the problem:
Everything is ok. exept that that I see only 4 from 8 sprites of my loco in game.
Code: Select all
// Automatically generated by GRFCODEC. Do not modify!
// (Info version 4)
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
0 * 4 0E 00 00 00
1 * 24 08 06 4D 53 01 01 50 4B 50 20 73 65 74 00 28 63 29 20 53 69 65 6D 61 00
2 * 4 01 00 01 08
3 C:\Documents and Settings\Maciej\Pulpit\pkp set\gotowe grafiki PCX\sp32w.pcx 16 16 16 21 7 -3 -14
4 C:\Documents and Settings\Maciej\Pulpit\pkp set\gotowe grafiki PCX\sp32w.pcx 26 16 16 15 20 -9 -7
5 C:\Documents and Settings\Maciej\Pulpit\pkp set\gotowe grafiki PCX\sp32w.pcx 49 16 16 11 29 -13 -6
6 C:\Documents and Settings\Maciej\Pulpit\pkp set\gotowe grafiki PCX\sp32w.pcx 81 16 16 15 20 -9 -7
7 C:\Documents and Settings\Maciej\Pulpit\pkp set\gotowe grafiki PCX\sp32w.pcx 104 16 01 21 07 -3 -6
8 C:\Documents and Settings\Maciej\Pulpit\pkp set\gotowe grafiki PCX\sp32w.pcx 114 16 09 15 20 -10 -8
9 C:\Documents and Settings\Maciej\Pulpit\pkp set\gotowe grafiki PCX\sp32w.pcx 137 16 01 11 29 -15 -6
10 C:\Documents and Settings\Maciej\Pulpit\pkp set\gotowe grafiki PCX\sp32w.pcx 169 16 09 15 20 -10 -8
11 * 9 02 00 00 01 01 00 00 00 00
12 * 7 03 00 01 02 00 00 00
13 * 10 04 00 1F 01 02 53 50 33 32 00
14 * 28 00 00 0A 01 02 00 56 47 02 00 03 25 04 50 06 07 09 64 00 0B FA 04 19 08 22 20 12 FD
The NFO looks fine. Can you post the GRF?
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Here is my grf. And also newgrf.cfg. when i test this loco i have all grfs turned off, exept all that apears with blue flag in gamea, and of course this loco.
- Attachments
-
- newgrfw.cfg
- (1.07 KiB) Downloaded 81 times
-
- sp32w.grf
- (1.86 KiB) Downloaded 67 times
OK, I found it, and it is in the NFO. A compression (the third number after the file name) of 16 is apparently not valid. (The wiki is <sarcasm>oh, so helpful</sarcasm> here.) I always use 01.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
-
- TTDPatch Developer
- Posts: 417
- Joined: 13 Apr 2004 13:35
- Location: Eindhoven, Netherlands
- Contact:
I don't know much about that number either, but i tried reading the grfcodec source to see what it might do; first of all it is actualy a bitmask. but afaict only two bits are relevant, bit 1 (0x02) and bit 3 (0x08), but looking at the ttd grf files bit 0 also is always set. So the only relevant values for this field are 01, 03, 09 (and 0B?). (And yes, this field must be written in hex...)DaleStan wrote:OK, I found it, and it is in the NFO. A compression (the third number after the file name) of 16 is apparently not valid. (The wiki is <sarcasm>oh, so helpful</sarcasm> here.) I always use 01.
According to the grfcodec source, bit 1 has something to do with compression, and bit 3 something with transparency...
thanks a lot for this. it was 16 because I have used nfoeditor to calibrate vehicle position and it changed the values.
BTW as a begginer I want to know some things too:
1.When I want to code next vehicle in the same nfo file I just must repeat this construction (exept entry 0) with adequate values?
2.Does first entry (entry 0) have any other meaning or it just counts number of entrys?
Thanx in advance.
BTW as a begginer I want to know some things too:
1.When I want to code next vehicle in the same nfo file I just must repeat this construction (exept entry 0) with adequate values?
2.Does first entry (entry 0) have any other meaning or it just counts number of entrys?
Thanx in advance.
1) Repeat sprites 2-14 as necessary. Do not duplicate the action 8.
2) Sprite 0 has no meaning beyond being a count of the sprites in the file.
It is possible to interlace the data to some extent, so you have only a few action 0s, two action 1s (one for 4-sprite vehicles and one for 8-sprite vehicles), and one action 4, but this makes modifications and debugging incredibly hard.
2) Sprite 0 has no meaning beyond being a count of the sprites in the file.
It is possible to interlace the data to some extent, so you have only a few action 0s, two action 1s (one for 4-sprite vehicles and one for 8-sprite vehicles), and one action 4, but this makes modifications and debugging incredibly hard.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Who is online
Users browsing this forum: Bing [Bot] and 24 guests