Save Event Position

● ARCHIVED · READ-ONLY
Started by Shaz 28 posts Page 1 of 2 View original ↗
  1. Save Event Position
    2015.11.12
    by Shaz

    Introduction
    This plugin lets you set a position and direction where an event will be the next time the map is loaded

    How to use
    Add to your plugins folder (file name is irrelevant, but I use SaveEventPosition.js). There are no parameters to set.

    Use any of the following plugin calls to save or forget the current event's position:
    SavePos
    SavePos x y
    SavePos x y dir
    ForgetPos

    Use any of the following plugin calls to save or forget another event's position:
    SaveOtherPos eventId
    SaveOtherPos eventId x y
    SaveOtherPos eventId x y dir
    SaveOtherPos mapId eventId x y dir
    ForgetOtherPos eventId
    ForgetOtherPos mapId eventId

    Use any of the following script calls inside a move route to save or forget the target's position (applies to events only):
    this.savePos();
    this.savePos(x, y);
    this.savePos(x, y, dir);
    this.forgetPos();

    mapId, eventId, x, y and dir can be values or formulae to be evaluated. If using a formula in a plugin call, ensure it has no spaces.


    Plugin
    Download from pastebin

    Credit
    - Shaz

    Terms
    - free for use in commercial games

    Notes

    - This plugin does not MOVE an event to the specified position on the current map.  It simply records the 'starting' position for next time the map is loaded.  If you want an event to move to a certain position and then stay there on subsequent map loads, you need to move it there first, with a Set Move Route or a Set Event Location command or similar, and then add the plugin call to save the location.
  2. If I move an event, save it, and then move it again, would I need to forget, move route, and then save again? Or would I just move the event as usual and then save again? 

    Thanks a lot for this, the location resets were making things very frustrating. 
  3. You just need to save it again after moving it again.  You don't need to forget.  There is only one save location for an event, and each time you save, it overwrites what was there previously.  You only need to forget if you want it to go back to its in-editor position.
  4. Hi Shaz,

    Is there a way to get the event's current x location or y location?
  5. If you want an event to save its current position, just call it without passing the x and y variables at all. It defaults to the current x and current y if you don't pass them.
  6. Hi, about the forgetPos pluggings command;


    None of them works for me.


    I have this event that given the moment change of location and savepos. All working until there, but when I want to do that event forgetpos and go back to the in-editor position it does nothing and retains the savepos position.


    I dont know if I'm missing something or is the plugging.
  7. Can you please post a screenshot of the event with the plugin commands visible?  I'd like to see both the ones to make it remember its position, and the one to forget its position, just for clarification.  Please include the entire event window, not just the command list.  I'm interested in the triggers and tab numbers as well as the commands themselves.
  8. I made a new project just to be sure that there wasn't any other plugging interfering.


    First, the savepos command; (it works)

    Spoiler
    Event 1.jpg



    Second, the forgetotherpos command; (doesn't work)

    Spoiler
    Event2.png



    Third, the forgetpos command; (doesn't work)

    Spoiler
    Event1_2.png
  9. Did you go to another map and then back here again to verify the event has not moved back to the original position?  Are you expecting the ForgetPos command to put the event back to its original position immediately?  None of the plugin commands actually cause the event to move anywhere - they just record (or forget) where the event is meant to be placed the next time the map is loaded.

    Shaz said:
    Notes


    - This plugin does not MOVE an event to the specified position on the current map.  It simply records the 'starting' position for next time the map is loaded.  If you want an event to move to a certain position and then stay there on subsequent map loads, you need to move it there first, with a Set Move Route or a Set Event Location command or similar, and then add the plugin call to save the location.



    So this is only an issue if you have used the ForgetPos command, left the map, come back, and the event is still in its previously-saved location.  Is that what is happening?  Or have you just not left the map yet?
  10. I tend to read well the instructions, specially when it doesnt work the way I tought. So yes, I have obviously left the map and come back (thats the main reason one may need this kind of plugging) therefore if you check the first screenshot you will see the door for leaving the map and coming back.


    This is what happens;

    1. I move the event using the event editor, and save his location via savepos
    2. I leave the map and come back to check if it works (it does)
    3. I use the switch to forgetotherpos or I talk to the event to activate the forgetpos plugging.
    4. I leave the map and come back to check if it works (it doesn't) the events holds the previously-saved location.

    No other plugging is installed and the F8 Devolper Tool shows no error.
  11. thanks. I'll see if I can reproduce and fix it.
  12. Hi, the plugin works fine if I run directly this.savePos(); inside a move route via an action button on an event. However, if I run the same through a common event, the position and direction is not saved and changes the direction to facing left upon exiting and returning to the map.
  13. please post a screenshot of your common event making sure to show the whole window, not just the list of commands.


    Without seeing it, I am guessing you've either done a script call (not inside a move route) with this.savePos() or that your common event is an autorun or parallel process, which is not tied to any map event.
  14. The first picture is a normal event which upon meeting the conditions will set up a timer and change to a specific charset frame(Using Galv's plugins) and turn on some self switches(Using Yanfly's plugin) and save the position and direction(Using your script).


    s1.jpg


    The second picture is a common event being run in a parallel process via a normal event in a map. Upon meeting the conditions and using the same plugins, the common event will turn on some switches and change sprite frames, however, this time it won't save the position for event 39 upon exiting the map. And I've even tried to use the SaveOtherPos() plugin command.


    w2.jpg


    Both are two separate events and I'm using them for a farm system I'm trying to make. The 1st event is for the planting process, while the 2nd one is a checker to check if the plant has fully grown. Both are conditioned not to run the same process in conflict with each other and with itself.
  15. Do they both not work, or does the first one work and the second one doesn't?


    Can you try it without Galv's plugin and see if it works?  It might be a compatibility issue.
  16. The first one works just fine, however the second one does not. I tested the second one without Galv's plugin as you said and used normal move routes(up,down,left,right) and sadly I think that it is a compatibility issue. I'm not sure why the first one works perfectly though. Thank you!
  17. So without Galv's plugin, the second one also works?  Does everything else in the common event run when you have both plugins active?
  18. Yes, the second works without Galv's plugin. I'm not sure what you mean, but the common event is conditioned to run only what is required and as an additional assurance, I added the exit event processing and will not run again unless another condition is met. And the only issue when both are active is that even though the sprite frame changed for the event, upon exiting the map and returning, the event changes to a specific frame. Thanks anyway, Shaz! I'll find a work around the common event. Great plugin!
  19. Hello! I know it's been long since this discussion, but I have a kind request. I would have a BIG issue with my project if a feature would not work (not tested it yet). If I switch maps, all my student events will vanish/ or be reset (won't appear due to timer conditional). Let's presume I will fix the timer thingy, is there a way to preserve the REMAINING movement commands of the events? Like, when I get back to the map they remain where they were through plugin,
    but... stick to the remaining number of tiles they have to walk rather than reset and start all over (and end up moving on walls XD) And yes, before you ask, they are Parallel Events. And they are 80. That have to go through different directions, so 1 single parallel event to control them while I put them back as Action Button/ Event Touch would be... strange.

    I found a possible solution, but would really not mind an easier way. Thank you in advance!

    *I just am working towards the most mechanic-intricate RPG Maker MV game*
  20. No, this plugin won't do that. But I believe someone else has written something that might help you. I just don't remember who that was or what it was called. I suggest you post in plugin requests and ask for a plugin that will save the movement route position when leaving a map and resume from the current point when returning.