Welcome to GameHourz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Call backs tutorials or any help at all!

 
   Game Forums (Home) -> Transport Tycoon RSS
Related Topics:
Bug Fix by myself! - At last i found out what was giving me graphical glitches on hi-score It's a option that i have in the (by Michal Pavlik), i think also available in the TTDX when using 5 - Full Screen (Clear..

Annoying Telegraphic Sound - Is there any way, ou to integrate in the patch, an option that sets to the sound for each news message It's getting REALLY anoying after all this years... Oh, BTW, the telegraph as ended... Maybe a after..

Alpha 69 problems - fixed? - Hi Josef, et al, I've been playing a lot on Alpha 69 and begun problems which I haven't seen as being corrected in history logs for a70, a71, a72, a73 and b1. after a certain period of time my towns start to The first..

Beta 1 bug with "enhancedtunnels" - Those concerned probably already know this, but incase not... With on, play is broken - ie, only the company's trains will enter a tunnel, whilst other trains reverse when trying to enter it. Caused me a..

Observations and doubts - Hi all. Since ever, i have noticed that the of the farms is not so as it look; when a farm produces "90 tons of and "90 items of in very distinct games, i had very different results, sometimes the of grain..
Next:  NNTP Server?  
Author Message
Ronnie Clark

External


Since: Aug 24, 2004
Posts: 12



(Msg. 1) Posted: Tue Aug 24, 2004 9:07 pm
Post subject: Call backs tutorials or any help at all!
Archived from groups: alt>games>microprose>transport-tyc (more info?)

I've tried going through the latest newgrf.txt, but still can't really
fathom out this "call backs" mallarchy.

Are there any tutorials out there? Or an explanatory file to go with
"callbacks.grf"?

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? 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 other actions 0 and 2 are needed to do this?

Ronnie
--
Volunteer guard on the Great Central Railway, Loughborough, Leicestershire
Visit the world's only double track preserved steam railway!
http://www.gcrailway.co.uk

 >> Stay informed about: Call backs tutorials or any help at all! 
Back to top
Login to vote
Michael Blunck

External


Since: Apr 11, 2004
Posts: 40



(Msg. 2) Posted: Tue Aug 24, 2004 11:05 pm
Post subject: Re: Call backs tutorials or any help at all! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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. Smile

> 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 ...

 >> Stay informed about: Call backs tutorials or any help at all! 
Back to top
Login to vote
Ronnie Clark

External


Since: Aug 24, 2004
Posts: 12



(Msg. 3) Posted: Wed Aug 25, 2004 3:38 am
Post subject: Re: Call backs tutorials or any help at all! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks Michael...

I only just managed to learn the basic style of GRF coding, and now I come
back 6 months later it's even more complicated! Smile

One thing I was wondering is is it now possible (using callbacks or
otherwise) to differentiate between graphics that appear in windows in the
game and those actually on the track? One thing that I've always found
annoying is that the trains never actually appear to run on the tracks, but
instead sort of ride next to them. I've just designed a new carriage, with
offsets to put it on the tracks, and also full length so that in the
horizontal view the corridor connections of adjacent carriages join up.

The problem is, in all the windows, the coaches appear about three pixels
too high, and in the depot window, they're about 2 pixels too long.

Is they're any way around this, or is it a case of that if you want the
on-track graphics to work, you have to put up with the rest?

Ronnie
--
Volunteer guard on the Great Central Railway, Loughborough, Leicestershire
Visit the world's only double track preserved steam railway!
http://www.gcrailway.co.uk
 >> Stay informed about: Call backs tutorials or any help at all! 
Back to top
Login to vote
Michael Blunck

External


Since: Apr 11, 2004
Posts: 40



(Msg. 4) Posted: Wed Aug 25, 2004 11:21 am
Post subject: Re: Call backs tutorials or any help at all! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ronnie Clark wrote:

> One thing I was wondering is is it now possible (using callbacks or
> otherwise) to differentiate between graphics that appear in windows
> in the game and those actually on the track?

I´m not really shure what you´re talking of, but I´d say "no" in general ... but
"yes" in that special case to follow. Smile

[shifting vehicles vertically]

> The problem is, in all the windows, the coaches appear about three
> pixels too high, and in the depot window, they're about 2 pixels
> too long.
>
> Is they're any way around this, or is it a case of that if you want
> the on-track graphics to work, you have to put up with the rest?

There´s a (relatively) new feature of the patch which deals exactly with that
problem. In fact it has been developed by Josef for the DB set XL which
implemented "driving on tracks" for the first time.

Only thing you´d have to do would be to include the special patch command:

-1 * 9 0D 8E 00 FF FF 02 00 00 00

before your vehicles´ definitions. This will result in shifting vehicles up two
pixels in train windows.

This is essentially an "action 0D" (set parameter value) which sets the special
variable "8E" (how many pixels to displace sprites in train windows) to "2". See
"action 07/09" and "action 0D" for details.

BTW, there´s another useful thing to do, namely to reset the ordering scheme of
vehicles which could have been possibly changed by a prior .grf file:

-1 * 6 00 00 01 00 00 1A

resets the ordering scheme for vehicles to the default (0 ... FF). This command
should be also issued before all vehicle specific actions.

regards
Michael
 >> Stay informed about: Call backs tutorials or any help at all! 
Back to top
Login to vote
Ronnie Clark

External


Since: Aug 24, 2004
Posts: 12



(Msg. 5) Posted: Wed Aug 25, 2004 9:26 pm
Post subject: Re: Call backs tutorials or any help at all! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

>-1 * 9 0D 8E 00 FF FF 02 00 00 00
>
>-1 * 6 00 00 01 00 00 1A

These both sound very handy! Thanks!

That just leaves the in-depot problem. As I'm sure you know, when consists
are displayed in a depot window, the horizontal spacing between vehicles is
reduced.

The problem I'm facing with that is that graphics are being produced that
when the trains are out of the depot, in the horizontal view, they take up
the full width, and buffers/corridor connections between vehicles join up.

Sadly, when viewing graphics drawn like this in the depot, the reduced
spacing leads to graphics over-lapping.

http://www.blugman.freeserve.co.uk/scr4.gif shows what I mean.

Ronnie
--
Volunteer guard on the Great Central Railway, Loughborough, Leicestershire
Visit the world's only double track preserved steam railway!
http://www.gcrailway.co.uk
 >> Stay informed about: Call backs tutorials or any help at all! 
Back to top
Login to vote
Michael Blunck

External


Since: Apr 11, 2004
Posts: 40



(Msg. 6) Posted: Wed Aug 25, 2004 10:30 pm
Post subject: Re: Call backs tutorials or any help at all! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ronnie Clark wrote:

[...]

> That just leaves the in-depot problem. As I'm sure you know, when
> consists are displayed in a depot window, the horizontal spacing
> between vehicles is reduced.

Yes, I´m aware of this.

> The problem I'm facing with that is that graphics are being
> produced that when the trains are out of the depot, in the
> horizontal view, they take up the full width, and buffers/corridor
> connections between vehicles join up.
>
> Sadly, when viewing graphics drawn like this in the depot, the
> reduced spacing leads to graphics over-lapping.
>
> http://www.blugman.freeserve.co.uk/scr4.gif shows what I mean.

Well, ATM there´s no cure for that overlapping problem. There´s only help for
the vertical alignment issue.

I have the same problem with the horizontal depot view, but I really don´t care
anymore ... :/

Apropos, another hint.

It *may* be that your engines resp. wagons are shifted horizontally accidentally
(unintentionally) because you modified their x/y-offsets during the process of
aligning them properly on-track. I.e. their alignment *looks* correct but
they´re *shifted* in one direction, nevertheless. If that´ll be the case,
they´ll be also misaligned in the depot window (there´s a "special" overlapping
between engine and first wagon in your picture).

A good method to test proper offset alignment is to stop a (preferably
symmetrically built, i..e. engine-waggon-waggon-engine) train and flip its
direction. If the train´s vehicles are well aligned the train wouldn´t "jump".
O/c this has to be tested in all four main directions ( / - \ | ), beginning
with the single engines ...

I found these "false" offsets also an additional contribution to the general
depot misalignment.

regards
Michael
 >> Stay informed about: Call backs tutorials or any help at all! 
Back to top
Login to vote
Display posts from previous:   
   Game Forums (Home) -> Transport Tycoon All times are: Ekaterinburg, Islamabad, Karachi, Tashkent (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]