Lufiastyle event mover

Hello everyone,


Thanks for taking a look at my post.


Since a few days ago I started working on scripts for RPGMakerMV again. So I made a script that let events move after you did move. In the same style as Lufia.


The script: Frysning_EventMover


I will explain here some more of the interesting things, you can also always refer to the help of the script.


The Globals:


The script only has one global at the moment.

  • speed (the default speed an event should use. Default value = 4)



Options:


The options you have how a monster will move.

  • <Move_With_Player> This will make it that the event will move when you move. It will be a random movement.
  • <Stalk_Player>This will make the event use the approach way to get to you.
  • <Escape_Player>This will make the event run away from a player
  • <Mimic_Player>The event will do the same move as the player.
  • <Reverse_Mimic_Player>The event will do the opposite move as the player
  • <Move_Custom>This will make the event follow the custom route you give



You can also create it so that the event will trigger after a few steps of the player.


<Move_With_Player 3>


Every 3th step you do will trigger the event move once. This works for all the functions.


You can also let an event move more tiles then 1 after every move you make or after the steps.


<Move_With_Player m2>


The event will now move 2 tiles in place of 1.


Combining wait and move more tiles


<Move_With_Player 3 m2>


After every 3th step of the player the event moves 2.


Custom speed:


<Move_With_Player s3>


The event will now have a move speed of 3. This works but will create wonky animations.


If you want to use a speed lower then 4 I recommend you to use the wait as well.
Example: <Move_With_Player 4 s3>


You can chain all 3 of them, but it will look weird.


NOTES:


The speed of the event will always be 4. Reason otherwise it looks like the events warp around.


Making the speed faster is no problem making it slower well that is.


Using other speeds and get a flowing animation:

  • Speed 1 = 16 waits
  • Speed 2 = 8 waits
  • Speed 3 = 4 waits

This way you can make it so that the events moves nicely.
With speeds lower then 4 don't skip tiles because it looks really weird.

If you use the multi-step then the event speed will be 6 for the same reason.
Multi-step of 2 and the speed of 6 looks the best.



Have fun with using this script!


Suggestions, Questions, Bugs? Post here or contact me in an other way!


=========================PROBLEMS======================================
None that I know at the moment.


=========================================================================


****************************************TODO*********************************************************************


Making the movement of the "events" smoother if the player is dashing.  (Low)
Making events move when the player can't (Low)


*********************************************************************************************************************


Terms of use:


This script is free to use for non-commercial.
I like to see what you did with it, so send me a copy of the game please :3
If you go commercial contact me please and we will sort it out really fast!  
For both I really want some credit :3
Holy crap. This is actually amazing!


Fantastic job here! I wasn't expecting the advanced movements (i.e. two for every one step) to be included. Thanks for sharing!
Could there be an option for the script to detect a mouse click?


For instance, if I run into something, that doesn't count as a "move" and there are instances where it'd be cool if it did..
When you use  <Move_Custom> the event don't wait for player and move with it custom route.


To fix that change line:


var notePattern = /<((?:Move_With_Player)|(?:Mimic_Player)|(?:Reverse_Mimic_Player)|(?:Stalk_Player)|(?:Escape_Player))(?:[ ]?)([0-9]*)(?:[ ]?)m?([0-9]*)(?:[ ]?)s?([0-9]*)>/i;


into:


var notePattern = /<((?:Move_With_Player)|(?:Move_Custom)|(?:Mimic_Player)|(?:Reverse_Mimic_Player)|(?:Stalk_Player)|(?:Escape_Player))(?:[ ]?)([0-9]*)(?:[ ]?)m?([0-9]*)(?:[ ]?)s?([0-9]*)>/i;




and line:


this.prototype.MoveType = 5;


into:


this.MoveType = 5;


And it will works fine 😀
When you use Erase Event in event page an error occurs:


TypeError: Cannot read property 'list' of undefined
at Game_Event.PageSetup (/C:/Users/x/Desktop/y/js/plugins/Frysning_EventMover.js:156)
at Game_Event.refresh (/C:/Users/x/Desktop/y/js/plugins/Frysning_EventMover.js:136)
at Game_Event.erase (rpg_objects.js:8565)
at Game_Map.eraseEvent (rpg_objects.js:5539)
at Game_Interpreter.command214 (rpg_objects.js:9787)
at Game_Interpreter.executeCommand (rpg_objects.js:8895)
at Game_Interpreter.update (rpg_objects.js:8803)
at Game_Map.updateInterpreter (rpg_objects.js:6080)
at Game_Map.update (rpg_objects.js:5987)
at Scene_Map.updateMain (rpg_scenes.js:417)


Edit:


to fix that change line in function Game_Event.prototype.PageSetup = function () {:


if (!this){


into:

Code:
    if (!this.page()){
Could there be an option for the script to detect a mouse click?


For instance, if I run into something, that doesn't count as a "move" and there are instances where it'd be cool if it did..


It should work, but let me look at it in a few days.
 

When you use  <Move_Custom> the event don't wait for player and move with it custom route.


To fix that change line:



var notePattern = /<((?:Move_With_Player)|(?:Mimic_Player)|(?:Reverse_Mimic_Player)|(?:Stalk_Player)|(?:Escape_Player))(?:[ ]?)([0-9]*)(?:[ ]?)m?([0-9]*)(?:[ ]?)s?([0-9]*)>/i;


into:



var notePattern = /<((?:Move_With_Player)|(?:Move_Custom)|(?:Mimic_Player)|(?:Reverse_Mimic_Player)|(?:Stalk_Player)|(?:Escape_Player))(?:[ ]?)([0-9]*)(?:[ ]?)m?([0-9]*)(?:[ ]?)s?([0-9]*)>/i;




and line:



this.prototype.MoveType = 5;


into:



this.MoveType = 5;


And it will works fine 😀


Thanks for finding that out, I will update the file soon with those fixes.

When you use Erase Event in event page an error occurs:



TypeError: Cannot read property 'list' of undefined
at Game_Event.PageSetup (/C:/Users/x/Desktop/y/js/plugins/Frysning_EventMover.js:156)
at Game_Event.refresh (/C:/Users/x/Desktop/y/js/plugins/Frysning_EventMover.js:136)
at Game_Event.erase (rpg_objects.js:8565)
at Game_Map.eraseEvent (rpg_objects.js:5539)
at Game_Interpreter.command214 (rpg_objects.js:9787)
at Game_Interpreter.executeCommand (rpg_objects.js:8895)
at Game_Interpreter.update (rpg_objects.js:8803)
at Game_Map.updateInterpreter (rpg_objects.js:6080)
at Game_Map.update (rpg_objects.js:5987)
at Scene_Map.updateMain (rpg_scenes.js:417)


I will also take a look at this one.


Sorry for the problems with this!
 
np i fixed it 😀


it's a great script but need some love to be wonderfull <3 


I'm always love lufia II enemy encounter style <3


And thanks to you it is now possible in mv 😀  Big thanks 😀
np i'm fixed it 😀


it's a great script but need some love to be wonderfull <3 


I'm always love lufia II enemy encounter style <3


And thanks to you it is now possible in mv 😀  Big thanks 😀



Where those lines the only ones you had to change? : D

Yeah I am not a big fan of to much random encounters, so I kinda needed it for my game XD
Where those lines the only ones you had to change? : D

161 185 153
THANK YOU. I have been scratching my head for a few days of how to resolve an issue.


Carrying an object over my head. I was using move to variables xy (my position x and y-1). but the object would move only after i was in the spot. it worked but was very choppy. by using your script, I simply used <Mimic_Player> and had a smooth carry. I highly recommend this plugin for anyone doing puzzle solving, carrying, etc etc


think zelda's hero, link and his pot throwing. I can throw the item, have it crash etc. but its done with jump xy. this means there's no collision (lands on roofs, goes through walls). It also means I see a broken pot on non-solid surfaces like water or holes. Does anyone know of a plugin or how to set this up better? I wish yanfly included a smartjump for events too.
First of all: That Script is awesome! It is exactly what I was looking for as a Lufia maniac!


Okay now that that is out of the way....here is my problem:


While using your script the monster events always disappear instead of moving. At first I thought it was because I used the Erase Event command but even after taking that command out of the event there was no movement from the event itself and after I began moving my character the event just disappeared again.


Also the event itself works fine and wanders about if I just remove the comment <Move_With_Player>...


Any ideas how to fix my problem? Help will be appreciated.


Thanks in advance 🙂


By the way I just found out that the event itself apparently moves and still exists. It just becomes invisible for whatever reason.
161 185 153


Thanks just updated the git!
 

First of all: That Script is awesome! It is exactly what I was looking for as a Lufia maniac!


Okay now that that is out of the way....here is my problem:


While using your script the monster events always disappear instead of moving. At first I thought it was because I used the Erase Event command but even after taking that command out of the event there was no movement from the event itself and after I began moving my character the event just disappeared again.


Also the event itself works fine and wanders about if I just remove the comment <Move_With_Player>...


Any ideas how to fix my problem? Help will be appreciated.


Thanks in advance 🙂


By the way I just found out that the event itself apparently moves and still exists. It just becomes invisible for whatever reason.


I just updated the script on github with the changes that Znikomek made. Can you try and use that version?

Also if you still get the problems can you give me a screenshot of the event?
Could there be an option for the script to detect a mouse click?


For instance, if I run into something, that doesn't count as a "move" and there are instances where it'd be cool if it did..


Really sorry for this really late late reaction. I am willing to make something for this, but this will be wonky. The other events get moved after the player really did take a "step". In this case I need to to trigger the movement on a different level. I kinda took a long break from MV I will need a while to learn the base source code again.


If you still want/need this let me know, before I put to much time in it!
Sadly the event still disappears upon my movement...I even simplified the event itself do do...nothing....but still no improvement....but yeah here a picture of the event itself. Also I even turned all plugins off and stuff...I seriously don't know where it goes wrong....


View attachment 51356
Sadly the event still disappears upon my movement...I even simplified the event itself do do...nothing....but still no improvement....but yeah here a picture of the event itself. Also I even turned all plugins off and stuff...I seriously don't know where it goes wrong....


View attachment 51356


Attachment is not working D : .
Okay nevermind...I found the error and it's working now. I just failed to name the plugin exactly as you had it (swapped the s and n in Frysning) and thus it didn't work at all. But now that I've named it correctly it works as it should.
Thanks for the help and especially for such an awesome script. Keep up the good work 😉
Okay nevermind...I found the error and it's working now. I just failed to name the plugin exactly as you had it (swapped the s and n in Frysning) and thus it didn't work at all. But now that I've named it correctly it works as it should.
Thanks for the help and especially for such an awesome script. Keep up the good work 😉



0.o Why would you rename it : P


You're welcome, I hope you can use it well if you have any problems just post them!
Really sorry for this really late late reaction. I am willing to make something for this, but this will be wonky. The other events get moved after the player really did take a "step". In this case I need to to trigger the movement on a different level. I kinda took a long break from MV I will need a while to learn the base source code again.


If you still want/need this let me know, before I put to much time in it!



I think I was trying to use it for Roguelike combat - where you "bump" into a monster to fight it.  Since the script didn't count a blocked move as a "move" it made problems.

I ended up creating my own setup to do this, but it could help others who want to do Roguelike style movement with on-map combat.

 
This is exactly what I was trying to replicate, but having not played Lufia I managed to miss it this whole time. Nice variety of options, too.


Does this trigger off move routes assigned to the player, though? Like, if I put them on a slide. Alternatively, is there any way to make the player "lose turns" relative to enemies- counting up a step without letting the player move, maybe via plugin command?
Leaving this here for any future plugin users:

I managed to solve the speed problems when the player is dashing. Just add
Code:
Game_Event.prototype.isDashing = function() {
    return (this.isExtraEvent && $gamePlayer.isDashing());
};
to the end of the file, and any event with a movement type will dash along with the player, making it work like a fast-forward button.

Original thread: https://forums.rpgmakerweb.com/threads/lufiastyle-event-mover.64947/