How can I read the game mode in action 2?

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

User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

How can I read the game mode in action 2?

Post by George »

In action 7 I can read the mode
92 B Game mode, 0 in title screen, 1 in game and 2 in editor
how can I do it in action D or 2?
Image Image Image Image
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: How can I read the game mode in action 2?

Post by belugas »

In action D, it is easy to do.
It would be patch's variable 14, same encoding as for var 92, action 7.
As for action 2...
http://wiki.ttdpatch.net/tiki-index.php ... nalAction2, variable 21?
AS far as i know, there is no other means. But i may be wrong.
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: How can I read the game mode in action 2?

Post by George »

belugas wrote:In action D, it is easy to do.
It would be patch's variable 14, same encoding as for var 92, action 7.
As for action 2...
http://wiki.ttdpatch.net/tiki-index.php ... nalAction2, variable 21?
AS far as i know, there is no other means. But i may be wrong.
Ok.
Image Image Image Image
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: How can I read the game mode in action 2?

Post by belugas »

hemmm...
Sorry, but i meant that these would be new features, not currently available ones...
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: How can I read the game mode in action 2?

Post by George »

belugas wrote:hemmm...
Sorry, but i meant that these would be new features, not currently available ones...
I understood your post as you've added this task to your todo list. Was I mistaken?
Image Image Image Image
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 991
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: How can I read the game mode in action 2?

Post by frosch »

George:
You can access every variable from Action7/9 also in ActionD.
To use them in VarAction2 just copy variable 0x92 to a free 'parameter'-variable (0x00-0x7F) and use it through varaction2 variable 0x7F[...]

So we decided that there is no need to add new things.

Speaking for the OTTD-devs. Regards frosch.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: How can I read the game mode in action 2?

Post by George »

frosch wrote:You can access every variable from Action7/9 also in ActionD.
How?
Image Image Image Image
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 991
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: How can I read the game mode in action 2?

Post by frosch »

NewGrfSpecs wrote: target, source1, source2
These bytes specify the target parameter and source parameters. They can either be simply the numbers of grf parameters, or they can be the special variables from action 7, see the description of param-num there.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: How can I read the game mode in action 2?

Post by George »

frosch wrote:
NewGrfSpecs wrote:target, source1, source2
These bytes specify the target parameter and source parameters. They can either be simply the numbers of grf parameters, or they can be the special variables from action 7, see the description of param-num there.
Ok, thank you.
Image Image Image Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: How can I read the game mode in action 2?

Post by DaleStan »

frosch wrote:You can access every variable from Action7/9 also in ActionD.
You can also access every 7/9/D variable in action 2.
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
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 991
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: How can I read the game mode in action 2?

Post by frosch »

That does not seem to be documented.
So is VarAction2 variable 'i' identical to Action7/9/D variable '0x80 + i' for 'i' in 0x00 to 0x3F ?
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: How can I read the game mode in action 2?

Post by DaleStan »

It's documented only in that there's a suspicious correspondence between the global action 2 variables and the action 7/9/D variables.

And correct.
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
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: How can I read the game mode in action 2?

Post by George »

DaleStan wrote:It's documented only in that there's a suspicious correspondence between the global action 2 variables and the action 7/9/D variables. And correct.
NFOrenum reports var 12 unknown
Image Image Image Image
User avatar
Maedhros
OpenTTD Developer
OpenTTD Developer
Posts: 603
Joined: 30 Mar 2006 18:24
Location: Durham, UK

Re: How can I read the game mode in action 2?

Post by Maedhros »

DaleStan wrote:It's documented only in that there's a suspicious correspondence between the global action 2 variables and the action 7/9/D variables.
Why wasn't it explicitly documented, out of interest?
No-one's more important than the earthworm.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: How can I read the game mode in action 2?

Post by DaleStan »

Because there's a nebulous idea that we might someday split the action 2 globals from the 7/9/D globals, and the fewer variables are actually documented as working both places, the more space we can generate from the split.
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
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: How can I read the game mode in action 2?

Post by George »

DaleStan wrote:Because there's a nebulous idea that we might someday split the action 2 globals from the 7/9/D globals, and the fewer variables are actually documented as working both places, the more space we can generate from the split.
why not to make such change from GRF version 8 (9, 10 ...)? In the current version (7) it works this way - so it should go to documentation.
We already had changes between version 6 and 7, so why not to use this solution in the future?
Image Image Image Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: How can I read the game mode in action 2?

Post by DaleStan »

George wrote:why not to make such change from GRF version 8?
That would work too, I suppose.
George wrote:In the current version (7) it works this way - so it should go to documentation.
Invalid argument. In earlier versions, the feature byte for 1/2/3 chains didn't actually have to match. Should that have been documented too?
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
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: How can I read the game mode in action 2?

Post by George »

DaleStan wrote:
George wrote:In the current version (7) it works this way - so it should go to documentation.
Invalid argument. In earlier versions, the feature byte for 1/2/3 chains didn't actually have to match. Should that have been documented too?
I suppose yes.

I mean I'm using var 12 in action 2 in my current versions of the GRF files, it works, so I would like to be sure that this will be not broken in the next version without a warning (changing the appropriate wiki page counts as this warning :roll: )
Image Image Image Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: How can I read the game mode in action 2?

Post by DaleStan »

Any GRF file that obeys the current documentation will continue to work with all future versions of TTDPatch, unless Patchman decides differently.
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
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: How can I read the game mode in action 2?

Post by George »

DaleStan wrote:Any GRF file that obeys the current documentation will continue to work with all future versions of TTDPatch, unless Patchman decides differently.
Current documentation does not declare var 12 for action 2 as game mode. NFOrenum counts it as error 86.
Image Image Image Image
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Bing [Bot] and 16 guests