Mentioning waypoint in nav upgrade's manual entry.

This commit is contained in:
Florian Nücke 2015-04-26 17:54:09 +02:00
parent 5672cf8dc8
commit 0e995faa8a
3 changed files with 5 additions and 3 deletions

View File

@ -4,4 +4,6 @@
The navigation upgrade provides location and orientation information to devices it is installed in. The coordinates the upgrade provides are relative to the center of the map that was used to craft the upgrade, and the functional range is based on the size of that map. The navigation upgrade provides location and orientation information to devices it is installed in. The coordinates the upgrade provides are relative to the center of the map that was used to craft the upgrade, and the functional range is based on the size of that map.
The map inside a Navigation upgrade can be changed by re-crafting the upgrade with a new map. The old map will be returned to the player. The map inside a Navigation upgrade can be changed by re-crafting the upgrade with a new map. The old map will be returned to the player.
Note that this upgrade is a lot more useful when used in combination with one or more [waypoints](../block/waypoint.md).

View File

@ -64,7 +64,7 @@ class UpgradeNavigation(val host: EnvironmentHost with Rotatable) extends prefab
val waypoints = Waypoints.findWaypoints(position, range). val waypoints = Waypoints.findWaypoints(position, range).
filter(waypoint => waypoint.getDistanceFrom(positionVec.xCoord, positionVec.yCoord, positionVec.zCoord) <= rangeSq) filter(waypoint => waypoint.getDistanceFrom(positionVec.xCoord, positionVec.yCoord, positionVec.zCoord) <= rangeSq)
result(waypoints.map(waypoint => { result(waypoints.map(waypoint => {
val delta = position.toVec3.subtract(waypoint.position.offset(waypoint.facing).toVec3) val delta = positionVec.subtract(waypoint.position.offset(waypoint.facing).toVec3)
Map( Map(
"position" -> Array(delta.xCoord, delta.yCoord, delta.zCoord), "position" -> Array(delta.xCoord, delta.yCoord, delta.zCoord),
"redstone" -> waypoint.maxInput, "redstone" -> waypoint.maxInput,

View File

@ -303,7 +303,7 @@ class NativeLuaArchitecture(val machine: api.machine.Machine) extends Architectu
apis.foreach(_.initialize()) apis.foreach(_.initialize())
lua.load(classOf[Machine].getResourceAsStream(Settings.scriptPath + "machine.lua"), "=kernel", "t") lua.load(classOf[Machine].getResourceAsStream(Settings.scriptPath + "machine.lua"), "=machine", "t")
lua.newThread() // Left as the first value on the stack. lua.newThread() // Left as the first value on the stack.
true true