Trainz/containers/queues container
| |||
|
|||
|
The queues" Container is a top-level config.txt file entry used by various Content_Types.
The queues Container is a list of queue subcontainers (Queues) with no standalone tags.∅ Queues are used by certain asset types (such as kind industry and kind traincar) to establish runtime memory space allocation to 'hold' kind product instances, and to define the legal values of their contents.
- In essence, because product can be loaded and unloaded or produced and consumed during operations, each queue establishes variables which change dynamically in the game. These memory set asides can then be accessed and used by supporting TrainzScript code.
- Queues can make use of animated meshes or custom attachments to visually represent the amount of product they hold in game.
- Instances of queue subcontainers are represented in TrainzScript via Class_ProductQueue.
- Each queue subcontainer uses the following format:
Supported Tags
[edit | edit source]Each queue subcontainer supports the following tags. Each tag is shown here with its default value.
size 0 product-kuid <KUID:0:0> initial-count 0 passenger-queue 0 per-hour 120 animated-mesh "" custom-attachments "" attachment-points { } allowed-products { } allowed-categories { } conflicts-with-queues { }
size
[edit | edit source]- Data Type: Positive Integer
- Data element description: The maximum size of the queue, in other words this is the maximum amount of product the queue can 'hold'.
product-kuid
[edit | edit source]- Data Type: KUID
- Data element description: Used in conjunction with the 'initial-count' tag, product-kuid specifies the initial kind product type in the queue.
initial-count
[edit | edit source]- Data Type: Positive Integer
- Data element description: Used in conjunction with the 'product-kuid' tag, initial-count specifies the initial amount of product in the queue.
passenger-queue
[edit | edit source]- Data Type: Boolean
- Data element description: Specifies that the queue can hold passengers.
per-hour
[edit | edit source]- Data Type: Positive Integer
- Data element description: This flag is used for passenger stations and sets the base number of passengers that will accumulate over the period of one hour.
animated-mesh
[edit | edit source]- Data Type: String
- Data element description: Specifies the name of an animated mesh from the mesh table. This mesh is used to visually represent the amount of product in the queue while in game and should animate from empty to full.
custom-attachments
[edit | edit source]- Data Type: String
- Data element description: Specifies that this queue has custom attachment points. Custom attachments are used in game to visually represent the amount of product in the queue. An 'attachment-points' container is used to list the custom attachments.
attachment-points
[edit | edit source]- Data Type: String Container
- Data element description: The 'attachment-points' container lists all of the mesh attachment points used to visually represent the amount of product in the queue. When the queue is empty the meshes attached on these points will be invisible, as the queue fills they will be progressively shown. The number of attachment points cannot exceed the total queue size.
allowed-categories
[edit | edit source]- Data Type: KUID Container
- Data element description: Lists the KUIDs of all of the kind product-category assets that can accumulate in the queue. Allowing a product category means that all products of this category are allowed, they therefore do not need to be specified in the 'allowed-products' subcontainer.
- On the other hand, using an kind kind product-category, means one must be defined which matches the limits of the industry or rolling stock asset.
allowed-products
[edit | edit source]Allowed-products can be considered a list of specific products when a class of products, as that specified by allowed-categories above is too broad or otherwise inappropriate.
- Data Type: KUID subcontainer
- Data element description: Lists the KUIDs of all of the various kind product assets that can accumulate in the queue.
- example
allowed-products { 0 <kuid2:xxxxx:yyyyyy:1> 1 <kuid:wwwwww:zzzzzz> }
- Listed kuids are assets of defined kind product class assets.
conflicts-with-queues
[edit | edit source]- Data Type: String Container
- Data element description: Sets a number of queues that this queue conflicts with. If any of the conflicting queues have any product in them, then a conflictable product cannot be added to this queue.
- Otherwise, products might be added to more than one queue if they do not exclude each other.
queues-ID
[edit | edit source]queues-ID is a placeholder for an content creator specified identifier name (so is variable). Names of identifiers (queues-ID) are used by other parts of Trainz software to identify and interact with the data initialized in the queue data structures.
- In the below examples, the role of 'queues-ID' is obvious given that each is just one single nested level of curly-braces within the queue data block (group of elements), immediately after (inside) the braces forming the boundaries of the queue block of data.
- In order of appearance in the examples below they are:
- prod0
Locomotive with two consumption queues. - locomotive_diesel_fuel_queue
- locomotive_sand_queue
Some other interesting uses... - load
- cattle_q
Passenger Station with multiple consumption and source queues... - passengers_on_0
- passengers_on_1
- passengers_on_2
- passengers_off_0
- passengers_off_1
- passengers_off_2
- Note in the examples, the processes data structures are the same level of indentation as the queues-ID identifier.
Examples in rolling stock
[edit | edit source]Queues in a Stock Car
[edit | edit source]- Stock Car in this case has nothing to do with NASCAR but is the older livestock useage: sheep, pigs, cows, etc.
queues { prod0 { size 15 initial-count 0 product-kuid <kuid2:30671:90102101:1> attachment-points { 0 "a.load0" 1 "a.load1" 2 "a.load2" 3 "a.load3" 4 "a.load4" 5 "a.load5" 6 "a.load6" 7 "a.load7" 8 "a.load8" 9 "a.load9" 10 "a.load10" 11 "a.load11" 12 "a.load12" 13 "a.load13" 14 "a.load14" } allowed-products { 0 <kuid2:30671:90102101:1> 1 <kuid2:68213:60038:1> 2 <kuid2:68213:60037:1> } } }
Queues in a Locomotive
[edit | edit source]queues { locomotive_diesel_fuel_queue { size 18571 initial-count 1000 product-kuid <kuid2:86105:60600:1> allowed-products { 0 <kuid2:86105:60600:1> } } locomotive_sand_queue { size 1585 initial-count 1000 product-kuid <kuid2:86105:60601:1> allowed-products { 0 <kuid2:86105:60601:1> } } }
Queues in a Boxcar
[edit | edit source]kuid <kuid:58422:1053> username "40ft Southern AAR DD boxcar" kind "traincar" mass 23012 engine 0 enginespec <kuid:-1:42004201> description "AAR 1937 design standard 40ft 50ton automobile boxcar as used by CNO&TP(Southern)." author "Randall (Whitepass) White" organisation "TPR"
queues { load { size 7 initial-count 0 product-kuid <kuid:-3:10013> allowed-products { 0 <kuid:-3:10013> 2 <kuid2:30671:9040690:1> 3 <kuid2:30671:9080810:1> 4 <kuid2:30671:9080510:1> 5 <kuid2:30671:98702901:1> 6 <kuid2:30671:9840820:1> 7 <kuid2:124017:27009:1> 8 <kuid2:30671:9870899:1> 9 <kuid2:30671:9870190:1> } } }
Examples in industries
[edit | edit source]- These examples may have to be placed in a sub-page because of length:
Industry types involve a companion or sister container: processes container container which are presented as well below to best demonstrate the interworkings and associations.
Consumption only Industry
[edit | edit source]This meat packing industry outputs nothing, acting as a livestock consumer.
This Trainz/Containers/queues container section is a stub placeholder, an outline or marker that this section of the book is otherwise incomplete. You can help the Wikibooks Trainz project by expanding it with fuller discussion of the topic. Work needed: Convert these tables with the Psuedo-table style so can link from within. |
kuid <kuid2:69695:106:3> trainz-build 2.4 light 1 type "industrial"* region "GP&W"* category-region-0 "US" category-era-0 "1990s" category-era-1 "1950s" category-era-2 "1940s" category-class "BC" script "meatworks" class "meatworks" queues { cattle_q { size 256 initial-count 256 product-kuid <kuid2:30671:90102101:1> attachment-points { 0 "a.gen_goods0" 1 "a.gen_goods1" 2 "a.gen_goods2" ... yes a list of 256 attachment points for cattle 254 "a.gen_goods254" 255 "a.gen_goods255" } } } processes { multi_consumer_producer { start-enabled 1 duration 60 inputs { 0 { amount 1 queue "cattle_q" } } outputs { } } } attached-track { cattledepot { track <kuid:-1:15> vertices { 0 "a.track0a" 1 "a.track0b" 2 "a.track0c" 3 "a.track0d" } } } attached-trigger { cattletrig1 { att "a.trig0" radius 6.5 } }
Multiplatform Train Station
[edit | edit source]kuid <kuid2:316:28003:1> kind "industry" script "Station" class "Station" category-class "BR" username "Austin Large Station" category-region "CA;US" category-era "1890s;1900s;1910s;1920s;1930s;1940s;1950s;1960s;1970s" trainz-build 2.5
queues { passengers_on_0 { passenger-queue "1" size 30 initial-count 8 product-kuid <kuid:-3:10060> attachment-points { 0 "a.passon01" 1 "a.passon02" 2 "a.passon03" 3 "a.passon04 ... 28 "a.passon29" 29 "a.passon30" } } passengers_on_1 { passenger-queue "1" size 30 initial-count 8 product-kuid <kuid:-3:10060> attachment-points { 0 "a.passon31" 1 "a.passon32" 2 "a.passon33 ... 28 "a.passon59" 29 "a.passon60" } } passengers_on_2 { passenger-queue "1" size 20 initial-count 8 product-kuid <kuid:-3:10060> attachment-points { 0 "a.passon61" 1 "a.passon62" ... 18 "a.passon79" 19 "a.passon80" } } passengers_off_0 { passenger-queue "1" size 18 initial-count 0 product-kuid <kuid:-3:10060> attachment-points { 0 "a.passoff01" 1 "a.passoff02" ... 16 "a.passoff17" 17 "a.passoff18" } } passengers_off_1 { passenger-queue "1" size 17 initial-count 0 product-kuid <kuid:-3:10060> attachment-points { 0 "a.passoff19" 1 "a.passoff20" ... 16 "a.passoff35" } } passengers_off_2 { passenger-queue "1" size 18 initial-count 0 product-kuid <kuid:-3:10060> attachment-points { 0 "a.passoff36" 1 "a.passoff37" ... 15 "a.passoff51" 16 "a.passoff52" } } } processes { passenger_spawn_0 { start-enabled 1 duration 20 outputs { 0 { amount 1 queue "passengers_on_0" } } } passenger_spawn_1 { start-enabled 1 duration 20 outputs { 0 { amount 1 queue "passengers_on_1" } } } passenger_spawn_2 { start-enabled 1 duration 20 outputs { 0 { amount 1 queue "passengers_on_2" } } } passenger_delete_0 { start-enabled 1 duration 3 inputs { 0 { amount 1 queue "passengers_off_0" } } } passenger_delete_1 { start-enabled 1 duration 3 inputs { 0 { amount 1 queue "passengers_off_1" } } } passenger_delete_2 { start-enabled 1 duration 3 inputs { 0 { amount 1 queue "passengers_off_2" } } } }
Multiproduct Industry
[edit | edit source]
Notes and references
[edit | edit source]Footnotes
[edit | edit source]This reference page is adapted from the TrainzOnline Wiki under the CC-BY-SA 3.0 License. This page will likely include more textual explanations, exposition, history, and/or examples than the source page on the same topic. The TrainzOnline Wiki is for the most part maintained by the programmers or knowledgeable content creators and may have newer more up-to-date information on the current trainz-build code standards, which have some tendency to change as features are added to the software. |