Question regarding battle intro from map…

If I wanted to recreate the effect used when you get into a battle on a map, what would be the script needed to do that? The idea is that I want to disguise a player transfer to a different map as a random encounter.
Let's see...There would be an easy script call
SceneManager._scene.startEncounterEffect();
The catch is that it only plays if the next scene is a battle...
So what you have to do is call
SceneManager._scene.updateEncounterEffect() in a loop until
SceneManager._scene._encounterEffectDuration reaches 0.
Then transfer.

Right. So...replicate this:
[img]https://i.imgur.com/0wz2A6S.png[/img]

Sidenote: The Encounter Effect includes the BGM change and will start playing the battle music before the transfer. But if the new map has an autoplay BGM it'll get cut off abruptly; something to keep in mind.

This should work with both MV and MZ. I pretty sure they use an identical process.
If I wanted to recreate the effect used when you get into a battle on a map, what would be the script needed to do that? The idea is that I want to disguise a player transfer to a different map as a random encounter.

I really like this idea, very creative 🙂

Decided to make a plugin for you that will run custom code after playing the encounter effect 😉
(v0.61) CTB_EncounterEffectBeforeCode: Click Here to Download

Rough draft at the moment but working pretty nicely for basic things though 🙂

Something like this will do what you're looking for:
1674417416967.png


The following code transfers the player to map #1 at 8,5 facing down (2) with a no fade in effect:
JavaScript:
playEncounterEffect('$gamePlayer.reserveTransfer(1, 8, 5, 2, 2)')

Looks like this:
That plugin does exactly what I was hoping for (or at least it does once I stopped trying to overthink things). I wasn’t expecting someone to just up and write a plugin for the idea, but certainly do appreciate the effort. ^.^

I can’t claim the original idea for it, though; I got the idea from Final Fantasy V.
I wasn’t expecting someone to just up and write a plugin for the idea, but certainly do appreciate the effort. ^.^
@ct_bolt is freaking awesome. I've seen him whip up plugins for people like it's nothing. Gotta be one of the most generous people I've ever run into.
That plugin does exactly what I was hoping for (or at least it does once I stopped trying to overthink things).
Yay! Glad to hear ☺️

I can’t claim the original idea for it, though; I got the idea from Final Fantasy V.
Oh that's right, so it was. Very cool idea either way ☺️

@ct_bolt is freaking awesome. I've seen him whip up plugins for people like it's nothing. Gotta be one of the most generous people I've ever run into.
Awww goodness, thank you for such kind words! :LZSproud: I do what I can to help 😍 :blush: ☺️

I wasn’t expecting someone to just up and write a plugin for the idea, but certainly do appreciate the effort. ^.^
Quite welcome 🙂 👍
I will update to a more complete plugin soon & post on my itch.io page ☺️

Edit 1:
Made an update & fixed a few minor things to ensure better compatibility with other plugins.
To run a common event is like this:
JavaScript:
playEncounterEffect('playCommonEvent(1)')

Edit 2:
Another update, setting now made in case you want to keep battle bgm playing 😉
So for example when transfering to a map instead of the autoplay music can now be done like this:
Like this:
JavaScript:
playEncounterEffect('playCommonEvent(1)', true)

Link (v1.10):
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/question-regarding-battle-intro-from-map.154313/