Hello!
Is there a way to make the game wait for the end of a forced move route, or an option to execute the events prior to map loading?
I use a pathfinder that draws tiles (eg. road) every step it makes, but it is running inside of a move route.
The problem is that I need to draw a road inside a river using a pathfinder that runs as a script call from a move route, and the move route is still running (it's called using "force_move_route") when the water is being drawn, which blocks the pathinder's way.
Even drawing the water after the move route call is blocking the path (I see its a parallel process).
The only way it works is if i change the water tile to not block the path, but I dont want the player to walk over the water (no jokes here hehe).
Looks like even using "force_move_route" the event is triggered only after finishing the map load.
Sorry if its confusing I did my best hahaha.
EDIT:
The event call is as follow:
event = Event.new(from.x, from.y) # this is a wrapper to simplify "RPG::Event"event.set_speed(6)event.set_frequency(5)evt = event.place($game_map.map_id) # this returns the instance of Game_Eventmr = RPG::MoveRoute.newmr.repeat = falsemr.skippable = falsemr.wait = truem = RPG::MoveCommand.newm.code = 45 # sript# "to.x" and "to.y" are parameters, means the desired end positionm.parameters = ['find_path(' + to.x.to_s + ', ' + to.y.to_s + ', true)'] mr.list.insert(0, m.clone)evt.force_move_route(mr)EDIT 2:
Im using JPS Pathfinding: http://www.rpgmakervxace.net/topic/23346-jps-pathfinding/
And what I'm trying to do is draw a random road on the map from the point [x1, y1] to [x2, y2], and I use the pathfinder because the map has some houses in it and I want the option to have a river that crosses the map, in this case the road needs to cross the river, like a bridge, but the river tile is blockable.
I'm using the move route because its the only way to trigger the event that I know of, if there's another way, its acceptable.
Forgot to mention, i tryed the script call from the event itself, but in this case the road is not drawn correctly, i guess the map must be loaded so the pathfinder can check the passable tiles
EDIT 3: I realized that JPS Pathfinding has an option to wait while the path is being traced and now I can block the player movement, which is good enough to hide this from the player, assumming that i can load a sprite or something meanwhile. Anyway the water problem still persists.
EDIT 4: For anyone interested, I gave up on blocking the water and used a script to change the player graphic when its over water, so it looks like swimming
Is there a way to make the game wait for the end of a forced move route, or an option to execute the events prior to map loading?
I use a pathfinder that draws tiles (eg. road) every step it makes, but it is running inside of a move route.
The problem is that I need to draw a road inside a river using a pathfinder that runs as a script call from a move route, and the move route is still running (it's called using "force_move_route") when the water is being drawn, which blocks the pathinder's way.
Even drawing the water after the move route call is blocking the path (I see its a parallel process).
The only way it works is if i change the water tile to not block the path, but I dont want the player to walk over the water (no jokes here hehe).
Looks like even using "force_move_route" the event is triggered only after finishing the map load.
Sorry if its confusing I did my best hahaha.
EDIT:
The event call is as follow:
event = Event.new(from.x, from.y) # this is a wrapper to simplify "RPG::Event"event.set_speed(6)event.set_frequency(5)evt = event.place($game_map.map_id) # this returns the instance of Game_Eventmr = RPG::MoveRoute.newmr.repeat = falsemr.skippable = falsemr.wait = truem = RPG::MoveCommand.newm.code = 45 # sript# "to.x" and "to.y" are parameters, means the desired end positionm.parameters = ['find_path(' + to.x.to_s + ', ' + to.y.to_s + ', true)'] mr.list.insert(0, m.clone)evt.force_move_route(mr)EDIT 2:
Im using JPS Pathfinding: http://www.rpgmakervxace.net/topic/23346-jps-pathfinding/
And what I'm trying to do is draw a random road on the map from the point [x1, y1] to [x2, y2], and I use the pathfinder because the map has some houses in it and I want the option to have a river that crosses the map, in this case the road needs to cross the river, like a bridge, but the river tile is blockable.
I'm using the move route because its the only way to trigger the event that I know of, if there's another way, its acceptable.
Forgot to mention, i tryed the script call from the event itself, but in this case the road is not drawn correctly, i guess the map must be loaded so the pathfinder can check the passable tiles
EDIT 3: I realized that JPS Pathfinding has an option to wait while the path is being traced and now I can block the player movement, which is good enough to hide this from the player, assumming that i can load a sprite or something meanwhile. Anyway the water problem still persists.
EDIT 4: For anyone interested, I gave up on blocking the water and used a script to change the player graphic when its over water, so it looks like swimming