OTTD - Access to industry founder (var A7) during callbacks

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5705
Joined: 31 Mar 2007 14:23
Location: Lost in Music

OTTD - Access to industry founder (var A7) during callbacks

Post by andythenorth »

It was considered useful to have var A7 (industry founder information) available during cb 28 / 2F (industry location, custom shape check). This was added to OTTD 19901. http://vcs.openttd.org/svn/changeset/19901/

I'll update the TTDP wiki newgrf pages sometime soon. A use for this feature will also be showing up in FIRS sometime soon.

Thanks Frosch & Yexo :)
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 991
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: OTTD - Access to industry founder (var A7) during callbacks

Post by frosch »

Well, there are already a lot more variables accessible during construction checks (though it is said none are in TTDP, except the special ones of CB 28). So at some point an extra column on the VarAction2 pages might be useful (as was done for vehicles' purchase list).

Sadly there are multiple construction-time callbacks for industries and houses. For industries there are CB 22, 28, 2F, 38, 14A, 14B, 14C, and they all have slightly different variables available :(

However, in some cases these differences are quite pointless, and I would consider them bugs [1]. So if *someone* has lots of time, a table with the variables that make *any* sense during those callbacks should be made, and then the code should be checked to match that.

[1] E.g. neither "construction date" nor "industry layout" are available during CB 14A, 14B and 14C. Which is quite stupid [2] as it could be fixed by just moving the calls some lines down.

[2] Actually it makes me think that noone ever used those callbacks as they are hillarious useless that way (imho).
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: OTTD - Access to industry founder (var A7) during callbacks

Post by George »

frosch wrote:[1] E.g. neither "construction date" nor "industry layout" are available during CB 14A, 14B and 14C. Which is quite stupid [2] as it could be fixed by just moving the calls some lines down.

[2] Actually it makes me think that noone ever used those callbacks as they are hillarious useless that way (imho).
ECS uses CB 14A, but uses random value there
Image Image Image Image
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 13 guests