Inserting a cutscene during battle

Quite obviously something you need a plugin for but the question is more in the context of: -has this been done before? - Because I don't know where to start experimenting.

I want to create a cutscene to play mid-battle. Something like in the last boss fight of FFIV, where all the protagonists are felled >>> deus ex machina scene plays out >>> fight resumes. The specific case I am thinking about is a near-death experience of one of the protagonists. See sees herself in another possible life, and after some time she's sucked back into battle.

I suspect one (easier) way to do this is to prerecord the cutscene and then just play it as a movie during battle. However, I'd actually like to have interactivity during the cutscene. She can walk around, talk to people, etceteras, access the menu etc... before being pulled back into battle exactly the way she left it. Any thoughts on how this can be achieved?
Fade out screen, end battle, play cutscene, fade out screen, start second half of battle which is a separate troop perhaps with a troop event and variables that configure any enemy HP left over from the last fight or whatever, I don't know the details of your game.
or you can use show pictures in a troop event to create the cutscene during battle
Fade out screen, end battle, play cutscene, fade out screen, start second half of battle which is a separate troop perhaps with a troop event and variables that configure any enemy HP left over from the last fight or whatever, I don't know the details of your game.
Thanks. I was afraid this was the only way... the challenges are in recreating the situation before the cutscene and make it feel like it's seamless. I had hoped there was a way to "pause" the battle and overlay a map event, but nobody has attempted such a Frankensteinean plugin as far as I can tell.

So I think I'll have to:
1. give the protagonist immortality for the battle
2. have as the trigger of the cutscene that her HP turns zero
3. have boss do her fatality moves (aka do fancy stuff with VS BattleCore action sequences)
4. black out, exit battle
5. switch party to lone protagonist (probably different actor)
6. have the flashback cutscene play out until trigger is met for return to battle
7. black out and switch party back
8. have the battle start without encounter effect
9. recreate the fatality move situation
10. fade in
11. drama!

or you can use show pictures in a troop event to create the cutscene during battle
Thanks. Yes, that would be more straightforward, but I kind of want to have some interactivity during the scene... but perhaps I'm wanting too much lol.
In the troop event have it show a picture of the map where the cutscene occurs and a picture of the character and then start running a loop where if direction key is pressed move the pictures and scroll through character sprite pictures to simulate walking. Then create coordinate bounds for walls and collision objects where it sets back your character picture coordinates if you try to run into them. Also in the loop you have if you press action button within a range of coordinates close to NPC pictures it launches show text. Simple and easy, LOL.
Simple and easy, LOL.
Yeah, let’s invoke another instance of scene_map while we’re at it
To be fair, it shouldn't be that difficult to store the state of the battle and restore the appropriate values when starting the second battle.

What do you need to know?
- What battle turn (if the cutscene isn't happening at a predetermined time)
- The HP/status/buffs of each enemy
- Any statuses/buffs on the actors
- Actor TP levels
- ...?

Most of that you should just be able to copy into a temporary array.

I think the potentially more challenging part/part that would require some actual research is how to make the transition out of the first battle in a way that doesn't display any normal end of battle stuff.
I think the potentially more challenging part/part that would require some actual research is how to make the transition out of the first battle in a way that doesn't display any normal end of battle stuff.

Wait, doesn't the 'abort battle' event command just throw you out of battle without the end of battle stuff?
Wait, doesn't the 'abort battle' event command just throw you out of battle without the end of battle stuff?
Yeah, I think you're right - one would just want to double check that it doesn't do anything you don't want. For example, if the battle counter is used in the game you might want to decrement it again, that sort of thing.
To be fair, it shouldn't be that difficult to store the state of the battle and restore the appropriate values when starting the second battle.
You're right, it isn't really difficult... just prone to a lot of oversight if you want to reconstruct everything. Since I only plan to do this for this specific battle (single boss monster), it isn't too bad. I mean the boss can stay at full HP/MP. The actors HP/MP will carry over anyway, so that's also not hard.

Wait, doesn't the 'abort battle' event command just throw you out of battle without the end of battle stuff?
It does. There's a slight "hiccup" with the way it first fades out (hiding the battle UI), and upon aborting it flashes the battle UI for a moment. But I guess I'll have to live with that.

Yeah, I think you're right - one would just want to double check that it doesn't do anything you don't want.
Indeed, so that's why I'll just try to dumb it down for this particular battle. Don't know if you've seen Demon Slayer (Kimetsu no Yaiba) but if one wanted mid-battle flashbacks to be that frequent, it would be a lot of work.

NOTE: the Dynamic Encounter Effect plugin apparently supports turning OFF the encounter effect... this will be useful when reentering battle.
I've been busy with work, so trial and error on this is going at a slug's pace... I think I have the basics down using placeholder events and texts, but am bumping into another error.

So the battle will go like this (troop event):
First, one of the protagonist (actor 2) is given immortal state (sorry, I started the project in Japanese and that means all the states will show in Japanese forevermore)
The battle resolves normally and at one point actor 2 is at 0 HP
"It's gameovah man gameovah!"
-fade to black-
-party member are swapped out and only actor X (a copy of actor 2) remains
-battle aborts-
-player is transported to another map (a dream if you will)
-certain interaction with an event will trigger the battle again
-party members are swapped back in
... so far so good! The problem comes with the second half of the battle:

Again a troop event, triggering at turn 0 (in other words before command entry)
JavaScript:
◆Fadein Screen
◆Text:\n[4], testactor4(0), Window, Bottom
:    :あなたは…
:    :存在そのものを消し去る必要があるのよ
◆Text:\n[2], testactor2(5), Window, Bottom
:    :そ…そんな…\|
:    :そんなの…
◆Shake Screen:5, 5, 120 frames
◆Text:None, None, Transparent, Middle
:    :\{\{\{\>いやぁぁぁぁぁあ!!\|\|\|\^
◆Play SE:Barrier (90, 100, 0)
◆Tint Screen:(255,255,255,0), 60 frames (Wait)
◆Change Party Member:Add アンヌ
◆Script:$gameParty.swapOrder($gameParty.members().indexOf($gameActors.actor(1)),$gameParty.members().indexOf($gameActors.actor(10)))
◆Change Party Member:Remove ショージ
◆Wait:60 frames
◆Tint Screen:(0,0,0,0), 60 frames (Wait)

The battle crashes when the fifth party member (say, the savior) is added with the message: Cannot read property 'isAppeared' of null
Apparently party member changes at turn 0 are not allowed. I do however want the savior swap to happen BEFORE command entry.

Any thoughts/ideas?

List of plugins just in case.
1693486004774.png


EDIT: I suppose I could set everyone to auto-battle and thereby skip the command selection phase and have the character swap occur as the first thing in the turn... the next problem is to end the turn immediately after that.
Instead of first adding another member, try first removing the dude, then adding the "savior" and then using that script to switch places (check how it arranges when you remove and add actors, and switch the correct IDs to swap places).
Interesting! That indeed seemed to work! Thanks a lot! The script to switch places will indeed require some acrobatics...

EDIT: I have this plugin to change max battle members, and setting it to 5, adding auntie on the white horse, swapping her with dude, removing dude from party, and setting it back to 4 seems to work also.

Wonderful! Now I can finally start doing the fancy stuff with action sequences!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/inserting-a-cutscene-during-battle.160477/