Because you wrote GameVariables and not $gameVariables
Smart Pathfinding
JS Plugin Releases (RMMV)Ok, now it's working right, sorta. But I'm noticing the event is running into a wall in my test map. Not really "Smart" pathfinding. Was this script suppose to have the event pathfind around impassable walls?
Yes, so that means you're either not calling it properly or you have another plugin below it that's interfering.
Can you please show a screenshot of your event window with the plugin call visible, and also a screenshot showing your plugin window so I can see what you have installed and activated? You can also disable other plugins one by one, testing as you go, to see if it starts working after a particular one is disabled.
Can you please show a screenshot of your event window with the plugin call visible, and also a screenshot showing your plugin window so I can see what you have installed and activated? You can also disable other plugins one by one, testing as you go, to see if it starts working after a particular one is disabled.
Here, and thanks for helping me out.
It may be that you have it set to parallel processing. That means the list of events (even though you only have one) is going to run repeatedly.
Normally you would put a movement command on an event that's triggered by action button or player touch. So can you try that? Change the event so it's not parallel processing and cut the event command. Now make another event and paste the command into it. Either make it Action Button trigger and give it a sprite so you can interact with it, or set it to Player Touch and make your player walk over it. See if the event does the smart pathfinding then. If it does, we can go on to figure out what's the best way to call the command.
Normally you would put a movement command on an event that's triggered by action button or player touch. So can you try that? Change the event so it's not parallel processing and cut the event command. Now make another event and paste the command into it. Either make it Action Button trigger and give it a sprite so you can interact with it, or set it to Player Touch and make your player walk over it. See if the event does the smart pathfinding then. If it does, we can go on to figure out what's the best way to call the command.
Hello Shaz!
First off, I just wanted to say thank you for the smart path finding script! It works extremely well. Death randomly appears in my Infinity dungeon to chase down the players causing instant death on contact! Its great fun and much improved thanks to you!
Secondly, I was wondering if you also had a script, a smart path finding script that worked to actively flee the player! This would work well with my randomly spawning "treasure goblins" (a la Diablo 3)!
I work at a local college teaching Video Game Development and I chose RPG Maker MV as the game engine for the class. I am new to the whole RPG maker thing! I am loving MV so far and I plan to release a full fledge commercial game by the end of next year.
Regards,
Freddie
First off, I just wanted to say thank you for the smart path finding script! It works extremely well. Death randomly appears in my Infinity dungeon to chase down the players causing instant death on contact! Its great fun and much improved thanks to you!
Secondly, I was wondering if you also had a script, a smart path finding script that worked to actively flee the player! This would work well with my randomly spawning "treasure goblins" (a la Diablo 3)!
I work at a local college teaching Video Game Development and I chose RPG Maker MV as the game engine for the class. I am new to the whole RPG maker thing! I am loving MV so far and I plan to release a full fledge commercial game by the end of next year.
Regards,
Freddie
I don't have a script that lets an event flee the player. But I have seen the requirement mentioned before, so there may be a script out there already that does it.
It would be an interesting challenge, but if you were to wait for me to have time to look at it, I'm afraid you might be waiting a while. It might be worth posting a plugin request for it.
It would be an interesting challenge, but if you were to wait for me to have time to look at it, I'm afraid you might be waiting a while. It might be worth posting a plugin request for it.
First, I'd like to thank you for your hard work making this plugin, second, I need to say that, while is rather remarkable and useful, it is severely lacking in some functionality, mainly a 'wait' function. (I know that a forum goer created a 'wait' function to go with the plugin, though when I tried that it worked just as well as without.) While this has great potential for use, I'm afraid some of its drawbacks, such as requiring a second command to stop the pathfinding and needing extra work with variables to get the sprite moving from one spot to the next without trouble, detract from the plugin enough to cause me not to use it, even though anymore I rely on pathfinding to get my characters to where they need to go.
Again, I appreciate your hard work, and I thank you again for what you have made, perhaps in the future I will be able to use it without feeling aggravated.
Again, I appreciate your hard work, and I thank you again for what you have made, perhaps in the future I will be able to use it without feeling aggravated.
Hello Shaz,
First off I wanted to thank you for a great plugin.
Second, I did find an issue with the plugin. As you know I have death (an event that causes game over on player touch) chase the player. With the help of Hime I have been able to make the event activate on follower touch (which is icing on the cake), however we did find an issue with the path finding of the plugin.
it seems that the plugin views followers as obstacles and therefore at times will get stuck on walls when the event cannot find a clear path to the player. I attached an image with Hime's explanation since it is so much better than mine.

Think this can be fixed?
Thanks for your time,
Freddie
p.s. an event flee player has been created ;0)
First off I wanted to thank you for a great plugin.
Second, I did find an issue with the plugin. As you know I have death (an event that causes game over on player touch) chase the player. With the help of Hime I have been able to make the event activate on follower touch (which is icing on the cake), however we did find an issue with the path finding of the plugin.
it seems that the plugin views followers as obstacles and therefore at times will get stuck on walls when the event cannot find a clear path to the player. I attached an image with Hime's explanation since it is so much better than mine.

Think this can be fixed?
Thanks for your time,
Freddie
p.s. an event flee player has been created ;0)
The plugin has no influence on how an object makes its way towards its target - it just uses the normal pathfinding logic in the default scripts. The plugin simply lets you tell an event what its destination should be, and it uses the default pathfinding to make its way there.
Since the plugin doesn't control HOW the event moves, there's really not much I can do with it to tell it to ignore followers. You would need to have a new plugin written that you can combine with this one, or modify the default scripts.
Since the plugin doesn't control HOW the event moves, there's really not much I can do with it to tell it to ignore followers. You would need to have a new plugin written that you can combine with this one, or modify the default scripts.
Awesome... exactly what i need to port my map script '-'
If I ever understand how to work with maps on MV, that is...
If I ever understand how to work with maps on MV, that is...
is there a way to queue movement?
i.e. go here then go here where the time to reach each place is unpredictable?
i.e. go here then go here where the time to reach each place is unpredictable?
no, but the modified version provided in this thread might let you do something like that.
I'd just do a loop that checks the event's coordinates and breaks when the event is at the desired location.
I'd just do a loop that checks the event's coordinates and breaks when the event is at the desired location.
yeah looks like that check is in the enhanced version within the loop
though for me it never triggers, (because _target && _targetAutoCancel are false)
I think I've misplaced my "this" context because I've been accessing the script like this:
$gameMap.event(1).setTarget($gameMap.event(2));
because I can't get this plugin interface to work with the code below
is this correct? :
var interp = new Game_Interpreter;
interp.pluginCommand('SMARTPATH',['001','002']);
I'm running this code after the Scene_map.onMapLoaded event
(assuming I have a 001 and 002 event)
edit:
I get the error cannot ready property setTarget of null which makes sense to me, args are just simple strings without setTarget methods but that is how to trigger it based on this post at least:
edit for clarity:
I guess my question is: how do I run smart path from JavaScript?
though for me it never triggers, (because _target && _targetAutoCancel are false)
I think I've misplaced my "this" context because I've been accessing the script like this:
$gameMap.event(1).setTarget($gameMap.event(2));
because I can't get this plugin interface to work with the code below
is this correct? :
var interp = new Game_Interpreter;
interp.pluginCommand('SMARTPATH',['001','002']);
I'm running this code after the Scene_map.onMapLoaded event
(assuming I have a 001 and 002 event)
edit:
I get the error cannot ready property setTarget of null which makes sense to me, args are just simple strings without setTarget methods but that is how to trigger it based on this post at least:
edit for clarity:
I guess my question is: how do I run smart path from JavaScript?
to be honest, I don't know if you can. Why do you want to run it from a script rather than an event call?
to pro-grammatically spawn npcs and give them a bit of AI i.e. hunger more than 10 go to eat to help bring my game to life a bit
can I invoke an event call from JavaScript?
can I invoke an event call from JavaScript?
it would be difficult, and not the best way to do it. I suggest if you want to do that, you start a new thread explaining what you're trying to achieve, and see what suggestions are made. I think it would be better to drive everything from events rather than a script.
MSE detects a virus on the file. Thought you should know.
I really don't know how that can happen, because it isn't a file - it's pure text that you are meant to copy/paste into a file that you create, with the correct name/extension in the correct area.
And that is exactly what I did. But there is also a .js file you can download. Looks like MSE detects bogus viruses on js files.
Original thread: https://forums.rpgmakerweb.com/threads/smart-pathfinding.46761/