Ok, I can't test this on MV right now, so I'll put the code here instead of GitHub:
I added the plugin command "delete this event" that will call the erase command and stop the event from re-appearing on map changes.
Edit: Removed old code.
Orange Custom Events
● ARCHIVED · READ-ONLY
-
-
It didn't work in my tests. Would either result in a crash or event would re-spawn upon re-entering map.
I appreciate it, though, and will try to work it out with Estriole's script. So far it's worked quite well alongside yours. Causes some issues like lag with Pathfinder and door interaction, but I only need this much eventing for this one map. Thanks again! -
Well, I'll fix this first thing when I get home tonight.
-
for the door cannot work... it's indeed my plugin conflicting with the AUTO DOOR event... try this in a project without any plugin. create a door event. and for teleport target place it at the same map. then you'll see in the same map the door CANNOT be used again... will fix this as soon as possible.It didn't work in my tests. Would either result in a crash or event would re-spawn upon re-entering map.
I appreciate it, though, and will try to work it out with Estriole's script. So far it's worked quite well alongside yours. Causes some issues like lag with Pathfinder and door interaction, but I only need this much eventing for this one map. Thanks again!
but the Pathfinder is not... i tested and it appear that the Pathfinder plugin in conflicting with your plugin Hudell... i disable all other plugin... then when
adding even just one custom event on the map. then do one plugin command to pathfinding. it will reduce the fps to 30-40. -
Here are my findings thus far:
So far your script works perfectly to copy an event onto a different map multiple times. The lag this causes might be because of how Rpg Maker handles this. Or so I'm told anyways. Either way, I can fill a 27x18 map with events before the lag starts to get really bad.
And Estriole is correct, I did some more testing after my last post, and your script will indeed cause lag with PathFinder. Copying events and then using Pathfinder in that same map stutters the game.
PS: Thanks, Estriole, Hudell, you two are quite friendly. I'm new to this community so I was nervous xD -
Hmm, I just tested the script I had released on the other post and it is working properly.Here are my findings thus far:
So far your script works perfectly to copy an event onto a different map multiple times. The lag this causes might be because of how Rpg Maker handles this. Or so I'm told anyways. Either way, I can fill a 27x18 map with events before the lag starts to get really bad.
And Estriole is correct, I did some more testing after my last post, and your script will indeed cause lag with PathFinder. Copying events and then using Pathfinder in that same map stutters the game.
PS: Thanks, Estriole, Hudell, you two are quite friendly. I'm new to this community so I was nervous xD -
Just tested it again and made multiple copies and multiple projects with only your script just in case. I might be doing something wrong? I'm only using MvCommons and Orange Custom Events. I then made a new event, and set it to activate with the Action Button. I then added Plugin Command: "delete this event" in it's content. Upon testing, it was successfully removed from the map. However, taking a door to a different map and then coming back to this map, would cause it to re-spawn.Hmm, I just tested the script I had released on the other post and it is working properly.
-
Ok, did some proper testing and found an issue this time. I've updated the script on GitHub with the new "delete this event" command because I believe everything is working properly now.Just tested it again and made multiple copies and multiple projects with only your script just in case. I might be doing something wrong? I'm only using MvCommons and Orange Custom Events. I then made a new event, and set it to activate with the Action Button. I then added Plugin Command: "delete this event" in it's content. Upon testing, it was successfully removed from the map. However, taking a door to a different map and then coming back to this map, would cause it to re-spawn.
-
Thanks, unfortunately I don't have time to do it right now but I'll test this out as soon as possible!
-
All right, so I tested the Script multiple times, and trying multiple things. And it worked perfectly across all tests.
*Deleted Events will be removed, and reloading the map won't re-spawn them.
*Doors will also function correctly, even after reloading the map.
*Events set to Pathfind will also properly be reset upon reloading the map now. However, your script still causes lag with PathFinder. Other than that, it's exactly everything I needed! Thank you very much! -
If you copy the event on RM and paste on the same places, do you get the same lag?All right, so I tested the Script multiple times, and trying multiple things. And it worked perfectly across all tests.
*Deleted Events will be removed, and reloading the map won't re-spawn them.
*Doors will also function correctly, even after reloading the map.
*Events set to Pathfind will also properly be reset upon reloading the map now. However, your script still causes lag with PathFinder. Other than that, it's exactly everything I needed! Thank you very much! -
I have no idea what RM stands for >~<If you copy the event on RM and paste on the same places, do you get the same lag?
Do you mean deleting an event and then copying on the same tile? Because that so far hasn't caused any lag. The Plugin Command: "SmartPath event=0 event=-1" is what causes lag in a map where your script has been used. -
RM is Rpg Maker.I have no idea what RM stands for >~<
Do you mean deleting an event and then copying on the same tile? Because that so far hasn't caused any lag. The Plugin Command: "SmartPath event=0 event=-1" is what causes lag in a map where your script has been used.
I'll check that SmartPath plugin to see if there's anything I can do. -
the fps drop happen only when this two condition met:
1) adding new event using your plugin even just one event. and NOT leaving the map
2) executing Pathfinder.
it will loss fps until we move to new map.
when we leave the map... reenter... it won't be fps loss...
but when we execute Pathfinder again... it will be fps loss again...
hope this test can help you point the problem...
edit: found the possible culprit... it's because when you create new event you add event_id with 1000
Game_Map.prototype.getIndexForNewEvent = function() { var index = this._events.length; if (index < 1000) { index += 1000; } return index; };maybe there's some code that iterate 1 to event id and 1 to 1000++ is lots of iteration...
from what i see in pathfinder plugin... there's no such iteration... but maybe there's a function called by the plugin which have that iteration (would be harder to trace)
i tested by changing + 1000 with + 50 and the lag is gone.
in my plugin i detect the next event id instead.
event id currently exist on map: 1, 2, 3, 4, 5, 6, 9, 10,11
next id generated will be 7. then 8. then 12.
thus no fps loss -
What's the size of the map you're testing it on and how many events does it have?
-
small map (17x13) with only 5-8 events... and add only one new event using your plugin. so total final event max 9 event.
-
Hmm, thanks for this info. Increasing it by 1000 is necessary, though.maybe there's some code that iterate 1 to event id and 1 to 1000++ is lots of iteration...
from what i see in pathfinder plugin... there's no such iteration... but maybe there's a function called by the plugin which have that iteration (would be harder to trace)
i tested by changing + 1000 with + 50 and the lag is gone.
in my plugin i detect the next event id instead.
event id currently exist on map: 1, 2, 3, 4, 5, 6, 9, 10,11
next id generated will be 7. then 8. then 12.
thus no fps loss
If the player adds a new event on the map on Rpg Maker and loads a save file with an event with the same ID, their new event won't show up.
Fixing the pathfinding to not lag with 1000 events is easier.
Also: I found another issue on the smartpath plugin that may cause a lot of lag. I'll tell Shaz about it. -
in my plugin i search for the next event id.Hmm, thanks for this info. Increasing it by 1000 is necessary, though.
If the player adds a new event on the map on Rpg Maker and loads a save file with an event with the same ID, their new event won't show up.
Fixing the pathfinding to not lag with 1000 events is easier.
Also: I found another issue on the smartpath plugin that may cause a lot of lag. I'll tell Shaz about it.
first list all existing event id in the current map. then return the next id that can be used.
the logic works since ACE :D .
so there no way for duplicate id.
edit: sorry... i misunderstand your post... you mean... adding event in editor until reaching new event id. then loading existing savefile :D .
yes... that might caused problem... in my plugin it still won't happen though... since i save the map event. -
Imagine a situation like this: You have a map with 20 events. Then you playtest and use the script to add event 21 and save your game.in my plugin i search for the next event id.
first list all existing event id in the current map. then return the next id that can be used.
the logic works since ACE :D .
so there no way for duplicate id.
edit: sorry... i misunderstand your post... you mean... adding event in editor. then loading existing savefile :D .
yes... that might caused problem... in my plugin it won't happen though... since i save the map event.
Then you edit the game on rpg maker and add a new event. Rpg Maker will give it the id 21. If you playtest again and load that save file, the event 21 from rpg maker won't be there, only the one you added through script.
At least that's what used to happen on Ace with Hime's EventWrapper. I never really tested without the +1000 on MV. -
ICIC... yes you're right... my plugin save the map event in $gameSystem. and use that event instead reloading the map. so when there's changes happen in editor.. it won't be loaded at all. and use saved event instead :D . so if you add new event in editor... you either need to start new game. or erase 'saved event' for that map so it will reload from map data (it reminds me... to create plugins command for that :D ). it would be bad if we want to release Patch / DLC for the game and requiring to restart from new game... :D ... i might need to find improved approach for this :D . maybe some variables again for marking which event is New Generated for that map and option to keep them when deleting 'saved event' while also reindexing the duplicate id....Imagine a situation like this: You have a map with 20 events. Then you playtest and use the script to add event 21 and save your game.
Then you edit the game on rpg maker and add a new event. Rpg Maker will give it the id 21. If you playtest again and load that save file, the event 21 from rpg maker won't be there, only the one you added through script.
At least that's what used to happen on Ace with Hime's EventWrapper. I never really tested without the +1000 on MV.