RailSwitch: Difference between revisions

From CivWiki
Jump to navigation Jump to search
Content added Content deleted
No edit summary
Line 1: Line 1:
'''RailSwitch''' (also known as "'''The /dest Plugin'''") is a rail transport plugin used on some Civ servers such at CivClassics and CivRealms, it allows someone to set a destination when using rails.
'''RailSwitch''' (also known as "'''The /dest Plugin'''") is a rail transport plugin used on some Civ servers such as [[CivClassic 2.0|CivClassics]] and [[CivRealms 2.0|CivRealms]], it allows someone to set a destination when using rails. The plugin works by using the redstone mechanics of [https://minecraft.gamepedia.com/Rail#Placement T-junction], which follows the [https://minecraft.gamepedia.com/South-east_rule South-east rule], interaction with [https://minecraft.gamepedia.com/Detector_Rail detector rails]. The plugin allows the detector rail to send a redstone signal only if the person in the minecart chose the right destination. This plugin can '''only work in one direction''' as the player has to arrive from a certain direction. Also, it can only choose between two destinations for a total of three rail directions : one starting point and two destinations.


= Usage =
= Usage =
If the rail is set up, simply write <code>/dest place</code> where <code>place</code> is the place where you want to go. You can also chain destinations, and travel to them in order, this can be useful for taking a route via specific junctions.
If the rail is set up, simply write <code>/dest place</code> where <code>place</code> is the place where you want to go. You can also chain destinations <code>/dest place1 place2</code> etc. this can be useful for taking a route via specific junctions, RailSwitch will route players towards signs that contain either <code>place1</code> or <code>place2</code>.<ref name=":0">https://github.com/okx-code/RailSwitch/blob/master/README.md</ref> Stations where /dest has been set up will probably list possible destinations on signs, if you use normal direct rails between A and B /dest will do nothing.

= Setup =
== Idea of the plugin ==
The plugin works by using the redstone mechanics of [https://minecraft.gamepedia.com/Rail#Placement T-junction], which follows the [https://minecraft.gamepedia.com/South-east_rule South-east rule], interaction with [https://minecraft.gamepedia.com/Detector_Rail detector rails]. The plugin allows the detector rail to send a redstone signal only if the person in the market chose the right destination. This plugin can '''only works in one way rail''' as the player has to arrive from a certain direction. Also, it can only choose between two destination for a total of three rail direction : one starting point and two destinations.


== Block placement ==
== Block placement ==
A sign with the destination name on it must be placed over a detector rail and reinforced under the same group. The sign first line must be <code>[destination]</code>, then the other three lines can be destination names. They have to be placed before the T-junction.
A sign with the destination name on it must be placed over a detector rail and reinforced under the same group. The sign first line must be <code>[destination]</code>, then the other three lines can be destination names. They have to be placed before the T-junction. You may also use <code>[!destination]</code>, which will activate the rail if a player's destination is not on the signs.<ref name=":0" />
<center>
<center>
{|
{|
Line 19: Line 15:


== Interaction ==
== Interaction ==
Upon passing on the detector rail, the redstone signal will activate only if the player on the minecart chose a direction written on the sign. If it's the case, the detector rail will send a signal which will allow the T-junction to change direction, those allowing the player to chose a direction. In the exemple on the right, if the player had the mall set has their destination, the detector would send a redstone signal which would change the T-junction orientation, those sending the player to the mall. If the player had an other destination setup, the detector rail won't send a redstone signal, and the player would continue straight up as per the normal T-junction rules.
Upon passing on the detector rail, the redstone signal will activate only if the player on the minecart chose a direction written on the sign. If it's the case, the detector rail will send a signal which will allow the T-junction to change direction, those allowing the player to chose a direction. In the example on the right, if the player had the mall set has their destination, the detector would send a redstone signal which would change the T-junction orientation, those sending the player to the mall. If the player had an other destination setup, the detector rail won't send a redstone signal, and the player would continue straight up as per the normal T-junction rules.
[[File:RailSwitchRailChanging.png|thumb|When the redstone signal is sent, the T-junction change direction]]
[[File:RailSwitchRailChanging.png|thumb|When the redstone signal is sent, the T-junction change direction]]


Line 35: Line 31:
=== Going to the mall by default ===
=== Going to the mall by default ===
To make the player go to the mall by default, the T-junction has to be powered, and unpowered when someone wants to go to the stables. Using an inverter makes this possible. If a player arrives without having set their destination to <code>stables</code>, the T-junction won't change and they'll head to the mall.
To make the player go to the mall by default, the T-junction has to be powered, and unpowered when someone wants to go to the stables. Using an inverter makes this possible. If a player arrives without having set their destination to <code>stables</code>, the T-junction won't change and they'll head to the mall.

== References ==
<references />

Revision as of 13:55, 15 June 2021

RailSwitch (also known as "The /dest Plugin") is a rail transport plugin used on some Civ servers such as CivClassics and CivRealms, it allows someone to set a destination when using rails. The plugin works by using the redstone mechanics of T-junction, which follows the South-east rule, interaction with detector rails. The plugin allows the detector rail to send a redstone signal only if the person in the minecart chose the right destination. This plugin can only work in one direction as the player has to arrive from a certain direction. Also, it can only choose between two destinations for a total of three rail directions : one starting point and two destinations.

Usage

If the rail is set up, simply write /dest place where place is the place where you want to go. You can also chain destinations /dest place1 place2 etc. this can be useful for taking a route via specific junctions, RailSwitch will route players towards signs that contain either place1 or place2.[1] Stations where /dest has been set up will probably list possible destinations on signs, if you use normal direct rails between A and B /dest will do nothing.

Block placement

A sign with the destination name on it must be placed over a detector rail and reinforced under the same group. The sign first line must be [destination], then the other three lines can be destination names. They have to be placed before the T-junction. You may also use [!destination], which will activate the rail if a player's destination is not on the signs.[1]

RailSwitch example from the side
RailSwitch example from above with the destinations

Interaction

Upon passing on the detector rail, the redstone signal will activate only if the player on the minecart chose a direction written on the sign. If it's the case, the detector rail will send a signal which will allow the T-junction to change direction, those allowing the player to chose a direction. In the example on the right, if the player had the mall set has their destination, the detector would send a redstone signal which would change the T-junction orientation, those sending the player to the mall. If the player had an other destination setup, the detector rail won't send a redstone signal, and the player would continue straight up as per the normal T-junction rules.

When the redstone signal is sent, the T-junction change direction

Direction of the rail

The intersection minecart will always follow the south-east rule. In the case the rail has to be directed in the other direction, a redstone inverter has to be made. This gives two additional conditions :

  • The rail has to be at least at y = 4
  • The detector rail has to be placed two blocks before the intersection to make space for the inverter.
Inverting the default state of the T-junction


Examples

Going to the stables by default

In our example, the rail direction makes it so that if no redstone signal is sent, the cart would go to the stables. When the player will pass under the sign with mall as a destination, but without having it set up as their destination, no redstone signal will be send, thus the player will reach the stables. If the player had set their destination to mall, the activator rail would send a signal that would switch the T-junction orientation, and thus making the player go to the mall.

Going to the mall by default

To make the player go to the mall by default, the T-junction has to be powered, and unpowered when someone wants to go to the stables. Using an inverter makes this possible. If a player arrives without having set their destination to stables, the T-junction won't change and they'll head to the mall.

References