Is there any way to recreate the Battle Entry animation from Deltarune in RPG Maker MZ?

Is there any way to recreate the Battle Entry animation from Deltarune in RPG Maker MZ? I just think it looks nice.
Doesn’t necessarily need to have characters move to the left side of the screen, they can still go to the right, I just want to know if this is possible to do with any existing plugins.

DeltaruneBattleTransition-2

Well, it’s definitely possible, but that would be a bit tricky to do. For starters, RPGMaker uses entirely different sprites on the map and on the battle scene. Even if you’ve arranged it so those sprites look identical, they are still different sprites.

Maybe something like this would be a good start (untested)…

(function(old){
	const MOVEMENT_DURATION = 30; // Edit this: Duration of movement in frames
	Game_Party.prototype.onBattleStart = function(isSurprised) {
		old.call(this, isSurprised);
		let sprites = SceneManager._scene._spriteset._actorSprites;
		for(let who of sprites) {
			if(!who._actor) continue;
			let character = null;
			if(who._actor == $gameParty.leader()) {
				character = $gamePlayer;
			} else {
				character = $gamePlayer.followers()._data.find(follow => follow.actor() == who._actor);
			}
			let x = character.screenX(), y = character.screenY();
			who._movementDuration = MOVEMENT_DURATION;
			who._offsetX = x - who.x;
			who._offsetY = y - who.y;
		}
	};
})(Game_Party.prototype.onBattleStart);

I think that logic should theoretically work, but I’m not confident that onBattleStart is the correct place to put it. It also doesn’t add any kind of special effects like your example does. Those should be doable using Window_BattleLog though, I think.

As for fading out the map instead of blurring it, that would be done in an entirely different place, and I’m not sure if it could be timed as in your example.

1 Like

Just tested this in a new project with no other active plugins, it does not work sadly.

The blurring of the map is something I also honestly hadn’t considered as being an issue. The lack of special effects is also fine, they would help sure but assuming the plugin would pull from the battle character sheet for the entry animations, I could probably just have them included in that pre-done. (Unless those aren’t the effects you mean?)

Hmm. I’m fairly confident the basic logic of my code is correct (I already did a quick test in the engine, running part of that code segment while the “Emerges” message is on the screen). So, if it doesn’t work in full, I can think of two possible reasons:

  1. onBattleStart is the wrong timing to adjust the battlers’ starting positions. You could try doing it in startEntryMotion instead:
    (function(old){
    	const MOVEMENT_DURATION = 30; // Edit this: Duration of movement in frames
    	Sprite_Actor.prototype.startEntryMotion = function() {
    		old.call(this);
    		if(!this._actor) return;
    		let character = null;
    		if(this._actor == $gameParty.leader()) {
    			character = $gamePlayer;
    		} else {
    			character = $gamePlayer.followers()._data.find(follow => follow.actor() == this._actor);
    		}
    		let x = character.screenX(), y = character.screenY();
    		this._movementDuration = MOVEMENT_DURATION;
    		this._offsetX = x - this.x;
    		this._offsetY = y - this.y;
    	};
    })(Sprite_Actor.prototype.startEntryMotion);
    
  2. The screenX and screenY calls don’t work because you’re no longer on the map screen. If that’s the issue, the values would need to be saved somewhere temporarily. On the bright side, the place to save them is likely the same place to adjust the blur effect.

I think #1 is more likely than #2 though. It’s also possible that both are true.

replaced the plugin, started a battle, and got hit with this

image

Whoops! I was supposed to replace all instances of who with this, but I missed some. I’ve edited the previous post to fix it. You can use Ctrl+F to double-check in case I still missed one.

image

different error this time

I made another correction to the code in the earlier post (there was a missing ._data in the middle).

Alright! it works now! thank you so much !!
Now I suppose all there is to do is remove the transition (or replace it with something that doesn’t overlay the character sprites)

1 Like

There’s more you could do to refine it, for example calling Window_BattleLog functions to play an animation or set the character’s motion as appropriate, and of course adjusting the blur transition. But I’d say this is definitely a good start, at least.

honestly I almost wonder if those could both be done with other plugins
surely there’s something out there that lets you remove the battle transition, and then probably any battle sequence plugin for the motion

1 Like

apologies to necropost (if these forums even have rules against that? couldn’t find any) but I finally managed to disable all the fade transitions and it appears everything has this odd offset?
my best guess is that there’s the existing offset so the battlers spawn offscreen and move into frame from the right, but that’s not been disabled
any tips?

I’m not sure. There’s a possibility that the coordinates on the map and in battle simply aren’t directly convertible – the battleback doesn’t fit on the screen, after all, so it might be taken the coordinates as relative to the entire battleback (whose top left corner is offscreen), rather than relative to the screen. I’m not certain that it is in fact doing this though.

If it looks like it’s a fixed offset, you could just add a constant number to _offsetX and _offsetY in the function.

1 Like

I see I see…
it does definitely look like a fixed offset as moving the battle event around changes it
what would I have to put in to add a fixed number? I’m like, super inexperienced with JS

Change this:

		this._offsetX = x - this.x;
		this._offsetY = y - this.y;

To this:


		this._offsetX = x - this.x + 42;
		this._offsetY = y - this.y + 97;

And just substitute in whatever numbers work.

1 Like

works perfectly!! personally I disabled the Y offset since it seemed to be perfectly fine.

either way, thank you sososo SO much !!! :smiley:
I really appreciate your help with this :3

I’ll put the whole js file (including the removal of fade transitions both into and out of a battle) here for anyone who might find this thread and would like it:

(function(old){
const MOVEMENT_DURATION = 30; // Edit this: Duration of movement in frames
Sprite_Actor.prototype.startEntryMotion = function() {
old.call(this);
if(!this._actor) return;
let character = null;
if(this._actor == $gameParty.leader()) {
character = $gamePlayer;
} else {
character = $gamePlayer.followers()._data.find(follow => follow.actor() == this._actor);
}
let x = character.screenX(), y = character.screenY();
this._movementDuration = MOVEMENT_DURATION;
this._offsetX = x - this.x + 288;
this._offsetY = y - this.y;
};
})(Sprite_Actor.prototype.startEntryMotion);

Scene_Map.prototype.encounterEffectSpeed = function() {
return 0;
};

Scene_Map.prototype.needsFadeIn = function() {
return (
SceneManager.isPreviousScene(Scene_Load)
);
};

Scene_Battle.prototype.stop = function() {
Scene_Message.prototype.stop.call(this);
if (this.needsSlowFadeOut()) {
this.startFadeOut(this.slowFadeSpeed(), false);
} else {
//    this.startFadeOut(this.fadeSpeed(), false);
}
this._statusWindow.close();
this._partyCommandWindow.close();
this._actorCommandWindow.close();
};

Scene_Battle.prototype.start = function() {
Scene_Message.prototype.start.call(this);
BattleManager.playBattleBgm();
BattleManager.startBattle();
this._statusWindow.refresh();
//    this.startFadeIn(this.fadeSpeed(), false);
};