NFO stations - cargo & custom layout

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

Moderator: Graphics Moderators

Post Reply
User avatar
vasatko
Engineer
Engineer
Posts: 15
Joined: 01 Feb 2018 12:36
Location: Czech Republic, Ostrava

NFO stations - cargo & custom layout

Post by vasatko »

Hi,

im coding now stations. I need help with it. My problem is callbacks generally.

I MUST USE NFO!!! Not NML or m4nfo!

Now i have 1x4 custom station with start sprite (0), 2 continous sprites (1,2) and end sprite (3):
Image

For custom layout i have this code:

Code: Select all


// custom station layout
-1*0 	02 04 01 
				89 					// get lowest doubleword
				41 					// platform info and relative position for individually built sections
				00 					// shift?? 																<- WHAT IS IT??
				0F 					// mask?? 																 <- WHAT IS IT??
				00 
				00    00 04 00    FF                              // what this bytes means? I know only third byte is length of station (maybe third and fourth byte?)
				00    00 00 00    00    00 00 00    02 FF    // 2 // this load second pair of sprites defined in Action 00
				01    00 00 00    01    00 00 00    02 FF    // 1 // this load second pair of sprites defined in Action 00
				02    00 00 00    02    00 00 00    04 FF    // 0 // this load fourth pair of sprites defined in Action 00
				03    00 00 00    03    00 00 00    0A FF    // 3 ??														<- NOT WORKING AND LOAD FIRST PAIR DEFINED IN ACTION 00
	
// callback switch?			
-1*0	02 04 02 
				81 					// get Byte
				0C 					// 0C - callback
				00 					// shift
				FF 					// mask
				01 					// one (range bellow)
				01 00 14 14 		// set action=01 if callback=14
				00 00				 // otherwise use this set

// info about aupper actions
-1*0    03 04 					 // Action 3, assigns graphics sets to feature IDs
			  01 					 // Number of IDs this action 3 associates graphics with, just the one
			  03 					 // Station-ID
			  01 					 // ??? what is this? Count of modification bellow?
			  FE 03 00 			 // FE all cargos = action 03, what is 00?
			  00 00 				 // others default graphic set
		
1) What is some parts (more in comments upper in code)?

2) How can i add next track in same layout?

3) Exist way how define start sprite, continous sprites and end sprite for variable station?

4) How to cargo change sprites?

5) How to animation?

Im study many hours on Wiki (its not good station documentation) and this and other forums. But no answers for my questions.
Last edited by vasatko on 19 Feb 2018 15:49, edited 6 times in total.
Image
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NFO stations - cargo & custom layout

Post by wallyweb »

I just posted some links in your other topic in the Suggestions forum. 8)
User avatar
vasatko
Engineer
Engineer
Posts: 15
Joined: 01 Feb 2018 12:36
Location: Czech Republic, Ostrava

Re: NFO stations - cargo & custom layout

Post by vasatko »

wallyweb wrote:Look in here. :D and also in here. :D
Sorry but i wrote, that i need in NFO and not NML (or m4nfo)! And first link i readed many times, but there is not explain what is it. If you read it, than you see only replacing, no coding.
Image
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: NFO stations - cargo & custom layout

Post by wallyweb »

Good for closing the other duplicate topic. :D
vasatko wrote:
wallyweb wrote:Look in here. :D and also in here. :D
Sorry but i wrote that i need in NFO and not NML! And first link i readed many times, but there is not explain what is it. If you read it, than you see only replacing no coding.
Aye. The first link is not NML. It is NFO, but I think that topic is still being developed. Send a PM to Quast65. 8)

The second link is not NML either. It is m4nfo by Michael Blunck and it does have tutorials. 8)
User avatar
vasatko
Engineer
Engineer
Posts: 15
Joined: 01 Feb 2018 12:36
Location: Czech Republic, Ostrava

Re: NFO stations - cargo & custom layout

Post by vasatko »

wallyweb wrote:Send a PM to Quast65. 8)
I do it :-)
Quast65 wrote:Action-2s are (at least for me ;-) ) very hard to understand how they exactly work...
When making the tutorial I looked at various code examples from other GRFs and figured out how to use them, without exactly understanding why they work ;-)
wallyweb wrote:The second link is not NML either. It is m4nfo by Michael Blunck and it does have tutorials. 8)
Yes i know it. Thank you. But generated code not explain me some parametrs from my code upper. I realy need understand NFO for stations.
Image
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: NFO stations - cargo & custom layout

Post by michael blunck »

wallyweb wrote:
vasatko wrote: Sorry but i wrote, that i need in NFO and not NML (or m4nfo)!
The second link is not NML either. It is m4nfo by Michael Blunck and it does have tutorials. 8)
Yeah, makes no sense to code stations in plain nfo.

Of course, for a small set with simple stations you could get away with it, but few people succeded even there.
vasatko wrote: I realy need understand NFO for stations.
Good luck and best wishes from my side.

regards
Michael
Image
User avatar
vasatko
Engineer
Engineer
Posts: 15
Joined: 01 Feb 2018 12:36
Location: Czech Republic, Ostrava

Re: NFO stations - cargo & custom layout

Post by vasatko »

michael blunck wrote: Yeah, makes no sense to code stations in plain nfo.

Of course, for a small set with simple stations you could get away with it, but few people succeded even there.

regards
Michael
OK, thank you Michael for your reply. I tried your m4nfo for bridges (stefino_cz wrote you PM about problems with compilation). But more easy was use NFO. Your m4nfo not support all. For example front of bridge with different sprite for roads and rails.

I think that m4nfo is for little set developers. But if I need big set or some special actions in set, then i must understand NFO.

Im goinig to try m4nfo with stations and understand what is in generated NFO. Its only one way for me, i think.
Image
User avatar
Quast65
Tycoon
Tycoon
Posts: 2661
Joined: 09 Oct 2011 13:51
Location: The Netherlands

Re: NFO stations - cargo & custom layout

Post by Quast65 »

If you dont get replies here answering your questions (give it some time though, not everyone checks out these forums on a regular base ;-) ), try PM-ing some of the developers of other quite large station-sets.
Like the Japanese Stations (that has cargo-aware tiles) or Industrial Stations Renewal (that also has animations).
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: NFO stations - cargo & custom layout

Post by michael blunck »

vasatko wrote: [...] I tried your m4nfo for bridges (stefino_cz wrote you PM about problems with compilation). But more easy was use NFO. Your m4nfo not support all. For example front of bridge with different sprite for roads and rails.
After reading stefinos reply, I´ve been testing bridges, and indeed it was buggy. I´m sorry, but this was the first time that I took a look on bridges since 4 years (nobody coded a new bridge set since years), and the reason for buggyness was a number of changes in m4nfo since 2014.

I´ve already fixed the original bug, but when being on it I decided to rewrite some parts of the bridge code as well. I´ll post a new m4nfo bridge module with a revised tutorial in the next couple of days.
vasatko wrote: I think that m4nfo is for little set developers. But if I need big set or some special actions in set, then i must understand NFO.
I totally disagree here. Coding a large (station) set in plain nfo is a real challenge[*] (I´ve done it for quite a long time). In addition, m4nfo is best prepared to be used for large sets, you could even handle distributed files, and "link" grf part files, to reduce "compile time".

[*] For example, take a look on ISR´s nfo code, and try to "understand" it. :cool:

m4nfo for stations, objects and (train) vehicles is mature, since these are the areas I´m constantly working on. There might be some inconveniences with other TTD "features" (due to a long time of absence from those), but usually even those will be fixed in a short time, if reported.
vasatko wrote: Im goinig to try m4nfo with stations and understand what is in generated NFO. Its only one way for me, i think.
Feel free to contact me in case.

regards
Michael
Image
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 5 guests