TTDPatch Wiki - Callbacks tutorial

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

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

TTDPatch Wiki - Callbacks tutorial

Post by andythenorth »

Just wanted to say thanks to Michael Blunck for the recently added callbacks tutorial on the TTDPatch Wiki :)

http://wiki.ttdpatch.net/tiki-index.php ... llbacksTut

This was very helpful to me when I needed to use callback 23.

I had to read the source example a couple of times to figure out that I needed to handle the callback in a varaction chain for cargo FF (buy menu sprites). However it was easy to work out from the example, and makes sense in retrospect. It didn't take long to adapt the existing action 2 that I had for the buy menu cargo.

Having a handy reference meant I could get some useful work done (good stuff marked in red) :)
callback 23.png
callback 23.png (24.21 KiB) Viewed 837 times
cheers,

Andy
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: TTDPatch Wiki - Callbacks tutorial

Post by michael blunck »

andythenorth wrote:Just wanted to say thanks to MB for the recently added callbacks tutorial on the TTDPatch Wiki
I´m planning to add missing CBs (for trains) soon, maybe between Christmas and New Year.
I had to read the source example a couple of times to figure out that I needed to handle the callback in a varaction chain for cargo FF (buy menu sprites). [...]
Just checked. Hehe. It´s even written explicitly, though not in the example code itself:
Callback tutorial wrote:Also, the variable action2 chain for the menu entry need references for callbacks 16 and 23. The latter is used to place the text of additional information into the menu entry, and CB 16 is needed to get the capacity of the four-part EMU to show up correctly in the buying menu.
8)

regards
Michael
Image
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Semrush [Bot] and 11 guests