New cargos experimental test version - a55vcs4

Get help, info, news and advice about the Transport Tycoon Deluxe patch.

Moderator: TTDPatch Moderators

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

Post by George »

I have a problem with defining new cargos - I do not know the default tiles list. Could someone post it on wiki?
For now, could someone tell me the Bank (temperate) tiles numbers?

Code: Select all

// Modify banks so it generates cargo 11 as well
   69 * 17	 00 0A 04 01 00 08 0C 09 0C 10 0A 10 11 0A 10 11 00
// Modify oil refenary so it generates cargo 11 as well
   71 * 17	 00 0A 04 01 01 08 04 09 04 10 05 11 11 03 FF FF 00
// Modify one of the bank tiles to make it accept cargo 10 and 11...
   73 * 18	 00 09 03 01 00 08 30 09 30 0A 0A 08 0B 10 08 0C 11 08
I guessed 30, but it seems wrong
Image Image Image Image
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

I think you need this.

I'm sorry I haven't mentioned it until now, it's been here for several days now. It should give you all information you need for coding new industries.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

Csaboka wrote:I think you need this.
I'm sorry I haven't mentioned it until now, it's been here for several days now. It should give you all information you need for coding new industries.
Thanks! It is what I needed! But I can't undersatnd, why do this line

Code: Select all

// Modify oil refenary so it generates cargo 11 as well
   71 * 17	 00 0A 04 01 01 08 04 09 04 10 05 11 11 03 FF FF 00
make oil refenary to produce no goods and petrol while oil is accepted and paid?
Image Image Image Image
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

Are you sure it doesn't produce goods? Not producing petrol is OK since you haven't overridden the default behavior, which is generating the first outgoing cargo if any incoming cargo appears.

You can override the default production scheme either by properties 1C..1E or by the production callback.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

Csaboka wrote:Are you sure it doesn't produce goods? Not producing petrol is OK since you haven't overridden the default behavior, which is generating the first outgoing cargo if any incoming cargo appears.

You can override the default production scheme either by properties 1C..1E or by the production callback.
Edit:
This works fine
// Modify oil refenary so it generates cargo 11 as well
71 * 22 00 0A 05 01 01 08 04 09 04 10 05 11 11 03 FF FF 00 1C 80 00 E0 00
Attachments
NewCargosw.rar
(10.28 KiB) Downloaded 166 times
Last edited by George on 31 Jul 2005 19:13, edited 1 time in total.
Image Image Image Image
User avatar
cornelius
Director
Director
Posts: 519
Joined: 04 Jan 2004 22:11

Post by cornelius »

michael blunck wrote:> So which one you get would depend on the train or country set?

Exactly. In fact, (seems I also like this flowery phrase, but here it´s true) all we need would be to change the texts for different .grfs / vehicle sets.
Okay. Do you have an idea of how you would like to assign the IDs for all your industries. I'd like to pick a compatible one for slate to be going on with.
Image
Cornelius Foundry ~ Bespoke Isometric Narrow Gauge Engineering ~ Est. 1921
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Post by SHADOW-XIII »

we need to unify new cargos since there will be not enough free slots :wink:
what are you looking at? it's a signature!
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

George: OK, it was my fault, and the bug broke oil refineries only. It will be fixed in the next alpha.

Your refinery will produce goods only, though, until you modify property 1C, since the default is producing the first output cargo (which is goods in this case) from incoming cargoes.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
cornelius
Director
Director
Posts: 519
Joined: 04 Jan 2004 22:11

Post by cornelius »

I'm having a slight problem with my slate mill. I've figured out how to do the layout (with a lot of brain strain) but I'm not totally sure how to get each tile showing the correct sprites. At the moment the north (top) one is okay but the rest are showing bits of coal mine. Here's the nfo code from the industry tiles action 0 onwards...

Code: Select all

   10 * 37	 00 09 03 04 00 08 00 01 02 03 0A 0C 08 0C 08 0C 08 0C 08 0B 00 00 00 00 00 00 00 00 0C 00 00 00 00 00 00 00 00 

// define "slate mill" - 7 properties
// prop 8 (substitute type to 17 - tropic factory) prop a (layout) prop b (type to 04 - processing)
// prop 10 (cargo production to 0c ff - goods/nil) prop 11 (cargo acceptance to slate/nil/nil)
// prop 17 (random probability to 05 - half) prop 1f (text id to 05 DC 00 00)
   11 * 50	 00 0A 07 01 01 08 17 0A 01 16 00 00 00 00 00 FE 00 00 01 00 FE 01 00 01 01 FE 02 00 00 01 FE 03 00 00 80 0b 04 10 05 ff 11 0c ff ff 00 17 05 1f 05 DC

// action 1 for slate mill
   12 * 4	 01 09 05 01
   13 Z:\pcx\ng set\slate_ind.pcx 2 14 01 31 64 -31 0
   14 Z:\pcx\ng set\slate_ind.pcx 82 14 01 31 64 -31 0
   15 Z:\pcx\ng set\slate_ind.pcx 162 14 01 31 64 -31 0
   16 Z:\pcx\ng set\slate_ind.pcx 242 14 01 31 64 -31 0
   17 Z:\pcx\ng set\slate_ind.pcx 2 84 01 50 23 -10 -20

// action 2 for slate mill
   18 * 17	 02 09 00 00 00 00 00 80 04 00 00 80 00 00 10 10 20
   19 * 17	 02 09 01 00 01 00 00 80 00 00 00 00 00 00 10 10 20
   20 * 17	 02 09 02 00 02 00 00 80 00 00 00 00 00 00 10 10 20
   21 * 17	 02 09 03 00 03 00 00 80 00 00 00 00 00 00 10 10 20

   22 * 26	 02 09 04 81 43 00 FF 04 00 00 01 01 01 00 02 02 02 00 03 03 03 00 04 04 00 00

// action 3 for slate mill
   23 * 7	 03 09 01 00 00 04 00
Image
Cornelius Foundry ~ Bespoke Isometric Narrow Gauge Engineering ~ Est. 1921
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

First of all, var. 43 doesn't work this way. It gives you the X and Y coordinates inside the industry. You should check byte 3 (shift-num=16, and-mask=FF), which gives you both offsets sqeezed into a byte, then check for values 00h, 01h, 10h and 11h in the action 2.

The second problem is that your action 3 affects tile 0 only, so the other three tiles still use the default graphics, the coal mine in this case.

I'm not sure how you want to do your industry, since there are two ways and your GRF seems to mix up those two.

If you want to use 4 tile types for your industry, delete that variational action2 altogether, and assign the tile-action2s to the tile types directly by using action 3.

If you want to use 1 tile type only, then the layout should use that one tile type only. In this case, the variational action2 and the final action3 can stay, but the action0 in the beginning should define one type only instead of four.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
cornelius
Director
Director
Posts: 519
Joined: 04 Jan 2004 22:11

Post by cornelius »

Csaboka wrote:If you want to use 4 tile types for your industry, delete that variational action2 altogether, and assign the tile-action2s to the tile types directly by using action 3.
This is what I was trying to do, I think. I've tried this and it works, so thanks for your help.

But for a larger industry (I think this one will end up being 16 tiles - 4x4) I guess it would make sense to use the other method so there are less tiles to define. Or is there some way to combine the two?
Image
Cornelius Foundry ~ Bespoke Isometric Narrow Gauge Engineering ~ Est. 1921
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Sure.
Define eg 9 tile types: 1 for each corner (4 types, 1 tile/type), 1 for each side (4 types, 2 tiles/type), and 1 for the center (1 type, 4 tiles/type), and then use var action 2s as appropriate.
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
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Csaba, since I haven't seen you on IRC recently:
In the changelog for 2.0.1 a39, patchman said "prevent hang if action 2 refers to its own ID (now it's an error)", but MB seems to be getting away with it in newcargo[w].grf. Did you change something?
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
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

DaleStan: I've changed nothing about the ID handling AFAICT...
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

DaleStan wrote:Csaba, since I haven't seen you on IRC recently:
In the changelog for 2.0.1 a39, patchman said "prevent hang if action 2 refers to its own ID (now it's an error)", but MB seems to be getting away with it in newcargo[w].grf. Did you change something?
[Aside] If an action 2 refers to its own ID since a39, it actually refers to the most recent action 2 with that ID, not itself. If no such action 2 has been defined yet, it will generate the appropriate error message.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

newgrf.txt wrote:When a player transports a cargo to a station that accepts it, the amount of income
depends on four factors:
- The Manhattan distance between the source and destination station signs.
- The amount of cargo moved
- The price factor defined by property 12. This one is subject to inflation.
- A time factor, calculated the following way:
(t is the time needed for the delivery, T1 and T2 are the values of property 10 and 11,
respectively. The unit is 185 ticks, roughly 2.5 game days)
-If the delivery is faster than T1, it's 255
-If the delivery is slower than T1, but faster than T1+T2, then the factor is
255-(t-T1)
-If the delivery is slower than T1+T2, the factor is 255-(t-T1)-(t-T1-T2)
-If the above rules would result in a factor lower than 31, 31 is used instead
Could something be done with the last rule? I'd like to make tourists be paid negative or zero if transportation took over 100 days per 20 squares. Now when I specify prop 10 an 11 to zero it is not low enougth
Image Image Image Image
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

I was thinking of a more general solution than that. There could be a callback to decide the income multiplier, given the factors (time spent delivering, distance and amount). Returning a negative multiplier would result in a delivery cost instead of delivery income. In my devel version, there is already a possibility to return the result of an action2 calculation instead of deciding on it, so doing this callback would be rather easy from the GRF. Later, this could be extended to simulate some economy changes. (For example: if there are few coal mines on the map, but many power stations, the price of coal is high, since the supply for coal is low but the demand is high. In the opposite case, the price of coal could decrease.) I don't know how this would work in the game, though.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Post by wallyweb »

Csaboka wrote:(For example: if there are few coal mines on the map, but many power stations, the price of coal is high, since the supply for coal is low but the demand is high. In the opposite case, the price of coal could decrease.) I don't know how this would work in the game, though.
Dynamite coal mines to drive up the price ... it doesn't get more realistic than that. 8)
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

If a town tries to build a building, and it fails via callback 17, does the town try to build an other building at that place or it stays as bared land?
Image Image Image Image
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus »

Interesting idea to make cargo payment a dependent variable, based on the amount of supply and demand on a map. /me hopes it's possible.
Post Reply

Return to “General TTDPatch”

Who is online

Users browsing this forum: No registered users and 9 guests