Difference between revisions of "TrainCarts/PathFinding/zh-cn"

From BergerHealer Wiki
Jump to navigation Jump to search
(Created page with "当希望某条轨道上只能单向行驶时,可以使用始终开启的阻挡器,这个方法在有并排的轨道上时很有用,每条轨道只能沿着一个方向...")
 
(53 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
[[Image:Pathfinding.png|thumb|right|设置三个目的地和一个转辙器来调度列车。]]
 
[[Image:Pathfinding.png|thumb|right|设置三个目的地和一个转辙器来调度列车。]]
  
通过自动切换轨道,列车理论上可以到达 Minecraft 世界中的任何位置。通过放置控制牌来配置轨道网络拓扑,预先配置的列车将遵循该拓扑来到达目的地。
+
通过自动切换轨道,列车理论上可以到达 Minecraft 世界中的任何位置。通过放置控制牌来构建轨道网络架构,预先配置的列车将遵循该架构自动寻路到目的地。
  
列车到达的地点被称为''目的地'',由[[Special:MyLanguage/TrainCarts/Signs/Destination|目标牌]]指定。切换轨道的位置以及终点的位置被称为''节点'',由[[Special:MyLanguage/TrainCarts/Signs/Switcher|转辙器]]指定。如果要强制某段轨道路线只能单向行驶,可以设置[[Special:MyLanguage/TrainCarts/Signs/Blocker|阻挡器]]来阻止相反方向的路线。
+
列车到达的地点被称为''目的地'',由[[Special:MyLanguage/TrainCarts/Signs/Destination|目标牌]]指定。切换轨道的位置以及终点的位置被称为''节点'',由[[Special:MyLanguage/TrainCarts/Signs/Switcher|转辙器]]指定。如果要强制某段轨道路线只能单向行驶,可以设置[[Special:MyLanguage/TrainCarts/Signs/Blocker|阻挡器]]来阻挡反方向驶来的列车。
  
  
Line 17: Line 17:
 
=== 指定目的地 ===
 
=== 指定目的地 ===
  
可以在目的地标牌的第三行输入目的地的名称,第四行可以填写新的目的地名称来为经过的列车设置新的目的地,但你也可以留空不设置。
+
可以在目标牌的第三行输入目的地的名称,第四行可以填写新的目的地名称来为经过的列车设置新的目的地,但你也可以留空。
 
<gallery mode="slideshow">
 
<gallery mode="slideshow">
 
File:Pathfinding_Destination.png|车站与目标牌。当列车到达此地时,会停留30秒,然后向右驶出。
 
File:Pathfinding_Destination.png|车站与目标牌。当列车到达此地时,会停留30秒,然后向右驶出。
Line 27: Line 27:
 
轨道分叉口应该放置一个始终开启的转辙器。当有一辆设置了目的地的列车经过时,转辙器会计算出一条路线,然后切换轨道。
 
轨道分叉口应该放置一个始终开启的转辙器。当有一辆设置了目的地的列车经过时,转辙器会计算出一条路线,然后切换轨道。
 
<gallery mode="slideshow">
 
<gallery mode="slideshow">
File:Pathfinding_Switcher.png|转辙器会自动切换轨道来决定列车要前往的任何 3 个方向。
+
File:Pathfinding_Switcher.png|转辙器会自动切换轨道,决定列车要前往的任何 3 个方向。
 
</gallery>
 
</gallery>
  
  
=== 强制一个方向 ===
+
=== 强制单向行驶 ===
  
当希望某条轨道上只能单向行驶时,可以使用始终开启的阻挡器,这个方法在有并排的轨道上时很有用,每条轨道只能沿着一个方向行驶,路线查找会自动忽略被阻挡器阻挡的路线,使之不会出现驶错轨道的问题。
+
当希望某条轨道上只能单向行驶时,可以使用始终开启的阻挡器,这个方法在有并排的轨道上时很有用,每条轨道只能沿着一个方向行驶,自动寻路机制会忽略阻挡器阻挡的路线,使其不会出现驶错轨道的问题。
 
<gallery mode="slideshow">
 
<gallery mode="slideshow">
File:Pathfinding_Blocker.png|使用 ''[+train:left]'' 只会允许从右向左行驶的列车。同样,你也可以使用 ''[+train:right]'' 阻挡从右驶来的列车。
+
File:Pathfinding_Blocker.png|使用 ''[+train:left]'' 只会允许从右向左行驶的列车。同样你也可以使用 ''[+train:right]'' 阻挡从右驶来的列车。
 
</gallery>
 
</gallery>
  
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
=== 测试一下 ===
=== Test it out ===
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
在轨道上放置一辆矿车,并使用[[Special:MyLanguage/TrainCarts/Commands#Destination|目的地指令]]设置一个目的地:
Place down a minecart on the track, and use the [[Special:MyLanguage/TrainCarts/Commands#Destination|Destination command]] to set a destination:
+
<pre>/train destination [名称]
<pre>/train destination [name]
 
 
/train destination output</pre>
 
/train destination output</pre>
Now give the minecart a push towards the switcher sign, and observe how it will automatically switch the track to send the train towards the destination. You can change the destination again and send it to the switcher again. Continue to experiment with multiple switchers, blockers and destinations.
+
现在将矿车推到转辙器,观察它是如何切换轨道并发往目的地的。你可以再次设置目的地,并推向转辙器。可以继续尝试多个转辙器、阻挡器和目标牌。
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
如果出现转辙器发错方向等问题,可以使用[[Special:MyLanguage/TrainCarts/Commands#Reroute|重置调度指令]]强制重新计算调度路线。
If you run into a problem where the switcher appears to make a mistake, use the [[Special:MyLanguage/TrainCarts/Commands#Reroute|Reroute command]] to force a recalculation of all routing information:
 
 
<pre>/train reroute</pre>
 
<pre>/train reroute</pre>
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
也可以使用属性牌设置目的地:
It is also possible to use the property sign to set a destination:
 
</div>
 
 
{{sign|[+train]|property|destination|outpost}}
 
{{sign|[+train]|property|destination|outpost}}
  
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
== 高级设置 ==
== Advanced ==
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
一旦理解了基础系统的运作,那就可以进一步讨论更高级更复杂的功能了。
Once the basic system is understood, there are some more complicated features to discuss.
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
=== 实用功能 ===
=== Useful Side-Features ===
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
==== 保持区块加载 ====
==== Keep Chunks Loaded ====
+
当列车上没有任何玩家且周围没有玩家来加载区块时,可以开启列车的[[TrainCarts/Signs/Property|保持区块加载属性]]来防止列车被游戏卸载。
Prevent trains unloading when no player is nearby or in the train, by enabling the train [[TrainCarts/Signs/Property|keep chunks loaded property]].
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
在属性牌上你可以这样写:
You can use this property sign to set it:
 
 
{{sign|[+train]|property|keepchunksloaded|true}}
 
{{sign|[+train]|property|keepchunksloaded|true}}
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
或者你可以创建一辆列车,使用<code>/train keeploaded true</code>并通过<code>/train save <名称></code>保存列车。使用[[TrainCarts/Signs/Spawner#Automated_spawning|生成器]]可批量生成保存的列车。
Or you can create your train, use <code>/train keeploaded true</code> and save it under a saved train name using <code>/train save name</code>. You can then automatically spawn it by this name using the [[TrainCarts/Signs/Spawner#Automated_spawning|spawner sign]].
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
==== 等待距离 ====
==== Wait Distance ====
+
为了避免列车碰撞且保持列车之间的距离,可以使用[[TrainCarts/Signs/Property#Wait_Property|等待属性]]
To maintain distance between trains and avoid collisions over long stretches, use the [[TrainCarts/Signs/Property#Wait_Property|wait distance property]].
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
==== 闭塞区间 ====
==== Mutex Zones ====
+
[[TrainCarts/Signs/Mutex|闭塞区间]]能避免列车在交叉路口内发生碰撞。
Protects intersections against collisions with [[TrainCarts/Signs/Mutex|mutex zones]].
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
==== 车站调度 ====
==== Station Routing ====
+
[[TrainCarts/Signs/Station|车站]]可以将列车发往下一个目的地。
[[TrainCarts/Signs/Station|Station signs]] can launch the train into the direction of the next destination.
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
 
 
{{sign|[!train]|station||route}}
 
{{sign|[!train]|station||route}}
</div>
 
  
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
=== 调试 ===
=== Debugger ===
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
[[File:Pathfinding Debug Destinations.png|thumb|显示存在一定距离的目的地。]]
[[File:Pathfinding Debug Destinations.png|thumb|Displays the destinations with a distance to them]]
+
插件提供了一个''调试棒'',用于显示自动寻路机制的信息。使用调试棒单击轨道,会显示轨道有关路线的信息。潜行(Shift)并单击轨道,会''重新调度'',从点击的铁轨开始重新计算路线。如果你有多个较小的交通网络,使用调试棒也许能比指令更加高效。
The plugin offers a ''debug stick'' with which path finding information can be displayed. Use the stick item to click on rails to show information about the route(s) that can be taken. Sneak (shift) while clicking performs a ''reroute'', which recalculates the track reachable from where you clicked. If you have multiple smaller rail networks, this can be more efficient than executing the global reroute command.
 
</div>
 
  
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
==== 所有目的地 ====
==== All destinations ====
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
使用以下指令获取调试棒(用于显示铁轨到所有目的地的路线):
Use the following command to get a stick item that displays all destinations reached from a given track:
 
 
<pre>/train debug destination</pre>
 
<pre>/train debug destination</pre>
The track clicked is followed until a ''node'' of the track network is found, after which all routeable destinations are listed. For every destination the total distance to it is listed, and particles are displayed leading into it. If you find that a certain destination is not listed that should be, you can move further along the track clicking occasionally to find where the break is.
+
沿着选中的铁轨寻路,直到找到交通网络中的''节点'',之后列出所有可以调度的目的地。所有的目的地都会列出与轨道间的总距离,并显示沿路线的粒子。如果你发现有某个目的地没有列出,你可以沿着轨道走,偶尔单击一下来检查是哪个位置出现了问题。
</div>
 
  
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
==== 单个目的地 ====
==== A single destination ====
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
[[File:Pathfinding_Debug_Destination_Specific_One.png|thumb|显示到一个目的地的精确路线。]]
[[File:Pathfinding_Debug_Destination_Specific_One.png|thumb|Displays the precise route to one destination]]
+
使用以下指令调试特定目的地:
Use the following command to debug a specific destination:
+
<pre>/train debug destination [目的地]</pre>
<pre>/train debug destination [destination]</pre>
+
现在单击铁轨时会显示到达目的地的粒子路线。这在调试目的地时很有用,这样不会显示与你无关的调度路线和目的地。
Now when you click on the track, particles are displayed what route is taken to reach the destination. This is useful when debugging a specific destination so no particles are displayed for routes and destinations that aren't relevant to you.
 
</div>
 
  
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
=== 调度管理 ===
=== Route Manager ===
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
通常一次只能设置一个目的地。可以在目标牌上输入下一个目的地,但是只能有一条路线。使用调度管理机制,可以配置需要访问的目的地列表,并应用到列车上。列车会依次前往列表中的目的地,到达目的地后会继续前往下一个目的地。
Normally only one destination is set at a time. It is possible to set the next destination to go to on the destination sign itself, but that means you can only have one possible route. With the route manager a list of destinations to visit can be configured, and then applied to trains. Trains will then go down this list, advancing it every time they pass by a destination on it.
 
</div>
 
  
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
==== 指令 ====
==== Commands ====
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
编辑列车,使用以下指令设置目的地列表:
First, edit a train, then use the following commands to set a list of destinations:
+
<pre>/train route set [目的地1] ([目的地2] [目的地3...])
<pre>/train route set [destination1] ([destination2] [destination3...])
 
 
/train route set outpost hillfort dungeon</pre>
 
/train route set outpost hillfort dungeon</pre>
 
[[File:Pathfinding_routes_set.png|File:Pathfinding_routes_set.png]]
 
[[File:Pathfinding_routes_set.png|File:Pathfinding_routes_set.png]]
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
要在现有路线添加或移除一个或多个目的地,可以使用以下指令:
To add additional destinations to the existing route, or to remove them, use these commands:
+
<pre>/train route add [目的地1] ([目的地2] [目的地3...])
<pre>/train route add [destination1] ([destination2] [destination3...])
+
/train route remove [目的地1] ([目的地2] [目的地3...])</pre>
/train route remove [destination1] ([destination2] [destination3...])</pre>
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
然后你可以在指定的目的地使用目的地指令或属性来启用路线。否则这条路线在列车到达目标牌的那一刻就启用了。要检查列车路线,请使用基础调度指令。列车要到达的目的地会使用绿色进行高亮显示。
You can then use the destination command or property to start the route at a desired destination. Otherwise, the route is started from the beginning the moment the train hits a destination sign. To inspect the route of a train, use the base route command. The current destination the train has is highlighted green.
 
 
<pre>/train route</pre>
 
<pre>/train route</pre>
 
[[File:Pathfinding_route_info.png|File:Pathfinding_route_info.png]]
 
[[File:Pathfinding_route_info.png|File:Pathfinding_route_info.png]]
</div>
 
  
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
==== 自动化 ====
==== Persistence ====
 
</div>
 
  
<div lang="en" dir="ltr" class="mw-content-ltr">
+
列车路线可通过名称进行全局保存,并可快捷应用到其他列车上。
The route of a train can be saved globally under a name so it can later be applied to other trains instantly.
+
<pre>/train route save [名称]</pre>
<pre>/train route save [name]</pre>
+
要加载已保存的路线,需使用以下指令:
To load a saved route, this command can be used:
+
<pre>/train route load [名称]</pre>
<pre>/train route load [name]</pre>
+
或者也可以使用属性牌来完成:
Alternatively, it can be done using a property sign as well:
 
</div>
 
 
{{sign|[+train]|property|loadroute|myroute}}
 
{{sign|[+train]|property|loadroute|myroute}}

Latest revision as of 02:54, 14 September 2024

Other languages:
English • ‎中文 • ‎中文(中国大陆)‎

« 返回


介绍

设置三个目的地和一个转辙器来调度列车。

通过自动切换轨道,列车理论上可以到达 Minecraft 世界中的任何位置。通过放置控制牌来构建轨道网络架构,预先配置的列车将遵循该架构自动寻路到目的地。

列车到达的地点被称为目的地,由目标牌指定。切换轨道的位置以及终点的位置被称为节点,由转辙器指定。如果要强制某段轨道路线只能单向行驶,可以设置阻挡器来阻挡反方向驶来的列车。


开始

指定目的地

可以在目标牌的第三行输入目的地的名称,第四行可以填写新的目的地名称来为经过的列车设置新的目的地,但你也可以留空。


指定切换节点

轨道分叉口应该放置一个始终开启的转辙器。当有一辆设置了目的地的列车经过时,转辙器会计算出一条路线,然后切换轨道。


强制单向行驶

当希望某条轨道上只能单向行驶时,可以使用始终开启的阻挡器,这个方法在有并排的轨道上时很有用,每条轨道只能沿着一个方向行驶,自动寻路机制会忽略阻挡器阻挡的路线,使其不会出现驶错轨道的问题。


测试一下

在轨道上放置一辆矿车,并使用目的地指令设置一个目的地:

/train destination [名称]
/train destination output

现在将矿车推到转辙器,观察它是如何切换轨道并发往目的地的。你可以再次设置目的地,并推向转辙器。可以继续尝试多个转辙器、阻挡器和目标牌。

如果出现转辙器发错方向等问题,可以使用重置调度指令强制重新计算调度路线。

/train reroute

也可以使用属性牌设置目的地:

Signtemplate.png
[+train]
property
destination
outpost


高级设置

一旦理解了基础系统的运作,那就可以进一步讨论更高级更复杂的功能了。

实用功能

保持区块加载

当列车上没有任何玩家且周围没有玩家来加载区块时,可以开启列车的保持区块加载属性来防止列车被游戏卸载。

在属性牌上你可以这样写:

Signtemplate.png
[+train]
property
keepchunksloaded
true

或者你可以创建一辆列车,使用/train keeploaded true并通过/train save <名称>保存列车。使用生成器可批量生成保存的列车。

等待距离

为了避免列车碰撞且保持列车之间的距离,可以使用等待属性

闭塞区间

闭塞区间能避免列车在交叉路口内发生碰撞。

车站调度

车站可以将列车发往下一个目的地。

Signtemplate.png
[!train]
station
route


调试

显示存在一定距离的目的地。

插件提供了一个调试棒,用于显示自动寻路机制的信息。使用调试棒单击轨道,会显示轨道有关路线的信息。潜行(Shift)并单击轨道,会重新调度,从点击的铁轨开始重新计算路线。如果你有多个较小的交通网络,使用调试棒也许能比指令更加高效。


所有目的地

使用以下指令获取调试棒(用于显示铁轨到所有目的地的路线):

/train debug destination

沿着选中的铁轨寻路,直到找到交通网络中的节点,之后列出所有可以调度的目的地。所有的目的地都会列出与轨道间的总距离,并显示沿路线的粒子。如果你发现有某个目的地没有列出,你可以沿着轨道走,偶尔单击一下来检查是哪个位置出现了问题。


单个目的地

显示到一个目的地的精确路线。

使用以下指令调试特定目的地:

/train debug destination [目的地]

现在单击铁轨时会显示到达目的地的粒子路线。这在调试目的地时很有用,这样不会显示与你无关的调度路线和目的地。


调度管理

通常一次只能设置一个目的地。可以在目标牌上输入下一个目的地,但是只能有一条路线。使用调度管理机制,可以配置需要访问的目的地列表,并应用到列车上。列车会依次前往列表中的目的地,到达目的地后会继续前往下一个目的地。


指令

编辑列车,使用以下指令设置目的地列表:

/train route set [目的地1] ([目的地2] [目的地3...])
/train route set outpost hillfort dungeon

File:Pathfinding_routes_set.png

要在现有路线添加或移除一个或多个目的地,可以使用以下指令:

/train route add [目的地1] ([目的地2] [目的地3...])
/train route remove [目的地1] ([目的地2] [目的地3...])

然后你可以在指定的目的地使用目的地指令或属性来启用路线。否则这条路线在列车到达目标牌的那一刻就启用了。要检查列车路线,请使用基础调度指令。列车要到达的目的地会使用绿色进行高亮显示。

/train route

File:Pathfinding_route_info.png


自动化

列车路线可通过名称进行全局保存,并可快捷应用到其他列车上。

/train route save [名称]

要加载已保存的路线,需使用以下指令:

/train route load [名称]

或者也可以使用属性牌来完成:

Signtemplate.png
[+train]
property
loadroute
myroute