Station's name from nearby industry (new version: 1.2.1)

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

a.locritani
Engineer
Engineer
Posts: 111
Joined: 08 Feb 2007 11:59
Skype: a.locritani
Location: Italy

Re: Station's name from nearby industry

Post by a.locritani »

sorry,people,my fault: as frosch says prop 1A are copied, but position constraints are not set by prop 1A.

at first, i thought that the problem was missing 1A props (and so confusing michael), but now I understand that i have to set callbacks in order to obtain the wanted behavior.

now, if anybody knows, why are these constraints not copied? It's a lot of work to obtain the same behaviors and not all are obtainable. i've looked in the code of ottd, i don't understand it fully, but seems that these constraints are setted here. there's no way to let them apply also for copied (prop 08) industries?
i understand that sometimes you don't want them (if you're substituting a forest with something completely different) but in other occasions (as the current) they can be useful.
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: Station's name from nearby industry

Post by frosch »

@michael:
The default industries have more restrictions than those settable by property 1A. Take a look at my post above and try to find those restrictions in the newgrfspecs.
The comments in OTTD source suggest, that those restrictions are explicitly left out by property 1A, as they are too special and newgrfs should handle such stuff through callbacks. (you have to ask csaboka for details).
To summarize there is no way for newgrfs to control those additional placement rules. Btw. I have checked: They are present in original TTD but have been slightly modified in OTTD since then (e.g. the configurable distance, and some of the scenario editor stuff).


Also btw. as it fits into this: The same happens for animation of houses and industry tiles. When you use property 08 of them, the newly defined house/industry tile will have no animation. You have to replicate the animation using the animation callbacks.


So to sum up, you cannot "just modify a single property" for houses, industries and industry tiles, as property 08 always looses some stuff.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Station's name from nearby industry

Post by michael blunck »

@frosch
a.locritani wrote:at first, i thought that the problem was missing 1A props (and so confusing michael), but now I understand that i have to set callbacks in order to obtain the wanted behavior.
Case settled.
frosch wrote:Also btw. as it fits into this: The same happens for animation of houses and industry tiles. When you use property 08 of them, the newly defined house/industry tile will have no animation. You have to replicate the animation using the animation callbacks.
From my understnding that´s because original TTD and newgrf animation are two different things. Original TTD animation for houses was only available for one single building.

regards
Michael
Image
a.locritani
Engineer
Engineer
Posts: 111
Joined: 08 Feb 2007 11:59
Skype: a.locritani
Location: Italy

Re: Station's name from nearby industry

Post by a.locritani »

so, people, in order to apply a simple prop 24 to default industries i've to redefine also the placement constraints? :shock: and nevertheless something will still be missing...
please don't misunderstand me, but it's not the most straightforward thing out there...

but i think (and you confirm me this) that there is no other way...but, again, why if I redefine an industry with a position constraint (applied by source code, not grf) i should lost its constraint? ?(
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Station's name from nearby industry

Post by michael blunck »

a.locritani wrote:[...]
Didn´t I tell you (or was it in Ammler´s thread?) this wouldn´t be easy? In AlpineClimate I had the same problems with overriding industries.

Csaba once told me that newhouses and newindustries were designed with defining new houses and new industries in mind. Not modifying existing ones. 8)

regards
Michael
Image
a.locritani
Engineer
Engineer
Posts: 111
Joined: 08 Feb 2007 11:59
Skype: a.locritani
Location: Italy

Re: Station's name from nearby industry

Post by a.locritani »

maybe somebody can help me:

in ottd strange things happen:
i'm setting a parameter with

Code: Select all

0D 01 80 32 00
07 01 01 \7= 00 02
that is
if parameter 01 is not set then set it to 32 (decimal, i think), else skip
if param 01 is equal to 0 then skip 2 sprites
where "defined" means
wiki wrote:
  • it has been set to any value in the newgrf(w).cfg parameter list
  • it or a parameter with higher number has been set to any value by an earlier action D
in ottd there is no newgrf(w).cfg so i can exclude first case; and no other parameters are set, because this is the last one.

however, openttd.exe -d grf=7 says me that

Code: Select all

ParamSet:Param 1 already defined, skipping
[..]
SkipIf: Skipping 2 sprites, test was true.
so it appears that param 01 is equal to 0.

if i comment (0c ...) the 0d action, on the other hand, i receive a message saying that param 01 is not defined and so the test (07) is skipped.

if i write

Code: Select all

0D 01 80 32 00
and in the meanwhile i set a parameter manually i think that the grf code has priority

any idea about the reason of this? and how can i set a default parameter, now?
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: Station's name from nearby industry

Post by frosch »

a.locritani wrote:if parameter 01 is not set then set it to 32 (decimal, i think), else skip
No, that means to set it to the value of parameter 0x32. For constants use 0xFF and append the dword value at the end of the sprite. Btw. you can use grf2html to identify those issues.
a.locritani wrote:in ottd there is no newgrf(w).cfg so i can exclude first case;
Not sure what you mean here. But the equivalent thing in OTTD is the "Set parameter" button in the newgrf window.
a.locritani wrote:ParamSet:Param 1 already defined, skipping
Maybe in the previous grfloading stage.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Station's name from nearby industry

Post by DaleStan »

frosch wrote:The comments in OTTD source suggest, that those restrictions are explicitly left out by property 1A, as they are too special and
are exclusive to OpenTTD, or are configured elsewhere in TTDPatch.
frosch wrote:They are present in original TTD but have been slightly modified in OTTD since then
And in Patch. The distance to world-edge, for example, is in morebuildoptions, and allows up to an infinite number of tiles between the industry and the world's edge.
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
a.locritani
Engineer
Engineer
Posts: 111
Joined: 08 Feb 2007 11:59
Skype: a.locritani
Location: Italy

Re: Station's name from nearby industry

Post by a.locritani »

@frosch: thanks, never understood that action D (without using FF) does calculations on parameters. yeah, I know, it's written... :roll:
a.locritani
Engineer
Engineer
Posts: 111
Joined: 08 Feb 2007 11:59
Skype: a.locritani
Location: Italy

Re: Station's name from nearby industry (new version: 1.2)

Post by a.locritani »

New version released: hopefully now without strange behaviors :roll:
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Station's name from nearby industry (new version: 1.2)

Post by Ammler »

Is this NewGRF also available without the oil modifications? I would like to include it to our grf package.
(if not, how do I need to set parameters to disable that?)

Greets
Ammler
a.locritani
Engineer
Engineer
Posts: 111
Joined: 08 Feb 2007 11:59
Skype: a.locritani
Location: Italy

Re: Station's name from nearby industry (new version: 1.2)

Post by a.locritani »

Ammler wrote:Is this NewGRF also available without the oil modifications? I would like to include it to our grf package.
(if not, how do I need to set parameters to disable that?)

Greets
Ammler
If you are talking about oil wells increasing production in temperate climate, simply set parameter #1 = 0 (or don't set it, because it's 0 by default)
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Station's name from nearby industry (new version: 1.2)

Post by Ammler »

a.locritani wrote:
If you are talking about oil wells increasing production in temperate climate, simply set parameter #1 = 0 (or don't set it, because it's 0 by default)
Well, and if the distances aren't set, it will use the distance from cfg? So using that GRF without any parameter should not change anything except the station names?
a.locritani
Engineer
Engineer
Posts: 111
Joined: 08 Feb 2007 11:59
Skype: a.locritani
Location: Italy

Re: Station's name from nearby industry (new version: 1.2)

Post by a.locritani »

Ammler wrote:Well, and if the distances aren't set, it will use the distance from cfg? So using that GRF without any parameter should not change anything except the station names?
No, sorry. If distance is not set it uses (quoting from first post) "max distance from coast for oil refineries (default 16), min distance from coast for oil rigs (default 16)"

Sadly you can't have (it's not possible to obtain because the way these things are managed by the game) both station name from nearby industries and original limitation on industries position, so I've tried to recreate original limitation as similar as possible, but there is a little difference between standard positional constraints (distance from edge of the map) and new constraints (distance from water/ground tiles).

also please consider that this grf only works for standard industries and that in order to use it on other industries set, their developers/maintainers have to add this property to their works.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 64 guests