Page 1 of 1

TTDPatch Wiki - Callbacks tutorial

Posted: 22 Dec 2008 19:06
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 836 times
cheers,

Andy

Re: TTDPatch Wiki - Callbacks tutorial

Posted: 22 Dec 2008 19:35
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