[NFO] Access VRSN of another NewGRF

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

Moderator: Graphics Moderators

Post Reply
arikover
Route Supervisor
Route Supervisor
Posts: 466
Joined: 15 Jun 2007 09:27
Skype: madchimiste
Location: Berlin, Deutschland

[NFO] Access VRSN of another NewGRF

Post by arikover »

In NFO, it is possible to determine whether another GRF is loaded or not (via var 88).

But is there a way to determine which version (VRSN) of this other GRF is loaded?
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: [NFO] Access VRSN of another NewGRF

Post by frosch »

Yes, take a look at:
https://newgrf-specs.tt-wiki.net/wiki/R ... Parameters

Code: Select all

<Sprite-number> * <Length> 0D <target> 00 FE FE <GRFID>
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
arikover
Route Supervisor
Route Supervisor
Posts: 466
Joined: 15 Jun 2007 09:27
Skype: madchimiste
Location: Berlin, Deutschland

Re: [NFO] Access VRSN of another NewGRF

Post by arikover »

Thank you for the quick answer, frosch.

That raises another question, however. In the action D code:

Code: Select all

<Sprite-number> * <Length> 0D <target> 00 FE FE <GRFID>
<target> is the parameter to read from the other NewGRF.

What target should I use, then? "VRSN"? "VRSN" 00 ? Would that work, considering the specs say that <target> should be Byte-sized?
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: [NFO] Access VRSN of another NewGRF

Post by Eddi »

no, "target" is the place where you want to store the value to that you read from the other GRF, for use in later operations
arikover
Route Supervisor
Route Supervisor
Posts: 466
Joined: 15 Jun 2007 09:27
Skype: madchimiste
Location: Berlin, Deutschland

Re: [NFO] Access VRSN of another NewGRF

Post by arikover »

Oops.

Sorry, I didn't read attently the specs...

I appreciate your help, thank you!
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 3 guests