The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: Dissentrix on January 30, 2015, 07:44:25 PM

Title: [VX REQUEST] Smarter AI
Post by: Dissentrix on January 30, 2015, 07:44:25 PM
Hello, this is my first time posting here.  :) I'm making a game in VX where there are several chase scenes. Now, the thing is, when I set the movement route to "approach", the enemies will chase me. But the problem is that if I'm too far away, they start to act really stupid, either not moving at all or getting stuck in walls.
Now, I'm aware of modern algebra's "Path Finding" script (http://rmrk.net/index.php?topic=25952.0) and Yanfly's "Chase event". But the first doesn't allow you to make enemies chase the player, only go to a specific point, and the second is not available for VX. So what I'd like is for someone to get the AI to do a good pathfinding, like in modern algebra's script, AND chase the player.
Thank you very much !
Title: Re: [VX REQUEST] Smarter AI
Post by: &&&&&&&&&&&&& on January 30, 2015, 09:13:34 PM
http://forums.rpgmakerweb.com/index.php?/topic/3064-pathfinding/

Code: [Select]
Example of following the player at a distance, either using:

Event's custom move route (on repeat):
  find_path($game_player.x, $game_player.y, 3)
Or set move route command in a loop:
  find_path($game_player.x, $game_player.y, 0, true, 3)


You may also use find_path(x, y) (no ev or wait) inside of an event's
"Set Move Route..." command, using the "Script..." tab. This does the same
as above, but takes on the properties of the move route you are making,
including the affected character.
Title: Re: [VX REQUEST] Smarter AI
Post by: Dissentrix on January 30, 2015, 11:40:29 PM
I tried it and got the following error :
ArgumentError occurred while running script.

wrong number of arguments(3 for 2)

Now I'm a complete noob at scripting, but are you sure Jet's pathfinding is meant for VX ?
Title: Re: [VX REQUEST] Smarter AI
Post by: &&&&&&&&&&&&& on January 31, 2015, 03:20:31 AM
Wow. I'm an idiot.
I didn't realized it but yeah, that's an VX Ace script. Sorry about that.

Try out Modern's script.
In the custom move route, select script and put this-
Code: [Select]
find_path($game_player.x, $game_player.y)
Title: Re: [VX REQUEST] Smarter AI
Post by: Dissentrix on January 31, 2015, 11:28:45 AM
This time, I got no error, which is something, but the event also didn't move at all. I'm not sure modern algebra's script handles finding a global variable :(
Title: Re: [VX REQUEST] Smarter AI
Post by: &&&&&&&&&&&&& on January 31, 2015, 06:50:04 PM
Sorry, I'm good with this stuff.

Maybe Modern Algebra will show up and help.
He does that sometimes.
Or maybe another scripter will show up.
Title: Re: [VX REQUEST] Smarter AI
Post by: Dissentrix on January 31, 2015, 07:02:35 PM
Ok, thanks very much anyway for trying :)