CCG/Effects

From TrainzOnline
< CCG
Revision as of 10:55, 2 June 2011 by Pev (Talk | contribs)

Jump to: navigation, search

Contents

EFFECTS (optional mesh-table variables)

EFFECT: KIND NAME

Some assets may have editable signs. When you set an asset's name in surveyor through the Edit Properties icon ('?' icon) the signage can be set-up to automatically update. The variables can be set for each sign.

Typical Kind Name mesh table set-up You do not have to use the 0,1,2... block naming convention.

For the name effects described in the example, 0 could easily be mainsign or something more relevant to your model.

mesh-table
{
  default
  {
    mesh industry.lm
    auto-create 1
    effects
    {
      0
      {
        kind name
        fontsize 0.15
        fontcolor 30,30,30
        att a.name0
        name name
      }
      1
      {
        kind name
        fontsize 0.3
        fontcolor 30,30,30
        att a.name1
        name name
      }
    }
  }
}

Setting unique names may be useful for script purposes, so you can easily recognise a script reference for instance.

Breakdown of KIND NAME

kind name The effect kind

fontsize The size of the sign text

fontcolor The colour of the sign text in r.g.b.

att The sign text insertion point (part of the mesh). The attachment point must be orientated correctly in Blender, 3dsmax or gmax.

The diagram shows the correct orientation of the axis.

CCG text orientation.jpg


Points are placed in top view in 3dsmax/gmax. When aligning the point in 3DSMax or GMax, click on the Hierarchy - Affect Pivot Only option to examine the axis direction, turn off the Affect Pivot Only selection, and rotate the point itself to the correct orientation. Click on the Affect Pivot Only option again to check the new alignment. Make sure you rotate the point, not the axis.

name The default text when placed

When name name is specified, it uses the asset's changeable name option, changed through the Edit Properties icon (the `?' icon) in Surveyor.

If name Graceland (for example) were used, the sign would never be able to be changed, even though the user may have changed the asset's name in Surveyor. When you use the name tag, this name will appear in the minimap. In some instances the names will be hard to distinguish in a crowded map. For this reason, it may be advisable to limit the use of the name tag to objects that have a use for the attribute.


EFFECT: KIND CORONA

A corona is a `glow' light effect. It is a simple texture that is inserted at an attachment point within the mesh. Coronas can be added to any asset that uses a mesh-table.

Examples of coronas used in-game can be seen on the Cessna and the Airport tower all use flashing coronas.

Breakdown of KIND CORONA:

kind corona (required) The effect kind

att (required) The corona insertion point in the main mesh.(an attachment point)

texture-kuid (optional) Add this tag only when you want to specify your own texture for the corona. It specifies the KUID of a kind texture asset. See KIND TEXTURE.

Typical Kind Corona mesh-table set-up

mesh-table
{
  default
  {
    mesh asset.lm
    auto-create 1
    effects
    {
      0
      {
        kind corona
        att a.corona0
        texture-kuid <KUID:-3:10110>
        frequency 2
        directional 0
        object-size 0.20
      }
      1
      {
        kind corona
        att a.corona1
      }
    }
  }
}

If the texture-kuid tag is not present the corona will use the default yellow/orange texture in TRS.

frequency 2 (optional) This variable specifies the frequency in Hz (or `flashes' per second). e.g. 1 for once per second, 0.5 for once every 2 seconds, 2 for twice per second.

directional 0 (optional) The default for coronas is to be aligned to the attachment point to face the NEGATIVE Z direction. This is especially useful for Traincars.

Adding this tag over-rides this behavior, to make the corona always face the screen ­ useful for scenery objects.

object-size 0.15 (optional) Size of the corona on the object when viewed up close,


 Trainz released corona textures:
   · Yellow/orange corona     Default (if no texture-kuid)
   · Green corona             <KUID:-3:10110>
   · Red corona               <KUID:-3:10112>
   · White corona             <KUID:-3:10111>



EFFECT: KIND TEXTURE-REPLACEMENT

This effect was created for rolling stock items to swap the visible texture of bulk loads (such as coal or woodchips). If a coal car is set up to take any bulk load (which includes woodchips) the `coal' texture on the load mesh will update to a `woodchips' texture when it loads woodchips.

For detailed information on the setup of rolling stock load, see Page 375 .


EFFECT: KIND ATTACHMENT

In Trainz we have the ability to attach a mesh into another mesh by referencing it's KUID through a mesh-table. An example is the red display arrows for the fixed-track assets.

Rather than having an arrow in each fixed-track asset directory, we saved a lot of memory space by making the config.txt file reference a KUID of that mesh. Therefore,it only needed to be cached once. The mesh to be used should only be of kind scenery or kind mesh.

Kind Attachment example (fixed-track)

username FT 10 Deg 700m Rad
kind fixedtrack
kuid <KUID2:####:#######:1>
region Fixed track
preview-mesh-kuid <KUID:-3:10099>
mesh-table
{
  default
  {
    mesh 10-700.im
    auto-create 1
    effects
    {
      arrow0
      {
        kind attachment
        att a.track0a
        default-mesh <KUID:-3:10092>
        surveyor-only 1
      }
      arrow1
      {
        kind attachment
        att a.track0e
        default-mesh <KUID:-3:10092>
        surveyor-only 1
      }
    }
  }
}
attached-track
{
  track0
  {
    track <KUID:-1:15>
    vertices
    {
      0 a.track0a
      1 a.track0c
      2 a.track0e
    }
  }
}


WARNING: Never cross-reference a kind attachment KUID with the assets own KUID, unless of course you want to see an instant fatal error!

Fixed Track configuration used in this example

Arrow mesh config.txt (for reference)

 kuid <KUID:-3:10092>
 kind mesh
 mesh-table
 {
   default
   {
     mesh arrow.im
     auto-create 1
   }
 }

Breakdown of KIND ATTACHMENT:

Note that the example covers the information relating to the attachment. Additional entries for category region, era, trainz-build, etc. are necessary to make a complete config.txt file.

kind attachment (required) The effect kind

att (required) The insertion point of the attached mesh. In the example left, it is the origin of the `default' mesh.

default-mesh <KUID2:####:#######:1> (required) The KUID of the attached mesh.

surveyor-only 1 (optional) Adding this means the attached mesh will only be visible in Surveyor and not Driver. For tracks, this is especially handy so you know when it starts and ends, but it won't be there when driving around.

attached-track Information on the track to be attached to the model by Trainz. This includes a name for the track (track0), the track KUID to be used, and attachment points placed in the 3dsmax/gmax model to define the curve for the attached track to follow.

The points use the a.name naming convention, any names may be used, but using the "track" name (a.track0a) for rails, and the "road" name (a.road0a) is convenient. A specified road spline connection will generate road traffic.

See Page 91 for more details on using the attachment points and the special orientation of the axis at the ends of the track.


EFFECT: KIND ANIMATION

This effect is used when a mesh has a variety of animations. Usually the animations will be controlled by a script related to the asset. An example of the kind animation effect is the PB15 interior coalman. The script for this ties in the animations with the coal requirements of the steam locomotive.

coalman
  {
    mesh coalman/coalman.im
    auto-create 1
    att-parent default
    att a.coalman
    effects
    {
      shovel
      {
         kind animation
         anim coalman/coalman_shovel.kin
      }
      wave
      {
         kind animation
         anim coalman/Coalman_wave.kin
      }
  Etc...


Breakdown of KIND ANIMATION:

kind animation (required) The effect kind


anim (required) Reference to the animation file (.kin)

looped 1 (optional) Use only if the animation is looping (repeating). Default 0 (i.e. not looped).

speed 1 (optional) Speed factor of the animation. Default 1, 2 = Double speed and 0.5 = Half speed


The PB15 config.txt can be viewed on:

The PB15 interior script can be viewed on:

Personal tools