The difference between props 08 and 09 for industry action0?

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

Post Reply
User avatar
onodera
Traffic Manager
Traffic Manager
Posts: 170
Joined: 30 Jan 2005 23:00
Location: Moscow, Russia
Contact:

The difference between props 08 and 09 for industry action0?

Post by onodera »

Hello.

I've been staring at the NewGRF manual for an hour, and I still cannot understand the difference between props 08 and 09, industry substitute and industry override.

This code is supposed to add coal to the steel mill:

Code: Select all

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

    1 * 67   08 06 "OT" 03 01 "----------------------" 00
            "By onodera 2009.  No rights reserved." 00

    2 * 134   00 //Action 0
            08 //Global variables
            01 //Change 1 property
            20 //Change 32 labels
            00 //ID 00
            09 //Cargo translation table
            "PASS" //00
            "MAIL" //01
            "GOOD" //02
            "OIL_" //03
            "PETR" //04
            "COAL" //05
            "IORE" //06
            "CORE" //07
            "STEL" //08
            "COPR" //09
            "BAUX" //09
            "ALUM" //0A
            "GOLD" //0B
            "PHOS" //0C
            "SULP" //0D
            "FERT" //0E
            "SACI" //0F
            "NGAS" //10
            "FICR" //11
            "WATR" //12
            "CERE" //13
            "LVST" //14
            "FRUT" //15
            "FOOD" //16
            "WOOL" //17
            "LIME" //18
            "CMNT" //19
            "AMNI" //1A
            "EXPL" //1B
            "FISH" //1C
            "SAND" //1E
            "TOUR" //1F

//Steel Mill
//Requires coal now
//Same sprites
//Industry override:
    3 * 12   00 //Action 0
            0A //Industry
            02 //Change 2 properties
            01 //Change 1 industry
            08 //Steel mill
            08 08 //Override steel mill
            11 05 06 FF FF//Accept iron ore and coal

//Industry tiles:
    4 * 13   00 //Action 0
            09 //Industry tile
            03 //Change 3 properties
            01 //change 1 tile
            34 //Tile 34
            08 34 //Override tile 34
            0A 05 08 //Accept 8/8 coal
            0B 06 08 //accept 8/8 iron ore
    5 * 13   00 //Action 0
            09 //Industry tile
            03 //Change 3 properties
            01 //change 1 tile
            35 //Tile 35
            08 35 //Override tile 35
            0A 05 08 //Accept 8/8 coal
            0B 06 08 //accept 8/8 iron ore
    6 * 13   00 //Action 0
            09 //Industry tile
            03 //Change 3 properties
            01 //change 1 tile
            36 //Tile 36
            08 36 //Override tile 36
            0A 05 08 //Accept 8/8 coal
            0B 06 08 //accept 8/8 iron ore
    7 * 13   00 //Action 0
            09 //Industry tile
            03 //Change 3 properties
            01 //change 1 tile
            37 //Tile 37
            08 37 //Override tile 37
            0A 05 08 //Accept 8/8 coal
            0B 06 08 //accept 8/8 iron ore
    8 * 13   00 //Action 0
            09 //Industry tile
            03 //Change 3 properties
            01 //change 1 tile
            38 //Tile 38
            08 38 //Override tile 38
            0A 05 08 //Accept 8/8 coal
            0B 06 08 //accept 8/8 iron ore
    9 * 13   00 //Action 0
            09 //Industry tile
            03 //Change 3 properties
            01 //change 1 tile
            39 //Tile 39
            08 39 //Override tile 39
            0A 05 08 //Accept 8/8 coal
            0B 06 08 //accept 8/8 iron ore
(I'm using OTTD nightly r15113)
The GRF is loaded, but some of the mills say in their windows that they accept goods and grain, and some say they still accept only iron ore. All of them accept passengers and iron ore, according to the stations that are built next to them.
If I replace all my props 08 with 09, when I start a new game, the GRF is disabled, citing "Attempt to use invalid ID".

What am I doing wrong?
It's a nodding donkey in my avatar, not me! I'm an oil rig.
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 991
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: The difference between props 08 and 09 for industry action0?

Post by frosch »

You have to always define property 08. It also must be the first property you define for a new industry.
Setting it means to initialise a new industry, and to initialise all its properties with the values of the specified default industry.

So, when you only define property 08 you create a new industry that looks like the default one. Especially "new" means you do not modify the default industry itself. I.e. now both the default industry and your new industry will show up in game. Though they look the same, you can distinguish them using the "land area information"-tool (the questionmark in the menubar) and selecting a tile of a industry. If the industry is defined by a newgrf it will name it.

OTOH property 09 says that your new industry replaces a default one. That means the default industry will no longer show up, but only your new industry will. Theoretically setting property 09 should also replace existing default industries with your industry when adding your newgrf to a running game. Though that currently causes a lot of other trouble, and is questionable whether it will ever work in all cases.

So to summarise: You always have to define property 08 at first. Additionally setting property 09 will stop the specified default industry to appear next your industry. But note that you should only set property 09 if your new industry is similiar to the old one, as sometimes that info is used to identify a type of industry.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
onodera
Traffic Manager
Traffic Manager
Posts: 170
Joined: 30 Jan 2005 23:00
Location: Moscow, Russia
Contact:

Re: The difference between props 08 and 09 for industry action0?

Post by onodera »

Thank, I didn't realize you had to set both these properties to override a similar industry.
However, my steel mills still accept goods and grain, that is, they use cargo bits. NewGRF manual says that if I use a cargo translation table, cargo bits are overridden by the CTT. I happen to have one, but it doesn't affect the mill's acceptance. Is there a catch?
It's a nodding donkey in my avatar, not me! I'm an oil rig.
User avatar
OzTrans
Tycoon
Tycoon
Posts: 1714
Joined: 04 Mar 2005 01:07

Re: The difference between props 08 and 09 for industry action0?

Post by OzTrans »

... Is there a catch ? ...
It's called graphics version ... your grf is coded for version 6, but you need version 7 for CTT support. Check your action-08.
User avatar
onodera
Traffic Manager
Traffic Manager
Posts: 170
Joined: 30 Jan 2005 23:00
Location: Moscow, Russia
Contact:

Re: The difference between props 08 and 09 for industry action0?

Post by onodera »

OzTransLtd wrote:
... Is there a catch ? ...
It's called graphics version ... your grf is coded for version 6, but you need version 7 for CTT support. Check your action-08.
Gah, serves me right for thinking that the version was coded in the comments at the top and copying my action 8 from US Set.
Thanks.
It's a nodding donkey in my avatar, not me! I'm an oil rig.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 7 guests