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