Hello there!
There are lots of ways, but for example: You could write the algorithm in a module and then include the module in Game_CharacterBase, or just write the methods that you need in that class. Once the algorithm has found the path and you have all the nodes with its parents, you'll have to "reconstruct the path" by getting the direction of each node, first relatively to the character you want to move and then to the node where the character has moved, so you can create a MoveRoute (see help file).
That is pretty much where you should start, if you have some concise questions, let me know.
Cheers.
Game_Character has this built in method:
#-------------------------------------------------------------------------- # * Move Toward Character #-------------------------------------------------------------------------- def move_toward_character(character) sx = distance_x_from(character.x) sy = distance_y_from(character.y) if sx.abs > sy.abs move_straight(sx > 0 ? 4 : 6) move_straight(sy > 0 ? 8 : 2) if !@move_succeed && sy != 0 elsif sy != 0 move_straight(sy > 0 ? 8 : 2) move_straight(sx > 0 ? 4 : 6) if !@move_succeed && sx != 0 end endBut as you can see, it literally "moves it toward" the target, no pathfinding is performed. Once you have implemented your pathfinding, you will be able to move characters to any node on the map, and consequently to any character on the map (if you use the x & y of said character as the target node).
You mean en event follower? Because default followers from Ace got the "through" variable set to true and thus they don't block your way. If it is an event, make it "through" by checking that option in the event's Option section.
yes, via events that is possible... you'd probably use a touch triggered event to do that...
I tried this
1. Approach npcA (with player touch) so that he will go to a certain location
2. NpcA(with the exact location of the another npc) doesn't move at all.
Also I did put a battle processing event on npcB.
NpcB also have event trigger.
where did I do wrong?
You will only use 1 event to control those two "NPC"...
You will probably use the first touch event to do it
[Event]
Set move route of NPC 1 (do not wait)
Set move route of NPC 2 (wait)
Battle Processing
well, I never used that script... but whenever you wanna address an event script-wise it would be
$game_map.events[id]
where ID is the ID of the event