CCG/Modelling: Load Texture Replacement

From TrainzOnline
< CCG
Revision as of 15:23, 15 June 2011 by Pev (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Load Texture Replacement

This feature was created for rolling stock items that use animated bulk loads.

If a rolling stock item (say a Gondola) is setup to carry any product within product-category `Bulk Load', AND it's config.txt file is set up to enable texture replacement, then a texture replacement on the load mesh will take place to visually represent the product.

Let us break down the texture-replacement setup

Texture swapping functionality relies on 2 things:

1) The rolling stock item config.txt to include with `product-texture' load effects setup (see Rollngstock examples 1 and 2 below).
2) The product config.txt itself needs product-texture information and reference to the texture to be loaded (see product examples on Page 374).


Rollingstock Example 1

COAL HOPPER

Load allows texture replacement:

Note: The load_map.tga texture file is the original texture used on the mesh in 3DSMax, and is to be replaced. The load_map.texture.txt file references this texture to be replaced in Trainz by a different texture for the new product (see load, effects, product-texture in config.txt).

The original texture size and the mapping on the mesh will effects the appearance of the replacement texture.

Default product load:

COAL <KUID:44179:60013> (see product-kuid field in config.txt)

Can take product-category:

BULK LOAD <KUID:-3:10040> (see allowed-categories field in config.txt)


When the Coal hopper enters an industry asset that produces a bulk-load other than it's default (ie. woodchips at a lumbermill), and it loads this product, texture-replacement will take place.

Coal Hopper Directory Structure

Extract from Coal Hopper Config.txt

mesh-table
{
  default
    {
      mesh coal_hopper_body/coal_hopper_body.lm
      auto-create 1
    }
  shadow
   {
      mesh coal_hopper_shadow/coal_hopper_shadow.pm
   }
 load
   {
      mesh coal_hopper_body/load/load.pm
      anim coal_hopper_body/load/load.kin
      auto-create 1
      use-parent-bounds 1
      effects
        {
          product-texture
            {
               kind     "texture-replacement"
               texture  "load_map.texture"
            }
        }
   }
}
queues
{
  load0
    {
      size              54300
      initial-count     0
      animated-mesh     "load"
      product-kuid      <KUID:44179:60013>
      allowed-categories
        {
          0             <KUID:-3:10040>
        }
    }
}


Rollingstock Example 2

WOODCHIP GONDOLA

Load allows texture replacement. Note the texture to be replaced (load_map). (see load, effects, product-texture in config.txt)

Default product load:

WOODCHIPS <KUID:-3:10002> (see product-kuid field in config.txt)

Can take product-category:

BULK LOAD <KUID:-3:10040> (see allowed-categories field in config.txt)

When the Woodchip Gondola enters an industry asset that produces a bulk-load other than it's default (ie. coal at a coalmine), and it is loads this product, texture-replacement will take place.


Woodchip Gondola Directory Structure

Extract from Woodchip Gondola Config.txt

mesh-table
{
  default
    {
       mesh               "woodchip_gondola_body/woodchip_gondola_body.lm"
       auto-create        1
    }
  shadow
    {
       mesh               "woodchip_gondola_shadow/woodchip_gondola_shadow.im"
    }
  load
    {
       mesh               "woodchip_gondola_body/load/load.im"
       anim               "woodchip_gondola_body/load/load.kin"
       auto-create        1
       use-parent-bounds  1
       effects
         {
           product-texture
             {
               kind       "texture-replacement"
               texture    "load_map.texture"
             }
         }
    }
}
queues
{
  load0
    {
      size                60500
      initial-count       0
      animated-mesh       "load"
      product-kuid        <KUID:-3:10002>
      allowed-categories
        {
          0               <KUID:-3:10040>
        }
    }
}

As a rolling stock item with texture-replacement enabled has reference to the texture to be replaced, the product has reference to the texture that will be used in its place.


Product Example 1:

COAL PRODUCT

In the case of the coal product, the texture to be used is `coal.tga', i.e. if the woodchip gondola enters the coal mine to load coal, the load-map texture will be replaced with coal.tga.


Coal Product Directory Structure

Coal Product Config.txt

kind               product
kuid               <KUID:44179:60013>
username           "Coal"
instance-type      "resource"
product-category   <KUID:-3:10040>
icon-texture       "icon_texture.texture"
mass               0.860
product-texture    "coal.texture"
mesh-table
{
}


coal.texture.txt

Primary=coal.tga
Tile=st



Product Example 2:

WOODCHIP PRODUCT

In the case of the woodchip product, the texture to be used is `woodchips.tga' I.e. If the coal hopper enters the lumber mill to load woodchips, the load-map texture will be replaced with woodchips.tga.


Woodchip Product Directory Structure

Woodchip Product Config.txt

kind               product
kuid               <KUID:-3:10002>
username           "woodchips"
instance-type      "resource"
product-category   <KUID:-3:10040>
icon-texture       "icon_texture.texture"
mass               0.400
product-texture    "woodchips.texture"
mesh-table
{
}


woodchips.texture.txt

Primary=woodchips.tga
Tile=st


TrainCar Directory Structure

The following example is of a typical Coal hopper.

This asset has an animated load (typical for bulk load rolling stock) and animated unload doors (specific to this asset). These doors are controlled by the hopper.gs script file.

Typical Directory Structure

CCG coal hopper dir1.jpg


Expanded Directory Structure




CCG coal hopper dir2.jpg
Primary=coal_hopper_art_512.tga
Alpha=coal_hopper_art_512.tga
Tile=st
Hint=Dynamic

(512x512 pixel 32-bit .tga file)


(128x64 pixel 32-bit .tga file)


'Load' animation file. Referenced through the config

'Load' mesh file. Referenced through the config

Exporter generated txt file

Load texture.


The grey area indicates optional files. The load files are essential for visualisation of the TRS bulk load product such as coal or woodchips.




The hi-res mesh in level of detail mesh reduction

LOD file (.lm). Ref. through default-mesh in config.

The low-res mesh in level of detail mesh reduction

24-bit .tga file

Default textures for shadows

Shadow mesh.

Wave sound files. Timing controlled through script.

Config.txt and Hopper.gs (script) files. Refer:

http://www.auran.com/TRS2004/trssp4dl/dfile.php?FileID=10


Previous Page . . . . Next Page

Return to CCG Index

Content Creator's Guide

Personal tools