I have a small problem with NFO atm. I define a number of stations each with their own Action1 block but they have a simular layout and could use the same VarAction2 and callback chain. However, when I try to use the same chain from different Action3s it always shows the same graphics of the station at which I defined the VarAction2 chain.
I managed to get the correct graphics too but it skipped the VarAction2 chain and just used the default TTD method of showing stations, something which will make it look very odd.
So I wonder, is there a method of using the same VarAction2 chain with different Action1 blocks?
PS: code can be found here: http://svn.openttdcoop.org/grfdev/dutch ... h_set.hnfo, it is mainly about the lights until the benches and the plant barges until the simple roofs.
Recycling VarAction2 blocks
Moderator: Graphics Moderators
Recycling VarAction2 blocks
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)

OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone

OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone







Re: Recycling VarAction2 blocks
Yes. Copy and paste.
An action 2 always points to the same set(s) of graphics, regardless of the location of the action 2/3 which called it.
An action 2 always points to the same set(s) of graphics, regardless of the location of the action 2/3 which called it.
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Re: Recycling VarAction2 blocks
It is though, possible to reuse action 2 chains if they only return callback results.
So from the code you link to, this chain could be reused:
But this has to be unique for each station, as it references real sprites:
So from the code you link to, this chain could be reused:
Code: Select all
// Check if the bottom platform is in the middle
10 * 14 02 04 01 81 41 08 0F 01 04 80 00 00 0C 80
10 * 14 02 04 02 81 41 14 0F 01 01 00 02 0F 04 80
// Check if the top platform is in the middle
10 * 14 02 04 03 81 41 08 0F 01 00 80 00 00 0A 80
10 * 14 02 04 04 81 41 14 0F 01 03 00 02 0F 02 80
// General checks
10 * 10 02 04 05 81 41 00 0F 01 06 80 01 0F 02 80 // Middle platforms
10 * 14 02 04 06 81 41 04 0F 01 02 00 00 00 05 00 // Bottom platform
10 * 14 02 04 07 81 41 00 0F 01 04 00 00 00 06 00 // Top platform
10 * 14 02 04 08 81 41 08 0F 01 02 80 00 00 08 80 // Top platform with stairs
10 * 14 02 04 09 81 41 10 0F 01 08 00 01 01 07 00 // Just one platform
Code: Select all
10 * 14 02 04 0A 81 0C 00 FF 01 09 00 14 14 00 00 // The callback
Re: Recycling VarAction2 blocks
Hmm, that sounds like a proper solution, I will try it later today
.
EDIT: Seems like it works indeed, thank you Mart3p

EDIT: Seems like it works indeed, thank you Mart3p
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)

OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone

OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone







Who is online
Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Bing [Bot] and 21 guests