Weatherhill tender loader loco question

Here is the legend to some "Vehicle Types" in Trainz:
public define int TYPE_LOCOMOTIVE = 1; //!< Vehicle is a powered engine.
public define int TYPE_TENDER = 2; //!< Vehicle carries fuel for a locomotive (i.e. a tender attached to a steam locomotive).
public define int TYPE_HAS_INTERIOR = 4; //!< Vehicle has interior. Note that a vehicle does not have to be a Locomotive to have an interior.

By default, a vehicle has the type "0", which implies it does not fit into any other category, and is mostly given to non-powered wagons and carriages without interiors. The script I wrote for the Weatherill tender loader ascertains the vehicle type for each vehicle that enters the loading bay triggers. If the vehicle is NOT type "2" (tender), then the vehicle is rejected for loading. Since the K&L tenders are vehicle class "0", they are rejected. My understanding is that a vehicle with a config file with tags "category-class AS" and "engine 0" would be allocated vehicle class "2". Why this is not occurring in the case of the K&L tenders (with the "real-engine" tag temporarily changed to "engine"), I cannot say.
You may ask "Can't the tender's config file or script set the vehicle class directly to '2'?". To my knowledge, the answer is "no".

I can't thank you enough for your responses and for taking the time to help!

To see if I could get it to work, I changed line 45 of the script from:
if (VehicleType != 2) { // If vehicle is NOT a tender

to:
if (VehicleType != 0) { // If vehicle is NOT a tender

After making that change, it worked perfectly.

The track that has the loader on it is the lead track to the Enginehouse, I would not be running other cars on it except to re-load the loader. The cars I'm using to re-load the loader register as Vehicle Type is 4. I could just leave the loader with the modification to allow the loader to just trigger on Vehicle Type 0 but then if I do end up running any assets where the tender registers as type 2, it would not work.

Does trainz scripting allow for an "or" statement or something along those lines? If so would you be able to recommend the way to do that in this instance to allow it to work on Vehicles of Type 0 or 2? Even if you have a few ideas, but aren't quite sure what would work, if you'd be willing to share your advice, I'd be happy to try one or more suggestions until I find one that works, and I'd be glad to share the results.

Regardless of whether or not you have any further suggestions, thank you again.

-Mark
 
A tender should have the line tender 1 in the config file.

Peter

Thank you for the info, unfortunately I didn't see your response until after I posted my last response to ElStoko.

I've added the tender 1 tag to the config file for the tender and now the tender is identified as Vehicle Type 2.

ElStoko, I'll add the tag to all of the tenders to get them to work appropriately. To both ElStoko and p-dehnert: Thank you very much!

Regards and thanks,
Mark
 
Thanks for correcting my ignorance, Peter.
Mark, another curiosity is that you report the K&L loco has Vehicle Type '5' when it should be '1'. I think '5' is a tank engine, not a tendered engine. One thing to check is whether the loco's "category-class" tag has been mistakenly set to "AT" instead of "AS".
 
Thanks for correcting my ignorance, Peter.
Mark, another curiosity is that you report the K&L loco has Vehicle Type '5' when it should be '1'. I think '5' is a tank engine, not a tendered engine. One thing to check is whether the loco's "category-class" tag has been mistakenly set to "AT" instead of "AS".

Nope, all of the K&L locos I've looked at (checked 5 of them so far) have the "category-class" set to "AS".

I did find a note on the following page when trying to find out more about the "Vehicle type" earlier that indicated at "5" was a loco with an interior.

http://online.ts2009.com/mediaWiki/index.php/Class_Vehicle

Regards,
Mark
 
I think PCAS1986' comment is "on the money". The Vehicle Type flags comprise a 4-bit or 8-bit binary word. Non-powered vehicle w/o interior is binary-word 0000, loco w/o interior is 0001, tender is 0010 (decimal 2), non-powered vehicle with interior is 0100 (decimal 4), loco with interior is 0101 (decimal 5). If someone was silly enough to create a tender with an interior this would be 0110 (Decimal 6).
 
If someone was silly enough to create a tender with an interior this would be 0110 (Decimal 6).

Actually, such things do (did?) exist in the real world. I cannot recall the details but there was a tender built for long distance high speed express locos that had a crew passage running from front to rear. This was to allow crew changes while running. Reportedly you had to be slim to fit through it.
 
Actually, such things do (did?) exist in the real world. I cannot recall the details but there was a tender built for long distance high speed express locos that had a crew passage running from front to rear. This was to allow crew changes while running. Reportedly you had to be slim to fit through it.

I was thinking more along the lines of tenders with doghouses etc. It's possible some of those (the tender doghouses) could have an interior in Trainz.

-Mark
 
Actually, such things do (did?) exist in the real world. I cannot recall the details but there was a tender built for long distance high speed express locos that had a crew passage running from front to rear. This was to allow crew changes while running. Reportedly you had to be slim to fit through it.

It was the corridor tender designed by Sir Nigel Gresley and fitted to his A3s and A4s that you are probably thinking of. :)

Kieran.
 
Back
Top