EST - SAVE MAP EVENTS (My First Java Script Plugin)

Discussion in 'JS Plugin Releases (RMMV)' started by estriole, Oct 25, 2015.

  1. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    ■ Information      ╒══════════════════════════╛
     EST - Save Map Event
     Version: 1.6
     By Estriole
     File name: EST_Save_Map_Event.js
     
      ■ Changelog       ╒══════════════════════════╛
    Earlier changelog inside spoiler...

     v1.0 2015.10.25           Initial Release
     v1.1 2015.10.28     - minor change in unerase method
     v1.2 2015.10.31     - add notetags for event you want the page to "reset" upon reentering the map...
                           give comment
                           <reinit_event>
                           so the event page will be reseted to prior activating the page when transfering to map.
                           if you create door manually without move route > this event > Through ON...
                           or with through on but also with through OFF... you need to add above comment tag.
                           if you use auto door... see below:

                         - add auto door event detection... (in editor right click quick event creation > door)
                         since it's tedious work to edit ALL your auto door...
                         i detect it like this:
                         if there's Event Command > Move Route > This Event > Through ON
                         AND
                         if there's NO Event Command > Move Route > This Event > Through OFF

                         i assume it's auto door event...
                         
                         - although it's "RARE"... is there a scenario that event like above is NOT an autodoor event?
                         if yes... don't worry... you could add comment at the "RARE EVENT" page:
                         <not_auto_door>
                         and it won't reset the page.
     v1.3 2015.11.01     - fix crash when no event page met condition...
     v1.4 2015.11.02     - new method to delete saved event so it will reload the map next time entering the map
                           Plugin parameter format change. so it's okay to rename the .js files.
     v1.5 2015.12.02     - removed plugin parameter auto save. because of save file for browser limitation
                         is around 5.000 event...(5mb. 1b = 1event average) you need to pick which map you want to
                         auto save by giving map notetags <auto_save_event>
                         it will tag the map event to save it's event. also... there will be update in
                         EST - CLONE EVENT to NOT save the map event if the map not tagged with that notetags.
                         so we can clone / add event in every map. but if we want it to have permanent changes...
                         the notetags required in the map note.
     v1.6 2015.12.06     - ability to tag event note / tag event page comment with <temporary_event>
                         to make it deleted when reenter map.
     
     ■ Introduction     ╒══════════════════════════╛
     This plugin can make us save the map events so  it won't be reloaded
     from database when entering new map. it will use saved event instead

     ■ Features         ╒══════════════════════════╛
     - save map events
     - not reload event at map enter but use saved event
     - option to reset event page prior entering the map
     
     ■ Plugin Download ╒══════════════════════════╛
    dropbox
    Demo  (All Build And Decor share the same demo)
     ■ How to use       ╒══════════════════════════╛
     1) Saving map events to memory
     Plugin Command:

        save_cur_map   or Script Call:

      $gameMap.save_cur_map() (also in case you want to use this from other plugin)

     IF you have event which change it's graphic (example Door)
     and you need to revert the changes back when doing transfer...
     add this COMMENT in the door event page

     <reinit_event> warning it won't reinit self switch!!!. this just change the page to state prior
     activating the page...

     if you use AUTO DOOR (in editor > right click > quick event creation > Door)
     i include some automatic detection. and you don't have to add any comment tags.
     the detection work like this:

                       
     although it's "RARE"... is there a scenario that event like above is NOT an autodoor event?
     if yes... don't worry... you could add comment at the "RARE EVENT" page:

     <not_auto_door> and it won't reset the page.
     
     2) Deleting map events from memory (it will reload map event from editor next time reenter map)
     self switch is left as it is though... so if any changes on self switch will be remain there.
     if you don't want this behavior use number 3) method below

     Plugin Command:

      delete_cur_map   or Script Call:

        $gameMap.delete_cur_map() 3) RESETING map events to editor (all self switch also will be set to false)  
     Plugin Command:

        reset_cur_map   or Script Call:

        $gameMap.reset_cur_map() 4) AUTO SAVING map event... WARNING... don't save too many map with many events if you make
     browser game. since there's 5mb size limitation (around 5000 event).
     so if you want to autosave in a certain map. add this in map note

     <auto_save_event> this note will also automatically save map events when there's a change using
     EST Clone Transform Delete Event.
     

     5) to make event temporary. (will be deleted at entering the map. useful for spawned event you
     want to not stay the next time you reenter the map). add this in either event note or event page comment

     <temporary_event> ■ Dependencies     ╒══════════════════════════╛
     none
     
    ■ Compatibility    ╒══════════════════════════╛
     I'm new in JS... and MV is new engine... so i cannot say for sure.
     but it should be compatible with most things. this even compatible with
     Hudell - Custom Event
     
     ■ Parameters       ╒══════════════════════════╛
     None

    Credit and Thanks
    - Estriole
     

     ■ Author's Notes   ╒══════════════════════════╛
     This is part of the EST - DECOR AND BUILD SERIES.


      EST - SAVE MAP EVENTS

      EST - CLONE TRANSFORM DELETE EVENT

      EST - EVENT GRAPHIC SHIFT

      EST - EVENT SIZE AND TRIGGER

      EST - BUILD AND DECOR EX

      EST - REGIONMAPLOADER
     
    Last edited by a moderator: Dec 6, 2015
    #1
    DangDut, Lee Sang and Makeratore like this.
  2. Makeratore

    Makeratore Veteran Veteran

    Messages:
    187
    Likes Received:
    51
    Location:
    Rome, Italy
    First Language:
    Italian
    OMG

    We will have Build and Decor series again!!! YEAH!!! I cannot wait. XD

    Anyway, this first plugin sounds interesting. :D
     
    #2
  3. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,323
    Likes Received:
    2,962
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    You have much more than Ctrl + Shift + F now, just use either Atom or Sublime Text and add the default scripts on it :)
     
    #3
    estriole likes this.
  4. Silent Darkness

    Silent Darkness Robomage Veteran

    Messages:
    2,284
    Likes Received:
    321
    Location:
    Dark Realms
    First Language:
    English
    Isn't Yanfly working on a script that does the exact same thing?
     
    #4
    Prescott likes this.
  5. Prescott

    Prescott argggghhh Veteran

    Messages:
    456
    Likes Received:
    326
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Yeah there is a plugin already in MV by Yanfly that does this exact thing, you can define which map saves them and even individual events that save their places. Sorry :\
     
    #5
  6. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    hmmm... i'm not too good at javascript yet... but when i see yanfly plugin... it's a bit different... (feel free to correct me if i'm wrong)

    yanfly relocate the new created event after it reloaded...

    while this script use the "same event". the ending result might "look" the same...

    the difference will be shown when you're removing one event from map / adding new event on map / replacing the event with other map event...

    (later on the next plugin... it will be really slow process >.<)

    although this plugin might not (or might) compatible with Hudell Orange Custom Event (basically event cloner).

    i guess i might still create my own event cloner since i need the cloner to work as i need for doing the BUILD AND DECOR series.

    Hudell plugin is really good... but his script is adding new event on map setup. then do the setting of all self switches, etc. while in my build and decor script. I store the all the events in a variable. then when at map load directly use the stored event without any default loading...

    the difference??? not much... but on the long run it will be easier to control when we add some more "OPTION" to our event. such as giving size... (Hudell done this too... he's really good :D ), giving extra trigger on other location, shifting the graphic by x tiles, etc.

    anyway... even there's some plugin that similar / even the same... it's okay in my opinion. since it give people more option when there's conflicting plugins.

    just like script in ACE. we can use one script but when it's not compatible with other script... we might find another script that do the same that compatible...

    thanks for information... i might check Atom / Sublime Text...

    btw i might create plugin that similar to you... (clone event) hope you're not offended... :D . i'm not competing with anyone :D .

    EDIT: after quick though... other thing that i miss from ACE.... showing which line is crashing the game...(even sometime it's not accurate). MV didn't show that T.T
     
    Last edited by a moderator: Oct 25, 2015
    #6
    Hudell likes this.
  7. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,323
    Likes Received:
    2,962
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    I find it funny how Custom Event became a event cloner, because cloning events was just an after thought. The real intention of the plugin was for it to be a base for Event Creator and some other plugins I'm going to make.
    Sure, no problem! I also created some plugins that already existed (although I didn't know about them when I did).

    If you run the game on chrome and open the developer tools, on the "Sources" tab, there's a button called "Pause on exceptions". If you press it, chrome will pause the JS processing everytime an error occurs, as long as you have the developer tools open.
    While it's paused, you can check the current value of variables, execute something on the console or resume the JS execution.


    You can also see the JS be executed line by line, it's awesome :D .
     
    #7
    estriole likes this.
  8. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    sorry... what i mean the "event clone" part of that script... :D . the proper wording might be:

    although this plugin might not (or might) compatible with Hudell Orange Custom Event (basically event cloner part). :D

    for run the game on chrome... how can we do that? i usually use the playtest on editor :D .
     
    #8
  9. Hudell

    Hudell Dog Lord Veteran

    Messages:
    3,323
    Likes Received:
    2,962
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Someone made a good explanation on a thread today, but there were so many new threads that it's hard to find :X
     
    #9
  10. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    updated the script to v.1.1

    changelog : minor change to event unerase method. (yes... level up JS skill so improved code)

    tonight i will post the second plugin

    the plugin can add event to current map based on template, transform event in current map based on template, and deleting event in current map.

    template can be in same map or making Template Map and put all your event to be cloned there (if you use my Build and Decor Series you might know already)

    any sugestion for the plugin name (currently named EST - CLONE EVENT)

    hopefully i can convert all the series quickly...
     
    #10
    Makeratore likes this.
  11. Makeratore

    Makeratore Veteran Veteran

    Messages:
    187
    Likes Received:
    51
    Location:
    Rome, Italy
    First Language:
    Italian
    Maybe... EST - STORING EVENTS, or EST- EVENTS MAP.
     
    #11
  12. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    for starter... the previous version plugin is conflicting with AUTO DOOR event creation from editor...

    (from editor... right click... quick event creation... door)

    it's because the auto door event is designed to be deleted after use and recreated when reentering map. and by saving the event that means the event stay with opened door graphic and event through set on...

    i manage to fix this by reiniting the event page...

    the implementation is using two approach:

    1) auto detect event page's event command -> move route command -> (this event) > set through ON... and set through OFF.

    (only if the scope is this event. if the scope is player or other event it won't detect it)

    if ONLY through ON exist then it's autodoor event and automatically reinit at transfer.

    if through ON exist but through OFF exist too... it means not autodoor event. (someone create cutscene perhaps)... and not require reinit...

    What if the event that met above criteria is not auto door event and you don't want it to reset when reentering map???

    you can add comment on event page:

    <not_auto_door>2) if you create your own custom door which don't have event command > move route> this event > through ON. (or having it but also having Through OFF).

    or you have event that you WANT to reinit when reenter the map for whatever reason you can't tell me.

    you could add this comment on event page:

    <reinit_event>this comment tags is having higher priority than <not_auto_door> so having both will still reinit the event.

    the reason i create

    solution 1) because it's tedious to edit all your auto door event and adding the notetags. or create autodoor event and edit the page to add the notetags.

    and event that having event command move route > this event > Through ON without Through OFF is RARE anyway.

    (Please someone can tell me scenario where it could happen... i'm interested in it :D )

    so it would be less edit than editing all your auto door event.

    solution 2) in case people didn't create normal door event. since s/he already so dilligent for not using shortcut auto door event...

    i think s/he's patient enough to add the notetags in each his/her unique special door.

    finally... just want to say:

    PLUGIN UPDATED to version v1.2

    changelog:

     v1.2 2015.10.31     - add notetags for event you want the page to "reset" upon reentering the map...
                           give comment
                           <reinit_event>
                           so the event page will be reseted to prior activating the page when transfering to map.
                           if you create door manually without move route > this event > Through ON...
                           or with through on but also with through OFF... you need to add above comment tag.
                           if you use auto door... see below:

                         - add auto door event detection... (in editor right click quick event creation > door)
                         since it's tedious work to edit ALL your auto door...
                         i detect it like this:
                         if there's Event Command > Move Route > This Event > Through ON
                         AND
                         if there's NO Event Command > Move Route > This Event > Through OFF

                         i assume it's auto door event...
                         
                         - although it's "RARE"... is there a scenario that event like above is NOT an autodoor event?
                         if yes... don't worry... you could add comment at the "RARE EVENT" page:
                         <not_auto_door>
                         and it won't reset the page.
     
     
    Last edited by a moderator: Oct 31, 2015
    #12
  13. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    plugin updated to v1.3

    v1.3 2015.11.01     -     fix crash when no event page met condition...

    (random crash)

    fixed the demo link to point the right file (earlier point to older build so not updated)

    edit: event size plugin is almost finished. currently bugtesting it. and in process to add size trigger and extra trigger feature;
     
    Last edited by a moderator: Nov 1, 2015
    #13
  14. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    updated the script to v1.4

    changelog:

     v1.4 2015.11.02     - new method to delete saved event so it will reload the map next time entering the map
                           Plugin parameter format change. so it's okay to rename the .js files.
     

    Currently in final phase on Build And Decor EX plugin... still working on adding plugin command. i guess tonight the plugin could be released...

    stay tuned :D .

    the plugin is will be conversion of my ACE script:

    http://www.rpgmakervxace.net/topic/15689-est-build-and-decor-series/

    it will be EST - Build and Decor + Decor Movement conversion in one plugin
     
    #14
    Makeratore likes this.
  15. Makeratore

    Makeratore Veteran Veteran

    Messages:
    187
    Likes Received:
    51
    Location:
    Rome, Italy
    First Language:
    Italian
    I'm excited! :D
     
    Last edited by a moderator: Nov 9, 2015
    #15
  16. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    because of there's save limitation for browser game...

    http://forums.rpgmakerweb.com/index.php?/topic/52008-are-there-limits-to-the-save-file-size/

    it's 5mb and about around 5000 event using my plugin...

    i think it's wise to select which map you want to autosave.

    so now you need to tag <auto_save_event> in map notetags if you want the map to be auto saved without calling save_cur_map plugin command manually.

    so i updated plugin to v1.5

     v1.5 2015.12.02     - removed plugin parameter auto save. because of save file for browser limitation
                         is around 5.000 event...(5mb. 1b = 1event average if it's complex event) you need to pick which map you want to
                         auto save by giving map notetags <auto_save_event>
                         it will tag the map event to save it's event. also... there will be update in
                         EST - CLONE EVENT to NOT save the map event if the map not tagged with that notetags.
                         so we can clone / add event in every map. but if we want it to have permanent changes...
                         the notetags required in the map note.
     
    #16
    Makeratore likes this.
  17. Roguedeus

    Roguedeus It's never too late to procrastinate... Veteran

    Messages:
    527
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    Estriole, If I have the map flagged as:

    <auto_save_event>...is there a way that I might reset only one event rather than the entire map?
     
    Last edited by a moderator: Dec 5, 2015
    #17
    estriole likes this.
  18. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    can you clarify a little bit more.... about you want to reset only 1 event.

    by reset... do you mean it's deleted next time you enter the map?

    if yes i might need to update this plugin so can tag event page with something like <temporary_event> to delete it next time the map loaded.

    or if i'm misunderstood feel free to explain it :D .

    edit: there's also existing tag that will work for event that really belong to the map. <reinit_event>

    which will place back the event to it's place (x,y) and act like nothing happen (if the graphic changed it will changed back to original).

    but that tag cannot work with cloned / transformed event since they will be placed like where they were in mastermap.
     
    Last edited by a moderator: Dec 5, 2015
    #18
    Roguedeus likes this.
  19. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    updated plugin to v1.6

     v1.6 2015.12.06     - ability to tag event note / tag event page comment with <temporary_event>
                         to make it deleted when reenter map.
     

    it's used if you add event in the map using my EST - Clone Transform Delete Event plugin and want it to deleted when you reenter the map.

    edit: demo still not updated... since i have to go out for now...

    grab the plugin from the download link instead

    i will edit this post later when i updated the demo.

    EDIT2: demo updated btw... sorry forgot editing this post earlier :p .
     
    Last edited by a moderator: Dec 20, 2015
    #19
    Roguedeus and Makeratore like this.
  20. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,848
    Likes Received:
    7,665
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi estriole! I'm looking at your script and thinking it might be very useful for what I need. I'm just trying to clarify my understanding on something (I've read, but I tend to miss things when I read, so if this information is somewhere already, I apologize).

    For resetting a map's events, does the map number need to go inside the () in the script call? Also, does the script call need to be used on that map, or can I use it in an event on a map right before transfer?

    Thank you!
     
    #20

Share This Page