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?
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
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
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
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
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.
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
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...
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
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?
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.
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?
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.
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
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
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.
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?