Daniel B

Hidden Kitten
Veteran
Joined
Dec 8, 2012
Messages
64
Reaction score
14
First Language
Swedish
Primarily Uses
Hello, first off, I just wanna say that I've had no luck finding or making a solution to my problem, but if there's something I've missed or a simple answer, then please call me out on how dumb I am.

To explain the title better; I want a certain Common Event to run after all enemies are dead, but before the EXP window appears.
The reason for this, is that I've (somehow) managed to put together a Summon, that first attacks when summoned, stays for the rest of the turn, and then leaves.

My problem?
Well, I've chosen to go with tinting the screen and hiding the battle hud (to make the summon feel more visual, etc.), but if the Summon kills the last target (or all at the same time), then I have no way of returning the battle hud and tint before the EXP window appears, which it doesn't because I've hidden it.

Visual aid:
SummonNoWindow.png

I'm using a lot of scripts, but I think the most important ones in this instant is:
Yanfly's Battle Core + Action Sequence 1-3 http://yanfly.moe/yep/
SRD's Summon Core + Replace Summons http://sumrndm.site/mv-plugins/

I've tried different plugins, eventing it, and even gave script calling a shot, but no dice. I am way of my league here, and could really use some help.

This is gonna sound rude of me, but all I really want is a way to check if all enemies are dead, and if they are, I want to run a Common Event before the Victory Screen/EXP Window is suppose to appear. I've been pulling my hair out for the past 6h...

I really hope this is enough information, thanks in advance.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,503
Reaction score
8,144
First Language
German
Primarily Uses
RMMV
There are some existing plugins that add other triggers to troop events, including end-battle-triggers for running troop events after all enemies are dead. That should allow you to do whatever you want.
 

Daniel B

Hidden Kitten
Veteran
Joined
Dec 8, 2012
Messages
64
Reaction score
14
First Language
Swedish
Primarily Uses
There are some existing plugins that add other triggers to troop events, including end-battle-triggers for running troop events after all enemies are dead. That should allow you to do whatever you want.

Could you give me an example? I can't seem to find anything, at least not for MV.

While I was eating, I thought about a work around. I could always just make the enemies Immortal when the summon is up, but that is really a lazy way of fixing it, and it would be kinda boring if your strongest magic attack can never kill a target.
 

Ahuramazda

Veteran
Veteran
Joined
Nov 9, 2012
Messages
262
Reaction score
128
First Language
English
Primarily Uses
RMMZ
If you're using Yanflys Victory Aftermath, find this section and add in the edited line:

Code:
BattleManager.processVictory = function() {
    $gameScreen.startTint([0, 0, 0, 0], 15) // Edit: Puts screen tint back to normal in 15 frames
    $gameParty.performVictory();
    if (this.isVictoryPhase()) return;
    if (this._windowLayer) this._windowLayer.x = 0;
    $gameParty.removeBattleStates();
    this._victoryPhase = true;
    if ($gameSystem.skipVictoryAftermath()) {
      this.processSkipVictory();
    } else {
      this.processNormalVictory();
    }
};

You can change the 15 frames thing all the way down to 1 if you want, but it may be a bit jarring depending on the darkness back to normal shift, lol
 

Daniel B

Hidden Kitten
Veteran
Joined
Dec 8, 2012
Messages
64
Reaction score
14
First Language
Swedish
Primarily Uses
If you're using Yanflys Victory Aftermath, find this section and add in the edited line:

Code:
BattleManager.processVictory = function() {
    $gameScreen.startTint([0, 0, 0, 0], 15) // Edit: Puts screen tint back to normal in 15 frames
    $gameParty.performVictory();
    if (this.isVictoryPhase()) return;
    if (this._windowLayer) this._windowLayer.x = 0;
    $gameParty.removeBattleStates();
    this._victoryPhase = true;
    if ($gameSystem.skipVictoryAftermath()) {
      this.processSkipVictory();
    } else {
      this.processNormalVictory();
    }
};

You can change the 15 frames thing all the way down to 1 if you want, but it may be a bit jarring depending on the darkness back to normal shift, lol

Well, there's 2 problems with this. 1) The Hud doesn't get enabled again, and 2) The tint won't be right. (This is my bad, didn't think it was important, but I use different tints so I'm using a plugin that "saves" tints so I can reload them, like the built in Save BGM)

I don't know much about coding, but that "BattleStates", would it be possible to have so the game removes States (like poison) earlier?
Because that's how it normally turn the hud and tint back, by having a special State go out, it turns on the common event.

Would that be possible?

Edit: I thought of another way I could do it, X% of current HP. That way, summons can't kill the targets, though their attack gets weaker the lower hp the enemy have.
 
Last edited:

Capitán

kind of a big deal
Veteran
Joined
Jul 9, 2013
Messages
576
Reaction score
147
First Language
Engilsh
Primarily Uses
RMMV
Wrote a simple plugin for you in about 5 minutes,

Just put the id of the common event you want to run in the parameters and you should be good.
 

Attachments

  • CommonEventOnDeath.js
    912 bytes · Views: 23

Daniel B

Hidden Kitten
Veteran
Joined
Dec 8, 2012
Messages
64
Reaction score
14
First Language
Swedish
Primarily Uses
Wrote a simple plugin for you in about 5 minutes,

Just put the id of the common event you want to run in the parameters and you should be good.

Hey, this seems to work perfectly! I only have to do some light eventing, but that's fine.
Thanks a lot, Yuuta!
 

Ahuramazda

Veteran
Veteran
Joined
Nov 9, 2012
Messages
262
Reaction score
128
First Language
English
Primarily Uses
RMMZ
Yeah, my idea was only gonna work if you wanted to just re-tint back to normal and not using anything custom :p glad someone was able to assist though :)
 

Latest Threads

Latest Profile Posts

Rest in Peace vlog gun...
vloggunsmallface.png
Another unnamed character, and probably last one for now.
She's a dragon girl inspired by fafnir dragon. as always, name suggestion is welcomed.
Dragon_Girl.jpg

Dragon_Girl_1.png
Hmm.... So I can use my quick ports of QPlugins, but QMovement breaks MZ's save system. Or I can use the Luna port of the QPlugins whose QMap breaks MZ's save system. I can't decide I want to fix one of those, or just make a new save system. The new one would look so much better.. I'm kind of tempted. :LZSexcite:
I'm very happy and I want everyone to be happy too, so I decided to share this song about the end of the world! :biggrin:
I just booked a spot for my COVID vaccine today. I am just waiting to see when they can get me in. I'll be so happy when I don't have to be paranoid about the virus anymore. I'm also thinking about moving to Atlanta, Georgia, Denver, Colorado, or Houston, Texas in the far future. Maybe once my channel gets off the ground.

Forum statistics

Threads
111,162
Messages
1,058,833
Members
144,401
Latest member
Sabiaryl
Top