MZ Skill common event ignored if said skill kills the last enemy

"It's a common event that counts how many times the skills has been used. But if said skill is used to kill the last enemy, the common event is ignored."

What don't you understand exactly?
I don't understand why you would want or expect a common event attached to a skill to activate outside of battle. As I said in my last post, that is not a logical progression that anyone else here would make.

That being said, I see your video - I understand your point of view that you would expect RPG Makers to continue to handle it in the same way.

I also understand (and agree with) Andar, where that, to me as a game developer, looks like unintended behavior. I would wager them changing it in MZ was considered a bug fix, and the fact that this bug has been in several prior versions really doesn't affect its standing as a bug.

If I wanted something to happen after battle was ended, I would use a switch within battle and autorun events outside of battle to check for it.

If I wanted an event attached to a skill to happen still inside battle after the last enemy was killed, that's a known fact for many years and I would install a plugin to make that work. (as I said, HimeWorks had one for MV, I'm sure there must be a version for MZ, or this one might work on its own or via FOSSIL).
You could candidly upgrade thinking it will be better and unwantedly break the gameplay of your game with changes like this.
That's possibly true - I don't use MZ, so I didn't read any of the patch notes. Are you saying this was changed and not put into the patch notes at all?
I don't understand why you would want or expect a common event attached to a skill to activate outside of battle.

It is explained in the opening post.

The rest is all personal preferences. I like much more when the common event is run on the map. It's more practical and more consistent. It's also the only time I've seen that a common event is ignored. Skill common events were never ignored entirely like that on XP, Ace, MV and MZ up to 1.3.0.
So yeah, I'm not going to welcome such a change after spending literally years using smoothly that feature in so many games.

Are you saying this was changed and not put into the patch notes at all?

I don't know. When I made my second MZ game, the upgrade was already there and I wasn't even aware that I was using a different version. It's only when I had to figure out what the hell was going on with my skill common events, that I looked into possibilities and came with the idea to check the version numbers.

Anyway, the demo:

Forgot to say, use Harold's Fire.
I don't understand why you would want or expect a common event attached to a skill to activate outside of battle. As I said in my last post, that is not a logical progression that anyone else here would make.
Indeed, and similarly, if you have a parallel process / autorun event on-map that transfers the player midway to a different map, nothing else on the event will trigger. That makes perfectly logical sense, since the event is no longer in the game instance. And so the battle is immediately ended the second every enemy dies, and the aftermath proceeds to be shown. So any events scheduled to occur after an enemy dies would not occur, since it is no longer in the same instance.

I don't know about previous versions of MV/Z but I do know that in all my experience with VX Ace, it has never worked in the way you are describing @Indinera. Yes I know you say differently, yes I know you've been making games for 21 years while I have been doing it for 5, yes I know that you have a website and all kinds of pages with numerous games. But I am just adding my own experience.

But we can consider why this behavior is entirely logical, and why, like Turan said, changing it might be considered a bug fix. Let's say you had a certain skill run a common event in which a player's companion exclaims something randomly, like "Good work!" or "Keep going!". In this case, if the comment showed up on map, after the battle, that wouldn't work well at all. We wouldn't want the common event to run. This example isn't something I randomly came up with off the top of my head, this is something I actually did with Yanfly's Gab Window, and nothing appeared if it was the last enemy killed.
No, it actually decreases the possibilities you're given to have it work like this. So it's a loss for the software.

Just because you've never used it like I have, doesn't mean your experience is better. In fact it explains WHY you don't get me and why you don't realize all the great stuff you can do with this feature. It's truly a cool possibility to have common events run this way and sorry to say, but I have checked on my Ace game and it does behave exactly this way on Ace AS WELL.

And incidentally if you really want something on the map NOT to happen, a simple fork condition will check whether you're on the map or in the battle. Whereas replicating how I use my skill common events is a nightmare if that specific feature is lost. One thing for sure, if this is not fixed, I'll stick to my old version.

So any events scheduled to occur after an enemy dies would not occur, since it is no longer in the same instance.

It still works like this in XP, Ace, MV and MZ, so it has worked like this from 2005 to 2021 but okay. 😉

if you have a parallel process / autorun event on-map that transfers the player midway to a different map, nothing else on the event will trigger

It's wrong in the case of autorun. Put a dialogue after the teleport for instance and it will show up.
No, it actually decreases the possibilities you're given to have it work like this. So it's a loss for the software.

Just because you've never used it like I have, doesn't mean your experience is better. In fact it explains WHY you don't get me and why you don't realize all the great stuff you can do with this feature. It's truly a cool possibility to have common events run this way and sorry to say, but I have checked on my Ace game and it does behave exactly this way on Ace AS WELL.

And incidentally if you really want something on the map NOT to happen, a simple fork condition will check whether you're on the map or in the battle. Whereas replicating how I use my skill common events is a nightmare if that specific feature is lost. One thing for sure, if this is not fixed, I'll stick to my old version.
Okay! You say you are keeping track of how many times a skill is used. Why not use a variable? Make the skill formula look like this:
Code:
v[1] += 1; 116+a.mat-b.mdf
Every time the skill is used, variable 1 will increase by 1. I don't know if your common event is increasing a variable or if it's working differently, but this should work better, if you are using a variable.

EDIT: On this:
It's wrong in the case of autorun. Put a dialogue after the teleport for instance and it will show up.
I happen to know that that is not true for VX Ace, because I had a hell of a time initializing numerous variables and switches and script commands after my intro scene at the beginning of my game. I ran all those commands after the transfer command, but none of them happened; I had to place a seperate event in the map I was transferring to, that had all the commands.
Every time the skill is used, variable 1 will increase by 1. I don't know if your common event is increasing a variable or if it's working differently, but this should work better, if you are using a variable.

This does help but for more complex common events, it's not enough. Bear in mind using a common event is far more comfortable as it has more space, events etc and since it has always worked in all past RM I've used, why would I even think of changing? It's not like 1.4.0 has been around for ages.

I happen to know that that is not true for VX Ace, because I had a hell of a time initializing numerous variables and script commands after my intro scene at the beginning of my game. I ran all those commands after the transfer command, but none of them happened; I had to place a seperate event in the map I was transferring to, that had all the commands.

I've tried with just a dialogue and it worked. Haven't further investigated. I know a lot of stuff carry over with autorun (whereas not at all with parallel process).

EDIT: I tried setting a variable, removing a character, and these two events worked as well.
EDIT (2): heck even a move event on the hero worked...
Okay! You say you are keeping track of how many times a skill is used. Why not use a variable? Make the skill formula look like this:
Code:
v[1] += 1; 116+a.mat-b.mdf
Every time the skill is used, variable 1 will increase by 1. I don't know if your common event is increasing a variable or if it's working differently, but this should work better, if you are using a variable.

You shouldn't be updating variables in damage formula, as it can easily create bugs, notably with auto-battle.
This does help but for more complex common events, it's not enough. Bear in mind using a common event is far more comfortable as it has more space, events etc and since it has always worked in all past RM I've used, why would I even think of changing? It's not like 1.4.0 has been around for ages.



I've tried with just a dialogue and it worked. Haven't further investigated. I know a lot of stuff carry over with autorun (whereas not at with parallel process).
I know that it is not enough for more complex events. It should work for the time being though for this specific task.
You shouldn't be updating variables in damage formula, as it can easily create bugs, notably with auto-battle.
Yes, I have read Yanfly's thread.


I have filled my games with "mechanics in damage formulas" and it has worked quite well with everything but autobattle, which I don't even use anyway. As Yanfly explains in his post, VisuStella should be able to give another solution, though I've never tried it.

In RMMV Yanfly has this: http://www.yanfly.moe/wiki/Actor_Auto_Battle_A.I._(YEP) which is a much better autobattle and replaces that bug. Here is this for MZ: https://rpgmaker.net/engines/rmmz/utilities/295/
I know that it is not enough for more complex events.


The common events I use are indeed more complex than just a variable increase (which is just the beginning of the event itself), hence why they need to run after EACH use of their related skill. My first MZ game is entirely designed on that and "upgrading" to 1.4.0 would mean damaging the gameplay significantly (basically, creating bugs). And anyway, it's not appropriate to change how the software behaves halfway through.
Obviously it can be appropriate to change how the software behaves halfway through, that's all a bug fix is. The question is not "can we change how software behaves halfway through" but rather "is this specific change appropriate to implement halfway through". So we can make the argument that this is an inappropriate change, if we want.

This would probably be better taken up with the devs themselves, though.
Yeah maybe I should have phrased it better, but I just don't see the point in removing that feature.
Especially considering it's always been there. If your common event contains stuff you specifically want happening in the battle, just use a fork condition testing if your party is in battle. Easy enough, and really not requiring to drop a feature that, I repeat, has been around for over 10 years.
Just made the test, and Indinera is totally right, until MZ 1.4, common event on last kill actually trigger.
They may only happen when going back to the map, but they do. Never realized that.

Totally agree that having different behaviors for the same ambiguous cases between core versions isn't very serious. What some people call a bug, others will call it a feature. Making it a parameter like whenever poison can provoke KO would have been better.

@Indinera If you want to revert back to the previous behavior while still using MZ 1.4.3, comment the line 2939 in rmmz_managers.js: $gameTemp.clearCommonEventReservation();

Capture.PNG
Thank you @Alexandre 👍
but I just don't see the point in removing that feature.
"It's a feature, not a bug"

whenever something like this happens, it reminds me of a Microsoft Word "Bug" that was officially declared to be a "feature".
For many years and many versions, Microsoft Word had absolutely no way to place a background picture behind the regularly written text. You had to use new frames for text to place it over any picture.
Then someone found out that if you placed a negative number into the footnote field, that field extended behind the regular text and you could place a background there.

And some time later, after everyone was using that trick due to word of mouth, Microsoft declared that to be an intended feature - and still didn't add an official option for a background placement to their next versions...


No matter what - that a common event attached to a battleskill runs AFTER the battle has been finished is a bug, not a feature. Because that can break a lot of event constructs.

I agree that the battle sequence should have been change to run troop events and common events from the battle in battlescreen after the last enemy was killed - as proven by the fact that many scripts and plugins were written to enable just that.

But no event from battle should run after battle, so that specific instance of things happen should have been fixed much sooner.
No matter what - that a common event attached to a battleskill runs AFTER the battle has been finished is a bug, not a feature. Because that can break a lot of event constructs.

No. It always worked perfectly fine, and I have experience over 15 years and several RM. It never broke anything or caused a glitch.
So no, just no. It's a GREAT feature and 1.4.0 introduced a BUG. If you want to make it BETTER, sure, make it happen IN BATTLE (I would totally take that). But if you remove it, you just make it worse.

But no event from battle should run after battle, so that specific instance of things happen should have been fixed much sooner.

Then fix it for real by making it happen at the end of the battle (a suggestion maybe?). You don't fix anything by removing a possibility. As I said, now updating to 1.4.3 makes my previous game glitchy. How cool is that? Whereas if you really fix it and make it run at the end of the battle, it will improve everything.
I can see why they changed it but it does seem like an odd thing to have left out of the 1.4.0 patch notes.
No. It always worked perfectly fine,
it always worked for you - but what I meant is what would happen if someone else would write a different complex event system that would require a skill common event from a battleskill to NOT trigger outside battle?

Without knowing this bug that other developer would have his complex event broken without understanding why, because from a programmers point of view this form of behaviour goes against every rule of encapsulation and data separation that is taught at universities.
I think the best course of action would be to work around it, like I've always done with the various incarnations of RM. For instance, there are effective tools to quickly identify whether the party is in battle or on the map, which would manage your : "that would require a skill common event from a battleskill to NOT trigger outside battle?"

The bottomline is that I've been taught that skill common events work this way, INCLUDING in MZ, and all of a sudden this is no longer true? I would be happy with an actual fix ensuring all skill common events are run in-battle regardless of whether they are used to kill the last enemy... this would be excellent but as it is, 1.4.3 is just a letdown to me. And incidentally, as I said in a previous message, it renders my previous game buggy. Because I was shown a way to make things, and suddenly it becomes obsolete... I can only hope a future fix will just put it back in-battle, as it should be.
I downloaded the newest version of VisuStella MZ's Sample Project. Here is the plugin list:

1645788987834.png


This is the corescript version:
1645789006486.png


I've made a generic battle skill that launches a common event to display a "Show Message" command upon using it. It does not use any action sequences. It's just a vanilla generic battle skill that has a common event with it.

This is the result:



The common events run both times despite defeating the enemies both times. I'm not sure why you are getting the bug if you are using VisuStella MZ's battle system.

I've also tested with this a full line up of VisuStella MZ plugins outside of the ones in the Sample Project. Like, the whole shebang. It still works the same way.

NOW THEN

I've been given notice by the team that you've been directly emailing the VisuStella Bug Report Response email to try to skip the whole process of having to create a bug report project through the Troubleshooting page.

This is mandatory because we need to find out why it's not working for you so that we can get it working for you. This is literally the most 1 to 1 experience for fixing your stuff out there and you're refusing to do it, especially sending messages like this to my team:

1645789390148.png




It's working for us, too. There's been no changes for this plugin since December 9, 2021.

This is why it is important that you updated your plugins when they are updated. This is why it is important that you create bug report projects so that we can find out what's actually going on with your game project.

It really takes 30 seconds to recreate the conditions in an empty project, too.

----Edit----

By the way, the 1.4.0 change was noted by my team, too as you can see with our logging of the corescripts found here. I'm pretty sure the change is intentional to remove common events from running the way it is. I don't know why it is intentional, but it is. My only guess is that in vanilla RPG Maker MZ's Battle System, depending on the types of things the game dev does with common events, it will cause the battle system to hang. That's only a theory.

----Edit 2----

And in case you somehow have a different version than we do for the Battle Core and Weapon Swap System that causes the bugs to occur, I've reuploaded both to the itch.io download pages for good measure. Please download both of them and try again. If the bugs persist, use the steps found on the Troubleshooting page. By having that bug report project made and sent, the team will be literally fixing your project's problem directly. I don't know what else more there can be asked for.
You shouldn't be updating variables in damage formula, as it can easily create bugs, notably with auto-battle.
Returning to this: a condition can be created in the formula like so:
Code:
a.isStateAffected(x) ? (116+a.mat-b.mdf) : (v[1] += 1; 116+a.mat-b.mdf)
Change x to the autobattle state. This way, if autobattle is on, the variable should not be affected.

Now, this will mean that the variable will not increase at all (not even by 1), under autobattle, which is unfortunate, but should still avoid the bug, I think.

EDIT: Hey @Yanfly I know you wrote that helpful post some time ago, would you happen to know if this solution would actually solve that? :LZSlol:

Original thread: https://forums.rpgmakerweb.com/threads/skill-common-event-ignored-if-said-skill-kills-the-last-enemy.145152/