Teleport directly to another map after a fight

Hi, I'm posting a thread because I have a problem with Ace. I have programmed a victory screen in event, which I have placed on another map, I would like to know if there is a way that each fight can lead directly to this map without going back to the map on which the fight started first.



I should point out that I tried to briefly teleport the hero without transition on this map before, and it was unsuccessful. Because I keep what happens at the end of a fight in a common event and for some reason I don't know, when I call a common event by script, it plays again in a loop.

My common event :
vQDmD.png


Thank you in advance ^^
I should point out that I tried to briefly teleport the hero without transition on this map before, and it was unsuccessful.
How so? If you activate a switch at the beginning of each battle and then use an autorun common event to transfer the player when going back to the map it should work. Of course, you have to tint your screen or freeze your graphics so that the change of scene is not visible, but besides that it should be easy to do it.

P.S. why did you define a method locally if you are only going to call it once? Not only does it not help you saving lines, it also increases the amount of lines required to perform the same action.
It didn't work because, as I said, the common event is looped and it contains a SceneManager.return. This closes the game if the content of the common event lasts more than one frame.
How so? If you activate a switch at the beginning of each battle and then use an autorun common event to transfer the player when going back to the map it should work.
You might have missed this. Specifically this part:
Heirukichi said:
when going back to the map
There is no need to loop the event inside the battle scene. You can tint your screen or freeze your graphics and use the map scene. It works in the same way. On top of it, from what I can see, you are basically showing those that I think are actor stats. You can just save them before the battle starts and then display the difference when the battle ends.

If you are using a script, and thus you are not talking about a map with events, but you are talking about a script, then the story is completely different. Even so, there is no way we can help you without knowing which script you are using.
The whole victory screen is in event on another map. I tried a Graphics.freeze before changing the map to go back directly to the victory map after the fight, apparently, Graphics.freeze stops working when you change the map.
Code:
module HRK_MTF
  def self.set_fade(fade)
    @fade_possible = fade
  end
  def self.fade_disabled?
    @fade_possible
  end
end
module Graphics
  class << Graphics
    alias hrk_mtf_fadein_old fadein
    def fadein
      return if HRK_MTF.fade_disabled?
      hrk_mtf_fadein_old
    end
    alias hrk_mtf_fadeout_old fadeout
    def fadeout
      return if HRK_MTF.fade_disabled?
      hrk_mtf_fadeout_old
    end
    alias hrk_mtf_transition_old transition
    def transition(*args)
      HRK_MTF.set_fade(false)
      hrk_mtf_transition_old(*args)
    end
  end
end
If you want to use Graphics.freeze, add this to your script and then call
Code:
HRK_MTF.set_fade(true)
before your Graphics.freeze line. It should fix the behavior of your transition. I wrote this from mobile so I cannot guarantee it is free of typos.
I get an error message.
kj3JJ.png
Fixed, there was a typo; I wrote htk instead of hrk.

Original thread: https://forums.rpgmakerweb.com/threads/teleport-directly-to-another-map-after-a-fight.110588/