KIND Interior

From TrainzOnline
Jump to: navigation, search

KIND Interior provides the basis for a building or vehicle interior, with or without control levers and dials.

This asset type inherits all mesh display characteristics, and adds interior-specific functionality such as control levers. Please read HowTo/Build a cab interior for a step-by-step guide to creating an Interior asset.

Contents

KIND Hierarchy

Parent Classes

Child Classes

  • none.

Supported Tags

Each interior asset supports the following tags. Each tag is shown here with its default value.


kind "interior"
cameralist
{
  camera0                               0,0,0,0,0
}
soundscript
{
}
cameradefault                           0
cabin-visible-from-outside              0
outside-visible-from-cabin              0
controlset                              ""
enable-shadows-in-cab                   1
mesh-table
{
}


cameralist

Type: CameraList Container
Desc: Lists the different camera view positions and orientations this interior has.

soundscript

Type: SoundScript Container
Desc: Details sounds that a cab interior can produce. Sounds may be triggered by the asset script, or by object animations.

cameradefault

Type: Integer
Desc: Defines which of the cameras in 'cameralist' is the default camera (the one selected when the user first goes into cab view mode). e.g. "cameradefault 3" will make "camera3" the default camera view.

cabin-visible-from-outside

Type: Boolean
Desc: If true, makes the cab mesh visible from the outside view.

This is intended for objects with simple but obviously visible cab controls that are not enclosed - e.g. the controls to operate a transfer table. It would be far too much of a performance impact to use this on locomotive models, as locomotive cabs are very performance intensive.

outside-visible-from-cabin

Type: Boolean
Desc: If true, makes the loco body mesh visible while in the cab interior view.

This is intended to be used with an interior where the cab controls that are not in an enclosed space - e.g. a transfer table. While using this on a traincar is not considered problematic from a performance perspective, please note this will require a very carefully designed cab and loco asset - both the inside of the loco mesh and the cab interior will be visible at the same time, and unless done very carefully, this is likely to cause graphical problems with overlapping polygons and unexpectedly visible or opaque surfaces.

controlset

Type: KUID
Desc: Specifies a controlset asset used to send script messages to this interiors custom script. Optional.

enable-shadows-in-cab

Type: Boolean
Desc: If true (1), makes the cab interior receive shadows. Note that this will cast a shadow of the interior onto the environment when viewed from the interior camera. It's therefore preferable that the interior mesh preserves the basic shape of the vehicle if you wish to apply this setting.

interior-controls-type

Type: Text String
Desc: Specifies the type of the control. Types are
  • none (non-powered car)
  • hostler (driveable B unit or cab car)
  • full (loco)
Compulsory from 3.8.

mesh-table

Type: MeshTable Container (Interior version)
Desc: All the meshes for the cab interior (the shell itself, along with all the controls and gauges) are listed here. A mesh table for an interior has a number of additional options that a normal mesh table does not.

Example Config.txt

Sample config.txt file for a interior asset, with the Standard Tags excluded for brevity:


kind                                    "interior"

cameralist
{
  camera0                               -1.236,0.173,0.392,0.511,-0.155
  camera1                               -1.278,-0.176,0.392,0.511,-0.155
  camera2                               -1.247,0.344,0.52,6.708,-0.403
  camera3                               -0.113,0.965,0.52,6.312,-0.377
  camera4                               1.35,0.15,0.52,5.71,-0.265
  camera5                               1.374,0.208,0.205,6.048,-0.06
  camera6                               -0.754,0.926,1.011,6.636,-0.516
  camera7                               -1.293,0.449,0.459,6.757,-0.342
}
cameradefault                           0

mesh-table
{
  default
  {
    mesh                                "c_interior.im"
    auto-create                         1
  }
  
  wheelslip_light
  {
    kind                                "light"
    mesh                                "wheelslip_light.im"
    auto-create                         0
  }
  
  bptrainbrakepipe_needle2
  {
    kind                                "digital-dial-prs"
    mesh                                "brakeneedle.im"
    att                                 "a.brakepipe2"
    limits                              0,55
    font                                "arial"
    fontsize                            0.007
    fontcolor                           80,240,120
    auto-create                         1
  }
  
  speedo_needle2
  {
    kind                                "digital-dial-spd"
    mesh                                "brakeneedle.im"
    att                                 "a.digispeedo"
    limits                              0,55
    font                                "arial"
    fontsize                            0.01
    fontcolor                           0,0,0
    auto-create                         1
  }
  
  throttle_lever
  {
    kind                                "lever"
    mesh                                "throttle.im"
    att                                 "a.throttle"
    limits                              0,8
    angles                              0,1.69
    notches                             0,0.125,0.25,0.375,0.5,0.625,0.75,0.875,1
    notchheight                         1,2,2,2,2,2,2,2,1
    radius                              0.35
    mousespeed                          -1
    auto-create                         1
  }
  
  dynamicbrake_lever
  {
    kind                                "lever"
    mesh                                "dynamic_handle.im"
    att                                 "a.dynamic"
    limits                              0,2
    angles                              0,-1.69
    notches                             0,1
    notchheight                         0.1,1
    mousespeed                          -1
    radius                              0.35
    auto-create                         1
  }
  
  trainbrakelap_lever
  {
    kind                                "lever"
    auto-create                         1
    mesh                                "trainbrake_handle.im"
    att                                 "a.trainbrake_handle"
    limits                              0,4
    angles                              0,-2
    notches                             0,0.25,0.5,0.75,1
    notchheight                         2,2,2,2,2
    mousespeed                          1
  }
  
  independantbrake_lever
  {
    kind                                "lever"
    mesh                                "indy_handle.im"
    att                                 "a.ind"
    limits                              0,32
    angles                              0.94,0
    notches                             0,0.5,1
    notchheight                         1,1,1
    radius                              0.35
    mousespeed                          1
    auto-create                         1
  }
  
  flow_needle
  {
    kind                                "needle"
    mesh                                "flowneedle.im"
    att                                 "a.bpflow"
    limits                              0,1050
    auto-create                         1
  }
  
  bplocomain_needle
  {
    kind                                "needle"
    mesh                                "brakeneedlered.im"
    att                                 "a.mainres"
    limits                              0,1240
    auto-create                         1
  }
  
  bploco_equaliser
  {
    kind                                "needle"
    mesh                                "brakeneedle.im"
    att                                 "a.eqres"
    limits                              0,1240
    auto-create                         1
  }
  
  bptrainbrakecylinder_needle
  {
    kind                                "needle"
    mesh                                "brakeneedlered.im"
    att                                 "a.brakecyl"
    limits                              -50,1390
    auto-create                         1
  }
  
  bptrainbrakepipe_needle
  {
    kind                                "needle"
    mesh                                "brakeneedle.im"
    att                                 "a.brakepipe"
    limits                              0,1240
    auto-create                         1
  }
  
  speedo_needle
  {
    kind                                "needle"
    mesh                                "speedo_pointer.im"
    att                                 "a.speedo"
    limits                              0,43
    auto-create                         1
  }
  
  ampmeter_needle
  {
    kind                                "needle"
    mesh                                "needleamps.im"
    att                                 "a.ampmeter"
    limits                              0,1700
    angles                              0,3.02058
    auto-create                         1
  }
  
  reverser_lever
  {
    kind                                "lever"
    mesh                                "reverser_handle.im"
    att                                 "a.throttle01"
    limits                              0,2
    angles                              -0.55,0.55
    notches                             0,0.5,1
    notchheight                         1,1,1
    mousespeed                          -1
    auto-create                         1
  }
  
  right_sliding_window
  {
    mesh                                "window1.im"
    auto-create                         1
    att                                 "a.window1"
    att-parent                          "default"
    limits                              0,1
    angles                              0,-0.009
    notches                             0,1
    notchheight                         1,1
    kind                                "lever"
  }
  
  right_sliding_window2
  {
    mesh                                "window2.im"
    auto-create                         1
    att                                 "a.window2"
    att-parent                          "default"
    limits                              0,1
    angles                              0,0.009
    notches                             0,1
    notchheight                         1,1
    kind                                "lever"
    mousespeed                          -1
  }
  
  left_sliding_window
  {
    mesh                                "window3.im"
    auto-create                         1
    att                                 "a.window3"
    att-parent                          "default"
    limits                              0,1
    angles                              0,-0.009
    notches                             0,1
    notchheight                         1,1
    kind                                "lever"
    mousespeed                          -1
  }
  
  left_sliding_window2
  {
    mesh                                "window4.im"
    auto-create                         1
    att                                 "a.window4"
    att-parent                          "default"
    limits                              0,1
    angles                              0,0.009
    notches                             0,1
    notchheight                         1,1
    kind                                "lever"
    mousespeed                          1
  }
  
  light_switch
  {
    kind                                "lever"
    att                                 "a.hdlt"
    mesh                                "hdltswtch.im"
    limits                              0,1
    angles                              0,2
    notches                             0,1
    notchheight                         0.1,0.1
    mousespeed                          -1
    auto-create                         1
  }
  
  horn
  {
    kind                                "pulllever"
    mesh                                "horn.im"
    att                                 "a.horn"
    auto-create                         1
    angles                              0,-0.55
    limits                              0,1
    mousespeed                          -1
    radius                              -0.02
    notches                             0,1
    notchheight                         0,0
  }
}


Note: Mesh table entry speedo_needle is required to update speed information on a RailDriver console.

Custom Sounds

Overview

It is possible to assign custom sounds to cabin controls without using a custom script. This can be performed via the addition of a 'cabin.txt' configuration file to an interior asset. The cabin.txt and custom sounds files must be placed in the an asset sub-directory named 'sounds'.

Cabin.txt File Format

The cabin.txt file lists 1 sound even per row, with each sound event defined by three space separated values. Empty rows are permitted and will be safely ignored. Each sound event requires the following three values:

Target

The name of the mesh-table entry for the mesh of the cabin control.

Event

The name of a cabin control event which will trigger the sound. The full list of supported events is as follows:
mouseenter :- Triggered when the players mouse hovers over the control
mouseleave :- Triggered when the players mouse was over the control but no longer is
mousedown :- Triggered when the player presses a mouse button while over the control
beginselect :- Triggered when the player actives a control, i.e. selects it
mouseup :- Triggered when the player releases a mouse button while over the control
endselect :- Triggered when the player deselects a control
change-notch :- Triggered on notched controls only, whenever the player moves the control one notch
lever-low :- Triggered on lever type controls, when the lever is moved to the lowest position
lever-high :- Triggered on lever type controls, when the lever is moved to the highest position
looping :- Triggered when a control is moved to notch 1, this sound will play in a loop until the control is changed. A typical use for this would be a fire sound while the firedoor of a steam train is open.

Tips

Some lever types will only create a sound based on the correct event type. Below is a chart to describe which events will work with the correct lever type. It is a work in-progress and is not fully complete:

Event tag chart
Lever Type Event tag Notes
animated-lever change-notch , beginselect, lever-high, lever-low Change-notch and beginselect are good choices for animated levers.
lever change-notch , beginselect, lever-high, lever-low Change-notch and beginselect are good choices for levers.
pulllever change-notch , lever-high, lever-low change-notch will only create a sound for each notch in a pulllever, which is typically the starting and ending position.
pullrope change-notch , lever-high, lever-low change-notch will only create a sound for each notch in a pullrope, which is typically the starting and ending position.
switch beginselect switch seems to only react to beginselect.
button unknown unknown

Sound File

The file-name of the sound to play (relative to the 'sound' sub-directory)

Below is an example of a cabin.txt file which will assign custom sounds to the reverser and windows of the example config.txt file above.

 reverser_lever lever-low reverser_notch.wav
 reverser_lever lever-high reverser_throw.wav
 
 right_sliding_window change-notch window_open.wav
 right_sliding_window2 change-notch window_open.wav
 left_sliding_window change-notch window_open.wav
 left_sliding_window2 change-notch window_open.wav
 handbrake_wheel looping handbrakemove.wav //
 cool_switch beginselect click.wav // Note this is a kind "switch"

Material/Textures

For best visual results you should make sure there isn't anything below the gray color (R:100, G:100, B:100) in the red channel of the parameters texture (see TRS19 material - m.pbrmetal - for more information on the parameters texture). You can have higher (whiter values) but RGB:100 is probably the minimum you'll want to go with to make things clear in-cabs.

In-cab rgb100.jpg

Downloads

Attach sample files here?

Categories

Personal tools