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

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,033
Reaction score
339
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 ╒══════════════════════════╛
(update the dead dropbox link)
warning: this plugin created using earlier MV version. this might not work in updated MV.
you can ask other scripter to create compatibility patch since i already retired.
i only update the link for people who want to make the patch.

(All Build And Decor share the same demo)
Demo
(update the dead dropbox link)
warning: this plugin created using earlier MV version. this might not work in updated MV.
you can ask other scripter to create compatibility patch since i already retired.
i only update the link for people who want to make the patch.

■ 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:

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.

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:

Makeratore

Veteran
Veteran
Joined
Feb 9, 2014
Messages
188
Reaction score
51
First Language
Italian
Primarily Uses
RMMV
this plugin is the first step to slowly convert my EST - BUILD AND DECOR series from ACE to MV.

                                    (YEAH IT WILL BE REALLY SLOW T.T)
OMG

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

Anyway, this first plugin sounds interesting. :D
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,342
Reaction score
3,053
First Language
Portuguese
Primarily Uses
RMMV
(took me about 3 hours just to create this... i don't like that now we don't have script/plugin editor...

i missed how it used to be easy to learn everything by ctrl + shift + F in script editor T.T)
You have much more than Ctrl + Shift + F now, just use either Atom or Sublime Text and add the default scripts on it :)
 

Prescott

argggghhh
Veteran
Joined
Aug 28, 2014
Messages
478
Reaction score
369
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 :\
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,033
Reaction score
339
First Language
indonesian
Isn't Yanfly working on a script that does the exact same thing?
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 :\
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...

You have much more than Ctrl + Shift + F now, just use either Atom or Sublime Text and add the default scripts on it :)
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:

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,342
Reaction score
3,053
First Language
Portuguese
Primarily Uses
RMMV
Hudell Orange Custom Event (basically event cloner)
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.
btw i might create plugin that similar to you... (clone event) hope you're not offended... :D . i'm not competing with anyone :D .
Sure, no problem! I also created some plugins that already existed (although I didn't know about them when I did).

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
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 .
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,033
Reaction score
339
First Language
indonesian
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 .
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 .
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,342
Reaction score
3,053
First Language
Portuguese
Primarily Uses
RMMV
for run the game on chrome... how can we do that? i usually use the playtest on editor :D .
Someone made a good explanation on a thread today, but there were so many new threads that it's hard to find :X
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,033
Reaction score
339
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...
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,033
Reaction score
339
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:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,033
Reaction score
339
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:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,033
Reaction score
339
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
 

Makeratore

Veteran
Veteran
Joined
Feb 9, 2014
Messages
188
Reaction score
51
First Language
Italian
Primarily Uses
RMMV
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
I'm excited! :D
 
Last edited by a moderator:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,033
Reaction score
339
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.
 

Roguedeus

It's never too late to procrastinate...
Veteran
Joined
Mar 19, 2013
Messages
532
Reaction score
107
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:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,033
Reaction score
339
First Language
indonesian
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?
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:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,033
Reaction score
339
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:

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,656
Reaction score
8,084
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!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Managed to find a way to hang a bed cover over my window. So no more being toasted alive in the afternoon!:kaoswt2:
So, uh, has anyone tried buying any resources from KokoroReflections? Because I've been looking for a 'buy' button on the site for like 10 minutes now and can't find one.
Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...
Everyone in the US right now: Please stay safe.
Symphony Celestia: Prophecy of the Falling Stars RPG Maker music pack WIP. Symphony Celestia is a new series that focuses on symphonic and orchestrated music to tell a story. Each story will include compositions that make up that story from beginning to end. Themes include: Battles, adventures, character themes, etc. Below is a video preview to the first story.

Forum statistics

Threads
97,980
Messages
948,319
Members
129,242
Latest member
Kelevra069
Top