Help with Ben Neal flatcar kitbash?

etupmantoot321

New member
I'm trying to kibash Ben Neal's ACL P11 flatcar model into a 40 foot TOFC flatcar. It looks great so far and I'll definitely show off pictures later (when I figure out how to upload them somewhere and link them) but I'm having issues with it such as

1. The chameleon script does not register, showing the flatcar skin as it appears in the flatcar asset itself (and not the skin library asset). Previously, you could click it with Edit Properties and then exit out of Edit Properties, when it then loads one of the skins from the library asset. It stopped doing that after I added the TOFC appliances (fifth wheel and little tiny side walls), but after trying a fix (see below) it reverted back to only working when exiting the Edit Properties UI

2. Instant Load Command doesn't work the way I'd like it to, which is to immediately load the train with random types/paint jobs of trailers (I'm using Dinorius_Redundicus's Fruehauf trailer commodities). Instead it picks one type of trailer and loads the entire consist of flatcars with that trailer, unless broken apart by a different freight car, after which it picks a new trailer and loads the rest of the consist with that

3. Bump maps are a pain and make it look like it's fresh out of soaking rain, so I'd like to figure that out

What I've done to try to correct these:

1. I tried using scripts from Ace Raziel's reskin of this flatcar (it uses 2 scripts instead of 1) but the same thing happens

2. I tried comparing to how the Instant Load Command loads wellcars with so many different kinds of containers and looking in the configs of those wellcars, but the load parts of the config look identical. Then I tried using multiple queues so that 1 type of trailer was in its own queue (previously all the individual trailers were in one queue), but yielded the same results

3. I'm just going to learn how to make bump maps and worry about that later

Ideas I have that might work:

1. No idea

2. Make one commodity that aliases every trailer?

3. No idea

If anyone has any ideas that could fix any of these problems, they would be much appreciated!
 
Which version of Trainz will the modified flatcar be made for (specifically, what trainz-build number will it have in its config.txt file?). And what type of texture materials are your normal (bump) maps being used in - eg. m.tbumptex or m.pbrmetal ?

If by “soaking rain” you mean the texture looks too shiny, then the way to reduce that varies according to the material type. If you can nominate the material type, sensible answers can be given.
 
johnwhelan - The kuid of the car I have installed and cloned from is <kuid2:96914:15600:4>, the original kuid is <kuid:96914:15600>

Forester1 - Thank you!

Dinorius_Redundicus - The trainz-build listed in the config file is 2. I don't know how far back that goes to but I would assume Trainz 2009, 2010 or Trainz 12. The top portion of the flatcar is wood, but the sides and frame are all painted steel. If you meant material defined in the .im, then I'll check that out.

Here are some pictures of the flatcar and it's skins:

Consists-of-fictional-Albany%2C-Chicago-and-Great-Lakes-Railroad-early-trailer-on-flatcar-rolling-stock%2C-rebuilt-from-older-flatcars.jpg


The picture for the first skin is having a URL error, so here are the other 2 car skins:

Albany%2C-Chicago-and-Great-Lakes-Railroad-trailer-on-flatcar-flatcar%2C-class-SF275%2C-a-few-hundred-miles%27-worth-of-weathering.jpg
Albany%2C-Chicago-and-Great-Lakes-Railroad-trailer-on-flatcar-flatcar%2C-class-SF275%2C-a-few-thousand-miles%27-worth-of-weathering.jpg
 
Natalie,

Trainz-build 2 indicates TRS2004. That version of Trainz supported texture material types m.notex, m.onetex and bump-mapped types like m.tbumptex and some others, but not PBR materials. I would need to look at the .im and texture.txt files to see exactly what materials Ben used. The kuids you quoted for the flatcars don’t seem to be available on the Download Station, so I can’t do that.

The flatcars don’t look excessively shiny to me, so I’m still not sure what you meant by rain-soaked. In any case, I don’t think the appearance is your main problem. Scripting issues are way beyond me, but seem more important.
 
Last edited:
I agree the scripting/queueing is priority before looks right now. I removed the bump maps from the car for now (what you're seeing is just the diffuse map), but here's what it looks like with the bump map:

My-Trainz-Screenshot-Image.jpg


I'd like it to be known that some things (script replacements + bump map) were taken from Ace Raziel's reskin of the car on Trainz Forge for his 40ft Ten Peaks Railway flatcar (a reskin of the same flatcar I used) and will be replaced (or uploaded with permission) if/when I get around to releasing this car.
 
Neither look “wet”, so I still don’t know what you mean by rain-soaked. Also not clear if both, or only one of those flatcars has a normal map material. If you’re referring to how the one on the left is darker, the addition of a normal map should not produce that effect. Perhaps it’s a texture configuration problem, but without looking into the details of the .im file, the normal map and the texture.txt files, it’s impossible to say anything meaningful.
 
The left one has the normal and the right is just the diffuse texture. I think a better way to describe it is that the wood on the bump car looks too shiny to be wood. I don't know how bump maps do what they do so maybe I just need to find some tutorials on bump maps. If I can make the wood parts less shiny this would look so unbelievably amazing
 
If I can make the wood parts less shiny this would look so unbelievably amazing

In legacy normal-mapped materials such as the ones you likely have here, the shininess (specular reflection) of each pixel in the texture is controlled by the whiteness of the alpha channel pixels in the normal map. The closer they are to pure white, the brighter the shine. The alpha channel has nothing to do with bumps, only shininess.

The first thing to do is check that the normal map even has an alpha channel. If it has no alpha (i.e. just the RGB colour channels, a 24-bit image), shininess will default to maximum, as if the whole channel is pure white. So you will need to use a graphics program to add an alpha channel. This will make it a 32-bit image. Then edit the alpha using shades of grey to reduce the specular shine or even black to eliminate shine totally. Remember, this is per-pixel control, so you can make some parts of your texture shiny and others not so shiny, depending on what they are. For instance, the areas corresponding to old wood in the diffuse image would be a darker grey (less shiny) in the normal map alpha channel. Areas corresponding to painted metal with some degree of shine, would be a lighter grey in the normal alpha.

You should also check the texture.txt files of the material and make sure the diffuse and normal maps are correctly configured. Texture.txt files for a fully opaque m.tbumptex material using an image called diffuse.tga (a 24 bit image) and a normal map called normal.tga (a 32 bit image) look like this;

diffuse.texture.txt
Primary=diffuse.tga
Tile=st

normal.texture.txt
Primary=normal.tga
Alpha=normal.tga
NormalMapHint=normalmap
Tile=st

Refer to the Wiki for full descriptions on how to construct materials. The materials of interest here will be under the Legacy Materials section.
https://online.ts2009.com/mediaWiki/index.php/Material_Types
 
Last edited:
1. The chameleon script does not register, showing the flatcar skin as it appears in the flatcar asset itself (and not the skin library asset). Previously, you could click it with Edit Properties and then exit out of Edit Properties, when it then loads one of the skins from the library asset. It stopped doing that after I added the TOFC appliances (fifth wheel and little tiny side walls), but after trying a fix (see below) it reverted back to only working when exiting the Edit Properties UI

2. Instant Load Command doesn't work the way I'd like it to, which is to immediately load the train with random types/paint jobs of trailers (I'm using Dinorius_Redundicus's Fruehauf trailer commodities). Instead it picks one type of trailer and loads the entire consist of flatcars with that trailer, unless broken apart by a different freight car, after which it picks a new trailer and loads the rest of the consist with that

1. Regarding the Chameleon script, none of my trailers or TOFC devices were designed to work with it, so I'm not surprised it doesn't register. To find assets that do work with it, you would probably need to do some fancy filter searching in Content Manager - highlight the chameleon skin library and then List Dependants. My guess is that it will find any that happen to be installed. I doubt that it can find dependants that are only on the DLS.

And if those fifth wheel TOFC devices are mine, they are simply "products" in their own right, so when loaded on a flatcar they occupy the position and prevent the addition of anything else on top. They were only created so that plain flatcars could be made to look like empty TOFC flatcars.

2. I think the reason the Instant Load command doesn't load random instances of my Fruehauf trailers is because each one is configured as an individual load and doesn't allow "mixing". I have made a couple of Product assets that do support a random mix of vehicles on auto-transporter railcars;

<kuid2:68213:60032:1> Trucks Chevy Cheyennes
<kuid2:68213:60031:1> Cars Chev Impala 1959

I suppose I could try a similar thing with Fruehauf trailers that have TOFC devices built-in as part of their meshes. I just never thought of doing that.
 
Last edited:
1. The trailers don't have to work with the Chameleon script, just the flatcar skins

2. The trailer commodities I use aren't the ones with TOFC rigging, though I'm sure versions of those would be plenty appreciated. The rigging is a clone of a Fruehauf with outside rigging with the trailer alpha'd out, set as a "scenery" item, and aliased in the config of the flatcar to attach to a.load1 (located at the center point of the top of the car). I like the look of the empty flatcar with TOFC rigging still installed. I'll try cloning some of the trailer commodities and try to make it automatically random and see how that works out. My first idea for a solution was to make a commodity that's a library asset which aliases the trailers or maybe has the trailer meshes and texture files included with the library asset, and I have yet to try that.
 
The rigging is a clone of a Fruehauf with outside rigging with the trailer alpha'd out, set as a "scenery" item, and aliased in the config of the flatcar to attach to a.load1 (located at the center point of the top of the car).

Why would you bother doing all that when the TOFC rigs themselves are available for free and don't have the computationally inefficient "alpha'd out" stuff?

<kuid2:68213:60011:1> TOFC hitch 35ft 01
<kuid2:68213:60012:1> TOFC hitch 35ft 02

I prefer that you don't clone and modify my assets.
 
I'll see what I can do about replacing the TOFC rigging. I think I can set it as a commodity that spawns with the car and doesn't conflict with other loads. Thank you for telling me 😁

The material type is m.tbumptex, the bump map is a solid purple color while the alpha is a transparent purple. Here is what the bump.texture.txt looks like:

Primary=acfflat_bump.png
Alpha=acfflat_bump.png
Tile=
NormalMapHint=normalmap
MipAlgorithm=no-weight-by-alpha

The alpha is marked as itself, but included is a .tga with the same name that looks like a pretty good alpha channel. I've marked alpha as Alpha=acfflat.bump.tga (as well as changed the tiling method to Tile=st), and here's what that looks like. Left is tbump, right is just regular diffuse

My-Trainz-Screenshot-Image.jpg


The wood isn't crazy shiny like before, which is good! New problem is that I'd like the metal to look a little shinier but tweaking the alpha channel doesn't do much if anything. All I'm doing to change the alpha channel is increasing and decreasing the opacity of the alpha channel because I'm pretty sure it has to be the same purple color. Switching the alpha channel back to acfflat_bump.png makes the metal part shine, but it does that to the wood too.
 
First up, a correction. I had written in my post #10 that the texture.txt file for a normal map should have the line AlphaHint=NormalMap. That's wrong. It should be NormalMapHint=normalmap, as in your copy of the file. I've corrected my post.

The combined RGB channels of a normal map are usually a purple colour, but the alpha channel should be greyscale (or grayscale), definitely not purple or any other colour.

The alpha channel in the normal map of an m.tbumptex material only affects specular shine, it does not produce or control opacity. Opacity in this material is controlled by an alpha channel in the Diffuse map. White alpha areas are opaque, grey alpha areas semi-transparent, black alpha areas are invisible. I don't know if the flatcar uses opacity or not, but if it does, and the name of the Diffuse image is acfflat.png;

The contents of the diffuse map configuration file acfflat.texture.txt should be;

Primary=acfflat.png
Alpha=acfflat.png
Tile=st
AlphaHint=masked (or possibly 'semitransparent' if that's what is needed)


The contents of the normal map configuration file acfflat_bump.texture.txt should look like;

Primary=acfflat_bump.png
Alpha=acfflat_bump.png
Tile=st
NormalMapHint=normalmap
MipAlgorithm=no-weight-by-alpha

For efficiency reasons, it's better to control everything (bumps and specular strength) from the one file, so I think you can get rid of the acfflat_bump.tga and just use acfflat_bump.png. You will need a graphics program that can create, edit and save PNG files with an alpha channel of course. Not all of them can do that.

If the desired shiny areas don't turn out to be shiny enough, it could be for a couple of reasons;

- You are looking at legacy materials in TRS2019 or TRS2022. They are built to handle PBR materials, but do a bad job on the specular shine of some legacy materials.

- T:ANE and previous versions of Trainz do display the intended specular shine correctly, but it might be limited by a maximum specular strength setting which affects the whole material, not just selected pixels. This is a numerical parameter that the creator chose for the material set-up in the 3D creation program. It is probably best left alone, but I think it can be changed using a utility called IM Editor if you were really interested.

I hope that clears up some misconceptions.
 
Last edited:
I don't understand how an alpha channel in the diffuse map controls the opacity of the m.tbumptex material. Just looking at it, it looks like it's just going to alpha out the diffuse map. I copied all the information into their respective .texture.txt's, and the car was completely alpha'd out except for the white lettering. I then switched the acfflat.texture.txt AlphaHint=semitransparent, and it had the same results.

I have a different idea if this ends up not working out at all. I could, in theory, copy all the wood parts to a separate .tga, alpha out the wood parts on the original, then create a new .im file with separate m.tbumpenv parameters and whatnot just for the wood parts.
 
This copied directly from the Wiki;

m.tbumptex

This is a legacy material and should only be used where compatibility with older versions of Trainz is required.
m.tbumptex is a bump mapped material.

Opacity = Per-texel opacity can be controlled via the diffuse texture's alpha channel.
Specular = Per-texel specular strength can be controlled via the normal texture's alpha channel.


That's exactly what I said above.

Without having the flatcar here with me to inspect mesh and textures, it's rather difficult for me to say what's going wrong or even ask the right questions. If the whole railcar, apart from some text, is being rendered as invisible, it suggests your diffuse alpha is mostly pure black apart from the text being white. What do the diffuse RGB and diffuse Alpha images look like?
 
Dinorius_Redundicus, I just wasn't listening. Before you replied I did read the wiki page for m.tbumptex and something must have clicked that I wasn't understanding before. I made the alpha channel dark grey/light grey and it works perfectly. The normal map I used was very flat, so I installed a plugin for Paint.NET that turns any image into a normal map. It looks amazing now!


My-Trainz-Screenshot-Image.jpg

My-Trainz-Screenshot-Image.jpg


Now just the script and queueing issues to go...
 
Back
Top