2017-09-06, 04:29:23
Lots of map links have been renamed to "Link" so I thought I'd put together a small tutorial on how to deal with that.
In the traditional way to write logic for moving between maps, you might write something like this:
This looks fine and it would have worked in the past, but now, for whatever reason, the link from Pewter City to Route 3 is labeled as "Link".
You might think that what you need to do is call `moveToMap("Link")`, but that's not a good idea for one reason: if there's more than one link on the same map labeled as "Link", it could very easily fail and move to the wrong map.
The solution to this is very simple. All you need to do is hover over the cell that the link is on, and look at the (x,y) coordinate of that cell.
![[Image: 4OidtdNaRhGo3TmuiL4jcA.png]](https://image.prntscr.com/image/4OidtdNaRhGo3TmuiL4jcA.png)
Then you can plug that data into your script, replacing 'moveToMap("Route 3")' with 'moveToCell(65, 33)'
Those interested in helping me put together data that Pathfinder can use read below:
In the traditional way to write logic for moving between maps, you might write something like this:
function onPathAction()
if isPokemonUsable(1) then
if getMapName() == "Pokecenter Pewter" then
moveToMap("Pewter City")
elseif getMapName() == "Pewter City" then
moveToMap("Route 3")
elseif getMapName() == "Route 3" then
moveToGrass()
end
else
if getMapName() == "Route 3" then
moveToMap("Pewter City")
elseif getMapName() == "Pewter City" then
moveToMap("Pokecenter Pewter")
elseif getMapName() == "Pokecenter Pewter" then
usePokecenter()
end
end
end
This looks fine and it would have worked in the past, but now, for whatever reason, the link from Pewter City to Route 3 is labeled as "Link".
You might think that what you need to do is call `moveToMap("Link")`, but that's not a good idea for one reason: if there's more than one link on the same map labeled as "Link", it could very easily fail and move to the wrong map.
The solution to this is very simple. All you need to do is hover over the cell that the link is on, and look at the (x,y) coordinate of that cell.
![[Image: 4OidtdNaRhGo3TmuiL4jcA.png]](https://image.prntscr.com/image/4OidtdNaRhGo3TmuiL4jcA.png)
Then you can plug that data into your script, replacing 'moveToMap("Route 3")' with 'moveToCell(65, 33)'
function onPathAction()
if isPokemonUsable(1) then
if getMapName() == "Pokecenter Pewter" then
moveToMap("Pewter City")
elseif getMapName() == "Pewter City" then
moveToCell(65, 33)
elseif getMapName() == "Route 3" then
moveToGrass()
end
else
if getMapName() == "Route 3" then
moveToMap("Pewter City")
elseif getMapName() == "Pewter City" then
moveToMap("Pokecenter Pewter")
elseif getMapName() == "Pokecenter Pewter" then
usePokecenter()
end
end
end
Those interested in helping me put together data that Pathfinder can use read below:
Spoiler: