Article View: alt.games.microprose.transport-tyc
Article #27898Re: Call backs tutorials or any help at all!
From: Michael Blunck
Date: Tue, 24 Aug 2004 21:05
Date: Tue, 24 Aug 2004 21:05
52 lines
2662 bytes
2662 bytes
Ronnie Clark wrote: > Are there any tutorials out there? Hi Ronnie, Yes. You may check the ttdpatch wiki pages. AFAIR those tutorials and also the callback descriptions there http://wiki.ttdpatch.net/tiki-index.php?page=Action0Trains are somewhat more detailed than in the newgrf.txt file. > Or an explanatory file to go with "callbacks.grf"? I could sent you commented excerpts from the DB set implementation, just tell me what kind of callbacks you would like to take a closer look onto. > If anyone out there can help with this simple (I hope) call back > query, is it possible for a wagon to have a default appearance > UNLESS it appears as the first wagon after the engine? That´s possible, however you wouldn´t need a callback for that. :) > If so, could > anyone "give" me the code for this situation: > > Actions 1 and 2 have already created cargo-ids 00 and 01, where 00 > is the default appearance and 01 is its appearance after the > engine. They are to be tied to veh-id 0B when the train engine is > veh-id 0A. What you´ll need is another action 2 which would check var "40" (consist position and length) and decides if your waggon for position "1" (i.e. after the engine). According to newgrf.txt: "returns dword 00nnbbff, where ff is the number of vehicle within consist counted from engine (front), e.g. engine=0, 1st wagon/mail comp.=1, 2nd wagon/rotor=2, 3rd wagon=3 etc., bb is the number counted from end, e.g. last wagon=0, next-to-last wagon=1 etc., and nn is the total number of vehicles in the consist." i.e. your additional action 02 would be: -1 * 14 02 00 xx 81 40 00 FF 01 (01 00) 01 01 (00 00) You can then use c-id "xx" for further processing or for an action 03. HTH regards Michael PS: don´t send a "multipart" mesage in case you´d like to contact me in pm ...
Technical Details
Message-ID:
<2p1oquFg425dU1@uni-berlin.de>Path:
mbox-mo1.pugleaf.net!number1.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!not-for-mailReferences:
<cgg63h$rph$1@newsg3.svr.pol.co.uk>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!number1.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Michael Blunck" <michael.blunck@ewetel.net> Newsgroups: alt.games.microprose.transport-tyc Subject: Re: Call backs tutorials or any help at all! Date: Tue, 24 Aug 2004 23:05:07 +0200 Lines: 53 Message-ID: <2p1oquFg425dU1@uni-berlin.de> References: <cgg63h$rph$1@newsg3.svr.pol.co.uk> Mime-Version: 1.0 X-Trace: news.uni-berlin.de dtZbon1jlR2kaMuZa2DJ1ghZJQjUfjmQFNhozwm9GwoqrOtGyq X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit