Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,005
First Language
Tagalog
Primarily Uses
RMVXA
First and foremost, I'm not sure if this behavior is only for Ace.

Second, this is more of a "BEWARE" kind of thing

So let's get it on.

Here's the thing:

If you have parallel/autorun events on a map, then you use Erase Event to erase them, then used the save command and then quit the game, then opened it up on RM and then edit (or no-edit) then hit save button then start the game and load the old file, the parallel/autorun event will re-run.

Why? Because DataManager re-calls the Game_Map update method when the internal version of the game on the save file is different from the current internal version of your game.

So, this problem will probably only appear during development, and on releasing patches I think. For most games that won't get any updates, you won't experience it. And it's easy to counter too

The most effective method is of course, prevention. basically don't allow saving on maps that has autorun/parallel events that uses erase event.

Now if you need to, there are some workarounds. One would be "temporary self switches", which is basically using a second page + self switches, but you reset the self switch once you leave the map. That way, once you return to the map, it will still run but when you load from a different version, it won't. The method I used to achieve this is scripted (via aliasing the setup method of Game_Map), and I'm not sure if resetting self switches before a transfer event command will work flawlessly.

For the method I used:

Code:
class Game_Map  alias setup_reset_switch setup  def setup(map_id)    setup_reset_switch(map_id)    @id = 0 if @id.nil?    if not @id == map_id      @id = map_id      $game_self_switches[[some_map_id,eventid,self_switch]]=false      #do that for each self switch that needs to be reset      #so like      $game_self_switches[[1,1,"A"]]=false      # this will reset the self switch A of map 1's event 1    end  endend
 

The Prince of Sarcasm

Prince of sarcasm
Veteran
Joined
Apr 3, 2014
Messages
1,144
Reaction score
131
First Language
Sarcasm
Primarily Uses
You could also make so that when the event is done it turns on a switch, and make a new event page that is blank when that switch is turned on.
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
614
First Language
English
Primarily Uses
From what I understand, "Erase Event" only erases the event for the duration of your time on the map, which ends if you leave the map or exit the game. Everything resets once you re-enter the map including all events that have been erased, so the only surefire way to make sure the event stays erased is by using a second page with a valid conditional. I believe it was made this way intentionally, as having a way to permanently erase an event during a single playthrough would be even more inconvenient.

Edit:

As an example of the convenience of this command, I use it on every map that requires a parallel process or autorun to manage the map. (which is basically every map).

Depending on the progress of the main storyline, each map will be a little bit different in YANTH.

Let's say in one town, there's normally 10 NPCs around. The weather is normal. The autorun for this map goes like this:

  • If specific NPC needs to be somewhere, place them there.
  • Set weather and BGM.
  • Tint screen to normal. (I don't use fade in or fade out during transfers, instead I tint the screen to complete black. This gives me 100% control over everything during a fade out and fade in).
  • Erase Event.

if I need to leave and re-enter the map, everything adjusts properly.

Now say I'm further into the game. A new page in the same autorun event will trigger instead.

  • Erase Event 3 and 5 since they did not survive. (make them through and transparent)
  • If specific NPC needs to be somewhere, place them there.
  • Set bridge to broken.
  • Set weather and BGM.
  • Tint screen to normal.
  • Erase Event.

etc etc.
 
Last edited by a moderator:

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,284
Reaction score
1,458
First Language
English
Primarily Uses
RMXP
Thank you for telling us about this behavior.

I encounter a variation of this problem creating my Map copy script.

Here's my solution which can serve as additional inspiration: ($game_map.data_modifications is set during the map-copy operation)

### Change reload mechanism#module DataManager  class << self    unless self.method_defined?:)zeriab_copy_reload_map_if_updated)      alias_method:)zeriab_copy_reload_map_if_updated, :reload_map_if_updated)    end     ##    # Reload must not occur when we have made any runtime data changes.    # Otherwise we may throw our changes away    #    def reload_map_if_updated      if !$game_map.data_modifications        # No copy changes so we are save to use the normal reload code        zeriab_copy_reload_map_if_updated      end    end  endend
Generally I find having a parallel event to set the environmental conditions before using Erase Event nice. Having them run again is typically not a problem. (Yes, the type Seita is talking about)

*hugs*
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,005
First Language
Tagalog
Primarily Uses
RMVXA
@super - yeah the way to erase completely is to simply have a second page. But erasing isn't really the topic here.


This problem specifically pertains to the situation where you have an event that needs to re-run upon entering the map, hence using autorun + erase only...


Normally when you save, the event status of that map is saved (because the current (or technically last) map itself it saved), so that even if you quit then load, the autorun events won't refire because the game thinks that you still didn't left the map (same reason why they don't autofire after opening and closing the menu)


BUT


If you hit save, close the game, and then edit the game file, the game then calls the setup method of that map which resets the erased status. and that causes the problem...


so technically, this will only be a problem for games under development or still under patching... because already finalized games won't be edited anyway so it won't prompt the game to recall the setup method upon loading of a saved file...


:)
 
Last edited by a moderator:

Latest Threads

Latest Posts

Latest Profile Posts

Raptor Revolt Demo 4_10_2021 3_12_09 PM.png

Latest custom tileset work for RAPTOR REVOLT in this beach scene set in the acheroraptor capital in Ridge City, Hell Creek.
unknown.png


I figured it was about time to update the battle sprite for one of my characters. The old one was the first time I ever drew a battle sprite, and filled with lines that shouldn't be there. So far, the new one is cleaner.
EQAQeW8.png

This was supposed to become her neutral talking stance, but now i just feel like she looks a little puzzled :D
I'm also open for any name suggestions, as i seriously suck at those. In my notes everything is just THE CITY or THAT GUY and THIS PRIESTESS or whatever :D
Nearing completion of the first major city of Albert, a vacation getaway city built a long time ago by a king who really didn't want to be invaded.
It’s definitely a great day to fit in some time for me to play no mans sky on PS4

Forum statistics

Threads
110,278
Messages
1,051,928
Members
143,298
Latest member
Someonewird
Top