Difference between revisions of "TrainCarts/Signs/Switcher"

From BergerHealer Wiki
Jump to navigation Jump to search
(Prepared the page for translation)
(Marked this version for translation)
Line 1: Line 1:
 
<languages/>
 
<languages/>
 
<translate>
 
<translate>
 +
<!--T:1-->
 
[[Special:MyLanguage/TrainCarts/Signs|« Go back]]
 
[[Special:MyLanguage/TrainCarts/Signs|« Go back]]
  
  
== Introduction ==
+
== Introduction == <!--T:2-->
  
 +
<!--T:3-->
 
This is part of the[[Special:MyLanguage/TrainCarts|TrainCarts]] Minecraft mod.
 
This is part of the[[Special:MyLanguage/TrainCarts|TrainCarts]] Minecraft mod.
  
 +
<!--T:4-->
 
Switcher signs are the linking factor between trains and signs. It can read information from the train or cart above and toggle a lever and rails based on that. It also marks the toggleable nodes of the path finding logic.
 
Switcher signs are the linking factor between trains and signs. It can read information from the train or cart above and toggle a lever and rails based on that. It also marks the toggleable nodes of the path finding logic.
  
  
== Syntax ==
+
== Syntax == <!--T:5-->
  
 +
<!--T:6-->
 
'''Second line:''' ''switcher'' or ''tag''
 
'''Second line:''' ''switcher'' or ''tag''
  
 +
<!--T:7-->
 
'''Third line:''' ''The [[Special:MyLanguage/TrainCarts/Signs/Statements|statement]] for when to switch the track left''
 
'''Third line:''' ''The [[Special:MyLanguage/TrainCarts/Signs/Statements|statement]] for when to switch the track left''
  
 +
<!--T:8-->
 
'''Fourth line:''' ''The statement for when to switch the track right''
 
'''Fourth line:''' ''The statement for when to switch the track right''
  
Line 25: Line 31:
  
  
 +
<!--T:9-->
 
For statements it can read cart tags, destination, passengers, items and several other states. It is also possible to sort the carts  when using numeric values on the last two lines. This way you can make 1 train or cart go left out of every 3 trains or carts.
 
For statements it can read cart tags, destination, passengers, items and several other states. It is also possible to sort the carts  when using numeric values on the last two lines. This way you can make 1 train or cart go left out of every 3 trains or carts.
  
 +
<!--T:10-->
 
The lever is toggled when either of the two statements match. The tracks are only changed if the sign is powered (or has its power inverted while not powered)'
 
The lever is toggled when either of the two statements match. The tracks are only changed if the sign is powered (or has its power inverted while not powered)'
  
  
== Statements ==
+
== Statements == <!--T:11-->
  
 +
<!--T:12-->
 
On the third and fourth lines you can put the statements to evaluate. You can insert a [[Special:MyLanguage/TrainCarts/Signs/Direction|direction]] followed up by ''':''' and then the statement to set the direction to switch to. For example:
 
On the third and fourth lines you can put the statements to evaluate. You can insert a [[Special:MyLanguage/TrainCarts/Signs/Direction|direction]] followed up by ''':''' and then the statement to set the direction to switch to. For example:
  
Line 39: Line 48:
  
  
 +
<!--T:13-->
 
Will send all trains larger than 5 carts to the left, and trains with wood in storage minecarts to the right. It parses the statements from top to bottom, so wood-bearing trains larger than 5 carts are also sent to the left.
 
Will send all trains larger than 5 carts to the left, and trains with wood in storage minecarts to the right. It parses the statements from top to bottom, so wood-bearing trains larger than 5 carts are also sent to the left.
  
 +
<!--T:14-->
 
Switcher signs currently support wildcards only when matching to tags and player names (but not, for example, to train names).
 
Switcher signs currently support wildcards only when matching to tags and player names (but not, for example, to train names).
  
  
== Switching without train ==
+
== Switching without train == <!--T:15-->
  
 +
<!--T:16-->
 
To change the rails when triggered by redstone, without requiring a train to enter the rails first, both from and to directions can be specified. For example:
 
To change the rails when triggered by redstone, without requiring a train to enter the rails first, both from and to directions can be specified. For example:
  
Line 53: Line 65:
  
  
 +
<!--T:17-->
 
Will switch the rails north-east when powered by redstone, and north-west otherwise. This also works with TC-Coasters, by specifying the junction names ( 1-2:redstone )
 
Will switch the rails north-east when powered by redstone, and north-west otherwise. This also works with TC-Coasters, by specifying the junction names ( 1-2:redstone )
  
  
== Path finding ==
+
== Path finding == <!--T:18-->
  
 
</translate>
 
</translate>
Line 62: Line 75:
 
<translate>
 
<translate>
  
 +
<!--T:19-->
 
The switcher sign is also used during path finding. If a train or cart has a destination set, and no statements on the sign match (or no statements were set), it will toggle the rails to make the train go to the requested destination. If you need to force an alternative route or need to send 'passing through' trains around, add a statement on this sign to do so.
 
The switcher sign is also used during path finding. If a train or cart has a destination set, and no statements on the sign match (or no statements were set), it will toggle the rails to make the train go to the requested destination. If you need to force an alternative route or need to send 'passing through' trains around, add a statement on this sign to do so.
  
  
== Sorter ==
+
== Sorter == <!--T:20-->
  
 +
<!--T:21-->
 
If you need to sort carts onto multiple tracks, you can use an internal counter:
 
If you need to sort carts onto multiple tracks, you can use an internal counter:
  
Line 74: Line 89:
  
  
 +
<!--T:22-->
 
Right now it will send 3 trains to the left and then 4 trains to the right direction, after which the cycle repeats itself. You can put multiple switcher signs in line to equally divide the trains onto multiple tracks. This is shown in the video below:
 
Right now it will send 3 trains to the left and then 4 trains to the right direction, after which the cycle repeats itself. You can put multiple switcher signs in line to equally divide the trains onto multiple tracks. This is shown in the video below:
  
 +
<!--T:23-->
 
https://www.youtube.com/watch?v=8KCfenk3Vi8
 
https://www.youtube.com/watch?v=8KCfenk3Vi8
  
  
== Redstone powered switcher ==
+
== Redstone powered switcher == <!--T:24-->
  
 +
<!--T:25-->
 
By using the redstone statements on the sign, you can completely control what direction to send the train to:
 
By using the redstone statements on the sign, you can completely control what direction to send the train to:
  
 +
<!--T:26-->
 
[[File:TrainCarts Redstone Switcher.png|thumb|400px|left|3-way redstone switcher]]
 
[[File:TrainCarts Redstone Switcher.png|thumb|400px|left|3-way redstone switcher]]
 
</translate>
 
</translate>

Revision as of 17:33, 8 February 2021

Other languages:

« Go back


Introduction

This is part of theTrainCarts Minecraft mod.

Switcher signs are the linking factor between trains and signs. It can read information from the train or cart above and toggle a lever and rails based on that. It also marks the toggleable nodes of the path finding logic.


Syntax

Second line: switcher or tag

Third line: The statement for when to switch the track left

Fourth line: The statement for when to switch the track right


Signtemplate.png
[train]
switcher


For statements it can read cart tags, destination, passengers, items and several other states. It is also possible to sort the carts when using numeric values on the last two lines. This way you can make 1 train or cart go left out of every 3 trains or carts.

The lever is toggled when either of the two statements match. The tracks are only changed if the sign is powered (or has its power inverted while not powered)'


Statements

On the third and fourth lines you can put the statements to evaluate. You can insert a direction followed up by : and then the statement to set the direction to switch to. For example:

Signtemplate.png
[!train]
switcher
1:<trainsize>
r:i@wood


Will send all trains larger than 5 carts to the left, and trains with wood in storage minecarts to the right. It parses the statements from top to bottom, so wood-bearing trains larger than 5 carts are also sent to the left.

Switcher signs currently support wildcards only when matching to tags and player names (but not, for example, to train names).


Switching without train

To change the rails when triggered by redstone, without requiring a train to enter the rails first, both from and to directions can be specified. For example:

Signtemplate.png
[+train]
switcher
n-e:redstone
n-w:default


Will switch the rails north-east when powered by redstone, and north-west otherwise. This also works with TC-Coasters, by specifying the junction names ( 1-2:redstone )


Path finding

Signtemplate.png
[+train]
switcher

The switcher sign is also used during path finding. If a train or cart has a destination set, and no statements on the sign match (or no statements were set), it will toggle the rails to make the train go to the requested destination. If you need to force an alternative route or need to send 'passing through' trains around, add a statement on this sign to do so.


Sorter

If you need to sort carts onto multiple tracks, you can use an internal counter:

Signtemplate.png
[!train]
switcher
3
4


Right now it will send 3 trains to the left and then 4 trains to the right direction, after which the cycle repeats itself. You can put multiple switcher signs in line to equally divide the trains onto multiple tracks. This is shown in the video below:

https://www.youtube.com/watch?v=8KCfenk3Vi8


Redstone powered switcher

By using the redstone statements on the sign, you can completely control what direction to send the train to:

3-way redstone switcher