EST - CLONE TRANSFORM DELETE EVENT

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

  1. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
     ■ Information      ╒══════════════════════════╛
     EST - Clone Transform Delete Event
     Version: 1.9
     By Estriole
     File name: EST_Clone_Transform_Delete_Event.js

     ■ Introduction     ╒══════════════════════════╛
     Want to Add New Event based on template event in current / other map
     or Transform Existing Event in current map Based on template event in current / other Map.
     then maybe you want to delete existing Event in current map? Now it's all
     possible with this Plugin.

     This plugin is second part of my Build and Decor Script conversion from ACE - MV

     ■ Features         ╒══════════════════════════╛
     - Add New Event in current map Based on other event in current/other Map.
     - Transform Existing Event in current map Based on other event in current / other Map.
     - Delete Existing Event in CURRENT Map.

     ■ Changelog       ╒══════════════════════════╛

    older changelog inside spoiler

     v1.0 2015.10.29           Initial Release v1.1 2015.11.02           Patch for delete_cur_map from EST_Save_Map_Event plugin
                        to reset selfswitches for event that changed. also method to reinit all map event.
     v1.2 2015.11.09           fixed bugs when having event with higher index than max index of map in editor
                        removed imported and use other method to recognized this script installed or not.
                        some callibration to make it flow with EST BUILD AND DECOR EX plugins.

     v1.3 2015.11.12           fix minor bug which 'sometimes' execute rest of event command after tranforming event.
                        i change it so after event REPLACED using 'transform'. all event command after that will be stopped.

     v1.4 2015.11.27           fixed problem when running game online. and having lots of parallel process
                        that spawn / transform event. then transfer map. it can throw $dataMap null error.
                        this caused by loading map data asynchronously...
                        the 'turnaround' fix is given by hudell. after i pm him for advice.
                        so this plugin now have extra credits you have to add if you use it.
     v1.5 2015.12.02    now if the map didn't tagged with <auto_save_event>. what you clone / transform
                        will not auto saved. and you need to run "save_cur_map" plugin command manually.

     v1.6 2015.12.06    > add method to delete all event based on their source map and id.
                        it will delete all event that cloned from that map and id across all SAVED map
                        > add method to delete event based on their xy
                        (and can delete across map if you save that map)

     v1.7 2015.12.15    > fix incompatibility with EST - EVENT SIZE AND TRIGGER which didn't remove size
                        when event deleted.

     v1.8 2015.12.18    > fix error if no event 1 in map when adding new event...
     v1.9 2015.12.20    > fix error when somehow $dataMap.events have null value as last record...

     ■ Plugin Download ╒══════════════════════════╛
     DOWNLOAD

     ■ Screenshot / Demo  ╒══════════════════════════╛

    Demo

    (all build and decor series converted plugin will have same demo)

     ■ How to use       ╒══════════════════════════╛

    open spoiler since it's a bit long

     1) Add New Event Plugin Command:

      add_event source_map_id source_event_id x y    example:

        add_event 8 2 3 7    will add new event cloned from Map 8 EventId 2
        and will be placed in x = 3 and y = 7.

     Script Call:

      $gameMap.add_event(source_map_id, source_event_id ,x , y);    example:

        $gameMap.add_event(8,2,3,7);    will add new event cloned from Map 8 EventId 2
        and will be placed in x = 3 and y = 7.

     2) Transform Existing Event
     Plugin Command:

      transform_event target_event_id source_map_id source_event_id    example:

        transform_event 24 8 1    will transform event 24 in current map with event
        cloned from Map 8 EventId 1
        x and y will still use old event value.
     

      transform_this_event source_map_id source_event_id    example:

        transform_this_event 8 1    will transform event that called it with event
        cloned from Map 8 EventId 1
        x and y will still use old event value.

     Script Call:

      $gameMap.transform_event(target_event_id, source_map_id, source_event_id);    example:

        $gameMap.transform_event(24,8,1);    will transform event 24 in current map with event
        cloned from Map 8 EventId 1
        x and y will still use old event value.

        some tips... if called from script call event command...

        $gameMap.transform_event(this._eventId,8,1);    will transform event that calling it to event
        cloned from Map 8 EventId 1
        x and y will still use old event value.

     3) Delete Existing Event
    Plugin Command:

      delete_event target_event_id    example:

        delete_event 24    will delete event 24 in current map
     

      delete_this_event    will delete event that called it


     Script Call:

      $gameMap.delete_event(target_event_id);    example:

        $gameMap.delete_event(24);    will delete event 24 in current map

        some tips... if called from script call event command...

        $gameMap.delete_event(this._eventId);    will delete event that CALLED it.
      4) if you want to delete ALL CLONE EVENT based on sourcemapid and source event id
     ACROSS ALL SAVED MAP... (in case you only want instance of that event)

     plugin command:

     DELETE_ALL_EVENT_BY_SOURCE srcMapId srcEventId    example:

        DELETE_ALL_EVENT_BY_SOURCE 8 14    will delete event that cloned from map 8 id 14 across ALL SAVED map.

     script call:

     $gameMap.delete_all_event_bysource(srcMapId,srcEventId);    example:

        $gameMap.delete_all_event_bysource(8,14);    will delete event that cloned from map 8 id 14 across ALL SAVED map.

     5) if you want to delete event based on xy location across ANY SAVED map
      plugin command:

      DELETE_EVENT_BY_XY mapId x y    example:

        DELETE_EVENT_BY_XY 6 7 8    will delete event in map 6, is coordinate x = 7, coordinate y = 8
        MAP 6 MUST BE ALREADY SAVED before you call this. or it will do nothing.

      script call:

      $gameMap.delete_event_byxy(mapId, ev_x, ev_y);    example:

        $gameMap.delete_event_byxy(6, 7, 8);    will delete event in map 6, is coordinate x = 7, coordinate y = 8
        MAP 6 MUST BE ALREADY SAVED before you call this. or it will do nothing.
     ■ Dependencies     ╒══════════════════════════╛
     EST_Save_Map_Event.js plugin MUST be INSTALLED for this plugin to work. click link for the plugin topic

     make sure to use the newest version

     ■ 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. so you can use both script without conflicting.

     ■ Parameters       ╒══════════════════════════╛
     this plugin did not have any parameter to set in plugin manager

     ■ License          ╒══════════════════════════╛
     Free to use in all project (except the one containing pornography)
     as long as i credited (ESTRIOLE).

     ■ Extra Credit          ╒══════════════════════════╛
     - Hudell - for workaround to fix $dataMap.null problem with browser online.

     ■ Support          ╒══════════════════════════╛
     While I'm flattered and I'm glad that people have been sharing and
     asking support for scripts in other RPG Maker communities, I would
     like to ask that you please avoid posting my scripts outside of where
     I frequent because it would make finding support and fixing bugs
     difficult for both of you and me.
       
     If you're ever looking for support, I can be reached at the following:
     [ http://forums.rpgmakerweb.com/ ]
     pm me : 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 20, 2015
    #1
  2. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    fix the demo's not linked correctly (it point to old build)

    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
    #2
  3. Roguedeus

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

    Messages:
    527
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    How is this plugin not getting any attention? It works great. And its SUPER FAST. No lag at all so far, unlike a few other event copy plugins I have tried.

    Great work!
     
    #3
    estriole likes this.
  4. harvard1932

    harvard1932 Veteran Veteran

    Messages:
    40
    Likes Received:
    10
    +1. 

    fast, works flawlessly, and simple. Although... it can be improved if you can also use it in script call.

    edit: LOL, I misread. You can actually script call. +2 now.
     
    Last edited by a moderator: Nov 9, 2015
    #4
  5. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    thanks i hope this plugin could be useful... anyway i quoted you two so you can notice this update announcement :D

    i also updated  my

    EST - SAVE MAP EVENT

    so you need to update it also...

    and

    EST - EVENT SIZE AND TRIGGER

    if you also use it... grab the plugin

    updated the script to v1.2 (yeah double update... i forgot to release the v.1.1. sorry)

    changelog:

     v1.1 2015.11.02           Patch for delete_cur_map from EST_Save_Map_Event plugin

                        to reset selfswitches for event that changed. also method to reinit all map event.

     v1.2 2015.11.09           fixed bugs when having event with higher index than max index of map in editor

                        removed imported and use other method to recognized this script installed or not.

                        some callibration to make it flow with EST BUILD AND DECOR EX plugins.

    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
     
    #5
  6. Roguedeus

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

    Messages:
    527
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    Estriole, is there any reason why transformations would stop working after so many?

    I'm using:

    • Clone Transform Delete Event (v1.2)
    • Save Map Event (v1.4)

    Here are the events in question.

    They are identical... But there are over a dozen of them, in a wide range of ID's... (I replaced existing chests with references)

    (ID:10 works fine)

    (ID:87 just vanishes as if the plugin command never executed)
     
    Last edited by a moderator: Jan 19, 2016
    #6
  7. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    after lots of test... it's because you "erase it" after you transform the data... (if you unerase it it will show the replaced event)

    by logic all your event should all erased...

    but the problem sometime the command stop at the transform event and skip the erase event (which make the event works)

    but sometimes it goes through... and execute erase event after transforming the event... it's a random thing maybe because

    of many event run at once using autorun. (just prediction)

    to fix this issue... i update the script to prevent any event command in that page to execute AFTER the event transformed...

    updated the EST - Clone Transform Delete Event plugin to v.1.3

    changelog

     v1.3 2015.11.12           fix minor bug which 'sometimes' execute rest of event command after tranforming event.

                        i change it so after event REPLACED using 'transform'. all event command after that will be stopped.

    Demo Updated

    > update all plugins above

    > add simple common event usage. using http://forums.rpgmakerweb.com/index.php?/topic/46944-dmv-map-menu-buttons/

    (need feedback... currently i place the event in player x and y)...

    > there's prototype of conversion of formar region data loader ACE script. it's still prototype. and i doubt i can convert it... since map data in ACE and MV is different. >.<. btw... don't use that prototype plugin !!! (i warned you).

    > try the z offset feature of the updated graphic shift. (now the teddy bear is placed above the table)

    > add test map where there's auto run event with transform event and erase event. to demonstrate that after transform event. all event command not executed. thus not erased.
     
    Last edited by a moderator: Nov 13, 2015
    #7
  8. Roguedeus

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

    Messages:
    527
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    Thank you! It works perfectly. I love this plugin. It alone is saving me countless hours of copy/paste monotony. :D

    And that doesn't even include the ability to create events dynamically!
     
    #8
    estriole likes this.
  9. Mattchaby

    Mattchaby Villager Member

    Messages:
    15
    Likes Received:
    3
    First Language:
    French
    Wow Estriole your plugin is amazing thank you this is just what I was looking for.

    Is there a to make the event ID dynamic? Or changed in any way with a value stored in a variable? This would allow to interact with an event on a map that calls a common event that tells it to be transformed in the chosen way. Thanks :)
     
    #9
  10. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    try adding transform to map event plugin command to common event.

    and by calling that common event from any event... it will transform event that called it to what you specify in common event.

    edit: or do you mean you want to transform an event from other event?
     
    Last edited by a moderator: Nov 19, 2015
    #10
  11. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    this few days... i encounter problem with loading map data asynchronously...

    this plugin and region map loader plugin is throwing error $dataMap is null when playing the game ONLINE (if playing locally it won't have problem).

    i consult with Hudell since his custom event plugin also have same problem after i tested it... and he said that

    thus causing the problem... i don't know does this count as MV bug or not. but i need to find a way to "wait until all asynchronous load data finished" before transferring.

    luckily... Hudell find some workaround for this plugin. (sadly region map loader still not fixed).

    so i add that workaround in my plugin... and this plugin won't throw $dataMap is null error.

    in summary. this plugin compatible with browser online game. but region map loader is not compatible yet.

    btw that also mean that if you use this plugin... you have to also credit Hudell.

    since i have a principle that give credits when it's due :D .

    so... updated to v1.4

     v1.4 2015.11.27           fixed problem when running game online. and having lots of parallel process
                        that spawn / transform event. then transfer map. it can throw $dataMap null error.
                        this caused by loading map data asynchronously...
                        the 'turnaround' fix is given by hudell. after i pm him for advice.
                        so this plugin now have extra credits you have to add if you use it.
     

    i'm tackling this problem for few days and quite reach the roadblock. i will try fixing regionmap loader too...

    but finally decide i might do it later when my JS knowledge is better. since i also have some plugins i want to create.

    and by focusing in this issue make me unproductive.

    btw... soon released. (will post the plugin topic after posting this)

    EST - BATTLE ROYALE EVO

    want to have PLAYER + ALLIED ENEMY vs ENEMY vs ENEMY vs ENEMY vs ENEMY vs ENEMY ???

    complex battle where suddenly 3rd party join the battle. maybe some other country troop suddenly attack you and your enemy.

    or some ecosystem where tiger monster eat rabbit monster. it's up to your imagination.
     
    #11
    Roguedeus likes this.
  12. 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...

    so i updated plugin to v1.5

     v1.5 2015.12.02    now if the map didn't tagged with <auto_save_event>. what you clone / transform
                        will not auto saved. and you need to run save_cur_map plugin command manually.

    this also will allow map which you can spawn event but when you reenter it's gone.

    EDIT: You need to update EST - SAVE MAP EVENT to v1.5 too or this will throw error.
     
    Last edited by a moderator: Dec 3, 2015
    #12
    Roguedeus likes this.
  13. Roguedeus

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

    Messages:
    527
    Likes Received:
    106
    First Language:
    English
    Primarily Uses:
    N/A
    Does this update require any other plugin to be updated as well?

    After updating to v1.5 I am getting this error:

    Code:
    TypeError: undefined is not a function    at Game_Map.transform_event (/X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/plugins/EST_Clone_Transform_Delete_Event.js:338)    at Game_Interpreter.pluginCommand (/X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/plugins/EST_Clone_Transform_Delete_Event.js:389)    at Game_Interpreter.pluginCommand (/X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/plugins/YEP_CoreEngine.js:1119)    at Game_Interpreter.pluginCommand (/X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/plugins/YEP_ClassChangeCore.js:616)    at Game_Interpreter.pluginCommand (/X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/plugins/YEP_X_Subclass.js:717)    at Game_Interpreter.pluginCommand (/X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/plugins/YEP_MessageCore.js:398)    at Game_Interpreter.pluginCommand (/X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/plugins/YEP_BattleEngineCore.js:2601)    at Game_Interpreter.pluginCommand (/X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/plugins/YEP_DamageCore.js:1317)    at Game_Interpreter.pluginCommand (/X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/plugins/YEP_VictoryAftermath.js:378)    at Game_Interpreter.pluginCommand (/X:/SkyDrive/_RMMV%20Projects/Projects/Prequel%20Project/js/plugins/YEP_ItemCore.js:1085)
     
    #13
    estriole likes this.
  14. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    sorry... you're correct... you also need to update EST - SAVE MAP EVENT to v1.5

    i forgot to mention it.... i will add that in previous update post.
     
    #14
  15. GFresh

    GFresh Villager Member

    Messages:
    5
    Likes Received:
    1
    First Language:
    English
    First, I want to say I am loving the scripts. I have a couple questions since I did not see any infor from the little looking around I did; is it possible to change the id of the cloned event when cloning? also, would it be possible to allow for placing cloned events at the mouse x and y, or possibly by using charater index to determine facing for offsets?

    Thanks for the awesome work so far.
     
    #15
  16. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    for your first question...

    cloned event will have 'generated id' to avoid conflict with existing event.

    you might not want to manually set id since it could become disaster when you use same id with existing event.

    or any case you really need to manually set it?

    for placing cloned event at mouse x and y...

    you could use script call:

    var mapid = 8;var evid = 2;var mousex = $gameMap.canvasToMapX(TouchInput.x);var mousey = $gameMap.canvasToMapY(TouchInput.y);$gameMap.add_event(mapid,evid,mousex,mousey);but it will place the event immediately. be careful when using it.

    edit: for direction. just set the image in your event in mastermap to have direction you need. you could see how i 'rotate' table in my demo.
     
    Last edited by a moderator: Dec 4, 2015
    #16
  17. metalgearmaycry

    metalgearmaycry Veteran Veteran

    Messages:
    35
    Likes Received:
    1
    First Language:
    English
    Would it be possible for you to add the functionality of deleting an event by mapID and X,Y  instead of event ID on the current map? My basic process is: clone an event to the player's location from a map of stock events, and delete the old clone, wherever it may be (location mapID, X,Y stored in variables).
     
    #17
  18. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    some question... does the old clone is also created by this plugin?

    and does the map where the old clone is saved?

    since delete event across map WILL only work in map where you have saved before...

    do you really have to delete by x y?

    in next patch i migh add > delete all clone based on their source map and source id.

    so it can delete all event that cloned / transformed from source map and source id across ALL saved map.

    ex: (temporary script call name)

    $gameMap.delete_all_event_bysource(8,14);

    will delete all event that cloned / transformed from map 8 event id 14. across all saved map.

    if you really do need to delete it by xy i could also add it in next patch.
     
    Last edited by a moderator: Dec 6, 2015
    #18
  19. metalgearmaycry

    metalgearmaycry Veteran Veteran

    Messages:
    35
    Likes Received:
    1
    First Language:
    English
    The clone would be created by this script, and probably would be on a different map than the current map. Either method for erasing works; there should only be one clone active at any given time. I was just thinking in XY but deleting all by source, if it is easier, would be the route to go. Cleans up any that might have been missed, too. Thank you for your response :D .
     
    #19
  20. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    i decided to add both feature.

    updated plugin to v1.6:

     v1.6 2015.12.06    > add method to delete all event based on their source map and id.

                        it will delete all event that cloned from that map and id across all SAVED map

                        > add method to delete event based on their xy

                        (and can delete across map if you save that map)

    to delete ALL event based on their source map and event id in ALL SAVED MAP

     plugin command:

     DELETE_ALL_EVENT_BY_SOURCE srcMapId srcEventId

    or

     script call:

     $gameMap.delete_all_event_bysource(srcMapId,srcEventId);

    to delete Event in mapid x y position... (must be current map OR any SAVED MAP. it won't work for non saved map)

      plugin command:

      DELETE_EVENT_BY_XY mapId x y

    or

      script call:

      $gameMap.delete_event_byxy(mapId, ev_x, ev_y);

    also... MAKE SURE to UPDATE EST - SAVE MAP EVENT to v1.6 to be able to tag your cloned event with

    <temporary_event> and make it 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.
     
    Last edited by a moderator: Dec 6, 2015
    #20

Share This Page