Hi all,
I've only recently gotten back into creating new graphics for TTDPatch, and as a former coder I would like to brush up on my skills so that hopefully I can help a set or two get completed.
One thing that puzzles me, despite hunting around on here and on the TTDPatch Wiki for an hour or so is just to what extent callbacks can be used to change various wagon properties. It is my understanding that:
- A wagon length can be changed
- A wagon can be prevented from being added to a train
- A wagon's properties can be changed
...Along with a whole load of other stuff (I really want to get the hang of coding again, as deep down I've been a computer programmer for 21 years).
Am I right in thinking that if there is a need to drastically reduce the number of vehicle IDs that are used by rolling stock, this can be achieved by having say just three or four different items of rolling stock, each then refittable as needed, grouped by similar cargo types, and setting which lead vehicle-type it can and cannot be added to? If so, whilst making the coding a nightmare, it will greatly free up the number of vehicle IDs to be used elsewhere.
That paragraph is a bit of a mess, so an example I was thinking of:
- A vehicle ID could be used for a purely cosmetic brake van to run in the set.
- This brake van could be of different length, speed limit, etc., depending on which train-engine is used.
- The brake van can also be banned from being added behind certain train-engines, eg. to disallow adding it to the rear of a modern DMU.
- The brake van can also 'double up' as a tender for steam locomotives using articulated vehicle callbacks.
How many of the above assumptions are true, close but no cigar, or just wildly laughable? As I say, I would really like to get my hand back into coding as it seems to me that there are a lot of sets that have artists but are lacking a coding, and as I have an awful lot of free time on my hands these days (my 'day job' is to do nothing, believe it or not!), so any help given could be mutually benefitial to the TTD community.
Ronnie
Using callbacks to change wagon properties
Moderator: Graphics Moderators
Using callbacks to change wagon properties
Any TT, TTD or OTTD sprites I have ever posted to this forum or elsewhere may be used as-is or in edited form free of charge for any purpose without credit in perpetuity.
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Using callbacks to change wagon properties
Some would be a bit harder to achieve but in general everything from your list should be doable. For examples please see my callback tutorial examples.Ronstar wrote:[...] How many of the above assumptions are true [?]
HTH
regards
Michael
Re: Using callbacks to change wagon properties
None of those would be any problem at all.Ronstar wrote:How many of the above assumptions are true, close but no cigar, or just wildly laughable?

Re: Using callbacks to change wagon properties
Hmm, though you did not explicitly wrote it:
You can change the length of a wagon depending on the front engine, but you cannot decide the number of articulated parts of a wagon depending on the front engine. I.e. the number of articulated parts is fixed once the vehicle is bought, and cannot change when attaching a wagon to a front engine.
You can change the length of a wagon depending on the front engine, but you cannot decide the number of articulated parts of a wagon depending on the front engine. I.e. the number of articulated parts is fixed once the vehicle is bought, and cannot change when attaching a wagon to a front engine.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Re: Using callbacks to change wagon properties
Hi all, thanks for the replies. I guess I should get reading up then on how to actually do any of these things!
Frosch: I think I understand that, but I think using the other advice of using callbacks to use the vehicle's own ID to make the tender should circumvent that problem, right?
Ronnie
Frosch: I think I understand that, but I think using the other advice of using callbacks to use the vehicle's own ID to make the tender should circumvent that problem, right?
Ronnie
Any TT, TTD or OTTD sprites I have ever posted to this forum or elsewhere may be used as-is or in edited form free of charge for any purpose without credit in perpetuity.
Who is online
Users browsing this forum: Semrush [Bot] and 10 guests