- Pokémon Essentials Version
- v20.1 ➖
Pathfinding + is a Pathfinding Script made from an existing Pathfinding script, but was for an older version of Essentials and this script lets you do a little more functionality that I wanted which I haven't seen in any other pathfinding script.
You can:
You can:
- Give it a list of event names and it will pathfind to the closest event name
- Tell it to go only a couple of steps in the path you told it to go and then stop.
x = 10 # x-value where you want them to go
y = 3 #y-value where you want them to go
id = -1 #Event you want to move
s = Proc.new { $game_switches[1999] = true } #Switch that turns on when you successfully arrive
f = Proc.new { $game_switches[2000] = true } #Switch that turns on when you don't successfully arrive
pathfind(x,y,id,1,3,s,f)
The 1 in the example is an optional range away from the location if you want it to have a range of two tiles from that coordinate for instance, or whatever number you put in.
The 3 is the number of steps you want it to go in that path, I've been doing 3, but you can put in -1 if you want it to go on the full path arriving to the place all at once.
If you want to make it go to an array of event names and go to the closest one replace the last line of the code with this:
pathfind(["EV01","EV02","EV03","EV04","EV05","EV06","EV07","EV08"],y,id,1,3,s,f)
Any value could be the y-value in this case, it doesn't influence anything but it still needs to be there.
y = 3 #y-value where you want them to go
id = -1 #Event you want to move
s = Proc.new { $game_switches[1999] = true } #Switch that turns on when you successfully arrive
f = Proc.new { $game_switches[2000] = true } #Switch that turns on when you don't successfully arrive
pathfind(x,y,id,1,3,s,f)
The 1 in the example is an optional range away from the location if you want it to have a range of two tiles from that coordinate for instance, or whatever number you put in.
The 3 is the number of steps you want it to go in that path, I've been doing 3, but you can put in -1 if you want it to go on the full path arriving to the place all at once.
If you want to make it go to an array of event names and go to the closest one replace the last line of the code with this:
pathfind(["EV01","EV02","EV03","EV04","EV05","EV06","EV07","EV08"],y,id,1,3,s,f)
Any value could be the y-value in this case, it doesn't influence anything but it still needs to be there.
- Credits
- Orion
Rei
ForeverZer0
Peter Hart
Nils Nilsson
Bertram Raphael