Class AssetCategory

From TrainzOnline
Jump to: navigation, search


AssetCategory is a static class used to define the types of searchable categories for assets and objects.

Cateogory codes may also be combined to narrow your search by using the semicolon (;) character. For example you can search for grass/tree splines by using "Flora;Spline". You can also broaden a search to include multiple category lists using the vertical bar (|) character. Each vertical bar acts as an OR operator on the lists. For example you can search for flora or fauna splines using "Spline;Flora|Spline;Fauna"(i.e. *NOT* "Spline;Flora|Fauna" which would match all flora splines, and any fauna tagged object/spline/etc).

Content creators can also add custom category codes to their assets via the category-class tag. Such codes are prefixed with the '#' character (e.g. "#CITY"). These may be used freely to allow you to tag and search for assets which may support a specific 3rd party library, feature, etc.

Note that there may exist other category codes which are not listed here, but use of those is considered unsupported and may break without notice in any future version of Trainz.

Contents

Constants

  • These constants are used to define various values and can be used as mnenomics.
  • These constants can be used to search for assets in the game world via World.GetNamedObjectList().
  • If accessed from scripts the values must be prefixed AssetCategory., for example:
AsyncObjectSearchResult search_result = World.GetNamedObjectList(AssetCategory.Locomotive);


Map Object, Track, and Spline Constants


public define string Bridge = "BRG"
public define string Building = "BD"
public define string Crossing = "FIXD;CROS"
public define string Fauna = "FA"
public define string FixedTrack = "FIXD"
public define string Flora = "FL"
public define string Industry = "IND"
public define string InterlockingTower = "IT"
public define string Junction = "TO;?WX"
public define string Mesh = "CMP;MESH"
public define string People = "PP"
public define string Road = "RD"
public define string Scenery = "SY"
public define string SceneryWithTrack = "SWT"
public define string Signal = "TO;?WA"
public define string Spline = "SPLN"
public define string Track = "TK"
public define string Trackmark = "?WM"
public define string TrackBridge = "TK;BRG"
public define string TrackTunnel = "TK;TUN"
public define string TrackObject = "TO"
public define string Trigger = "?WT"
public define string Tunnel = "TUN"
public define string Turntable = "FIXD;TURN"
public define string RoadVehicle = "VE"

Train Category Constants


public define string Caboose = "TR;TV;CAB"
public define string Consist = "CON"
public define string Locomotive = "TR;TV;LOCO"
public define string MailTrainCar = "TR;TV;MAIL"
public define string MonorailVehicle = "TR;TV;MNR"
public define string PassengerTrainCar = "TR;TV;PAX"
public define string RollingStock = "TR;TV;ROLL"
public define string Tram = "TR;TV;TRM"
public define string TrainCar = "TR;TV"
public define string TrainCarDiesel = "TR;TV;DIES"
public define string TrainCarElectric = "TR;TV;ELEC"
public define string TrainCarSteam = "TR;TV;STEM"
public define string TrainCarTender = "TR;TV;TEND"
public define string TrainCarComponent = "TR;CMP"
public define string TrainEngine = "TR;CMP;ESPC"


Route and Session Category Constants


public define string Region = "REGN"
public define string Route = "RT"
public define string SaveGame = "SG"
public define string Session = "SS"
public define string SessionArcade = "SS;ARCD"
public define string SessionTutorial = "SS;TUT"
public define string TestTrackTest= "TC"


Personal tools