TrainCarts/控制牌
TC插件主要採用附著在軌道下方或側面的木牌(以下稱為控制牌)作為控制埠來對軌道/列車進行操作。其功能類似於現實中的無源應答器。
語法以及效果
每一個控制牌的的基本語法是相同的,第一行永遠是[train]或者[cart],二者的區別在於,train是對經過此控制牌的整列火車進行相關操作,cart是對單輛礦車進行操作。值得一提的是,並不是每一個控制牌都能在第一行寫入[cart],對單獨車輛操作。
紅石
所有的控制牌都可以通過紅石信號激活,同樣也可以作為列車信息和紅石信號的接口,根據列車屬性激活紅石信號。
有些控制牌需要您使用紅石激活才能使用,常見的例子是車站(Station)控制牌和生成(Spawner)控制牌。為了給控制牌充能並實現功能,你需要在控制牌旁邊放置紅石信號源。信號源可以是激活的紅石粉(不需要指向控制牌)、拉杆、按鈕等。(可參照紅石燈被激活的方式)
如果你想在不使用紅石信號的情況下一直讓控制牌處於激活狀態,你可以在控制牌第一行的[train]/[cart]之前加一個"+"號,變成[+train]或者[+cart],這時,控制牌將屏蔽外界的紅石信號輸入,一直保持激活狀態。如果想讓控制牌在沒有紅石信號的情況下屬於激活狀態,而被紅石信號充能後去使能,則可以在第一行加一個"!",變成[!train]或者[!cart]。
需要注意的是,這兩者可能都會改變控制牌本身輸出紅石信號的方式。請根據不同控制牌的功能以及實際情況靈活調整。具體用法請參閱本維基各控制牌的百科頁面。
此外,一個控制牌也可以在相應條件下激活紅石信號,在控制牌下方的方塊側面放置一個拉杆即可。當相應的控制牌對其上的列車進行操作時(例如,列車在車站停靠),拉杆便會被激活,同時對紅石線或者其它紅石元器件供能。需要注意的是,在第一行的train或者cart之前加入一個"!"來讓激活控制牌的輸入紅石信號反相併不會使相應控制牌的輸出信號反相。
控制牌同樣可以設置僅對特定方向的列車進行操作。在第一行的[train]或者[cart]後加上一個半角冒號「:」,之後寫入需要進行處理的列車方向 參閱:列車方向。
例如,一個switcher控制牌的第一行寫入[train:lr]代表這個控制牌將對左或右方的來車進行操作,而不會對其餘方向駛來的列車有任何效果。
TC插件的一些控制牌可以遠程針對特定的列車/車廂進行操作或根據各類條件實現某些效果。請參閱本百科的具體頁面來了解相應的控制牌是否支持這樣的特殊功能。
遠程控制
少數控制牌可以依據列車名稱實現遠程控制,只需要將控制牌的第一行寫為「[train <列車名稱>]」即可,縮寫形式的「[t <列車名稱>]」也是可以接受的。由於遠程控制牌僅對紅石信號做出相應,所以即使不將其安放在軌道下方也可實現相應功能。截至目前,運行屬性(Property)、目的地(Destination)、銷毀(Destroy)、下車(eject)和設置方塊(setblock)控制牌可以實現特定列車的遠程控制。
如同標籤(tag)系統一樣,遠程控制亦可同時對多列列車生效,使用通配符「*」來指定需要進行操作的列車。舉個例子,下圖中的遠程控制牌將對所有名稱內含有「Intercity」的列車設定目的地為「home」。
the setblock sign works too!
You can use this to recall all your trains easily. If you use tags to navigate trains, you can also add a tag saying that the train should return. Remote control signs only respond to redstone changes.
Placement
Each sign targets a certain track piece above. Signs attached to walls take the block they are attached to and look up until they find a piece of track. That track is then used for that sign. Sign posts look up until they find a piece of track. There may not be blocks without signs between the bottom sign and the tracks.
You can make a pillar of blocks below a single track piece and attach signs to it, to make a bundle of actions on a single track piece. Trains look down when they enter a new track piece to check for signs, so make sure you put the output signs above the signs that use this output for correct results.
A noticeable exception would be add-ons for the TrainCart plugin, which may change the (relative) position a sign would need to be placed on in order to work for the track. For example, would the TC Hang Rail add-on require you to add the signs above the Hang rail track to work, while the TCC (TrainCarts Coasters) add-on uses the block of a node for the sign, which can be moved to any other block.
For most signs the sign direction influences what happens:
- The train has to face the text on the sign to make the sign respond
- Signs with the same alignment as the tracks (faces to or away from the tracks) always respond
- The train is spawned in the direction the sign faces
Types
- Animator - play an animation configured in the train's attachments
- Announce - sends a message to players in the cart and/or train above
- Blocker - blocks trains coming from a certain direction
- Block Changer - change the block types displayed in a minecart
- Crafter - crafts items inside the storage minecarts of a train using a nearby workbench
- Destination - marks a destination for the path finding and sets the next destination for the train
- Destroyer - destroy trains
- Detector - detect trains on a set region of rails
- Effect - plays a particle or sound effect at the minecart, train or sign
- Ejector - eject trains (let passengers exit)
- Elevator - teleports trains including passengers up and down to another elevator
- Enter - lets nearby players and/or mobs enter the train
- Flip - Lets you flip a cart 180 degrees
- Launcher - launch or brake trains to start moving at a desired speed
- Mutex - acts as a cuboid barrier in which only a single train is ever allowed to be
- Property - set properties on the train such as tags, destinations and owners
- Skip - skips execution of signs up ahead based on statements
- Sound - plays a named sound effect
- Spawner - spawn an entire train, cart types can be set
- Station - stop and launch trains
- Switcher - switch levers and rails based on properties on the train
- Teleporter - teleport trains including passengers (requires MyWorlds)
- Transfer - transfer items between trains and chests/furnaces/dispensers
- Trigger - display train information and a countdown of the arrival time of trains on signs (requires SignLink)
- Ticket - let passengers pay for a ride (requires Vault)
- Waiter - waits the train until the track is clear of other trains
To-do
Add 'chunks' to signs to replace 'keepchunksloaded'.
Permissions
Each sign has a separate build permission. Below the permission nodes for the above sign types:
Sign | Permission node | Default |
---|---|---|
destructor | train.build.destructor | OP |
ejector | train.build.ejector | OP |
station | train.build.station | OP |
property | train.build.property | OP |
switcher | train.build.switcher | OP |
transfer | train.build.collector | OP |
train.build.depositor | ||
teleport | train.build.teleport | OP |
spawner | train.build.spawner | OP |
trigger | train.build.trigger | OP |
destination | train.build.destination | OP |
waiter | train.build.waiter | OP |
crafter | train.build.crafter | OP |
elevator | train.build.elevator | OP |