FindPathExplanation
From The Battle for Wesnoth Wiki
An illustrated example of the [find_path] WML tag's results.
Imagine an Elvish Scout standing on the Player 1 start, this unit has 9MP and needs 3MP for each shallow water tile, so it can reach every village without needing a multi-turn move.
If [find_path] is used with a terrain filter that matches villages, each of these villages might be considered to be the "nearest":
- "lake" is 3 hexes, 7 MP and 4 steps away
- "spur" is 5 hexes, 5 MP and 6 steps away
- "u_turn" is 2 hexes, 8 MP and 9 steps away
The hexes is best explained by the U-turn village - although it needs a lot of movement points, the village is only 2 hexes away from Player 1's start.
The steps is the length of the path.step array, which always includes the starting hex.
This page was last edited on 22 July 2019, at 11:49.
