Example: "Time Stop" status effect turns the screen greyscale and pauses music.
What plugins can I use to make status effects cause special events
Javascript/Plugin SupportYou could do this with just a Base Troop plugin (there's a free one available from Yanfly). Make the time stop skill call a common event that turns the screen greyscale and pauses the music, then create a base troop event that executes when the state wears off and returns the screen and music to normal.
The common event would go something like this (assuming enemies can never use this skill):
Then you'd need a common event to remove Time Stop when battle ends. It would be set to Autorun with the Time Stop switch and look something like this:
The base troop event would be set to Turn End and the Time Stop switch with a span of Turn, and would look something like this (assuming Time Stop is state 32):
The common event would go something like this (assuming enemies can never use this skill):
- If: Time Stop is OFF:
- Save BGM
- Fadeout BGM
- Tint Screen (to greyscale)
- Change Enemy State: Entire Troop, + Time Stop
- Control Switch: Time Stop = ON
Then you'd need a common event to remove Time Stop when battle ends. It would be set to Autorun with the Time Stop switch and look something like this:
- If: Script: !$gameParty.inBattle()
- Tint Screen (back to normal)
- Control Switch: Time Stop = OFF
- Change Enemy State: Entire Troop, - Time Stop
The base troop event would be set to Turn End and the Time Stop switch with a span of Turn, and would look something like this (assuming Time Stop is state 32):
- If: Script: !$gameTroop.members().some(who => who.isStateAffected(32))
- Replay BGM
- Tint Screen (back to normal)
- Control Switch: Time Stop = OFF
- Change Enemy State: Entire Troop, - Time Stop
Note: All of the above is written with the assumption that the Time Stop state applies to enemies. I did it that way because I assume you don't want enemies to move while in time stop. If you want it to show as being applied to the party instead, just make two states for it and apply both. You can make the enemy one invisible (no icon) if you want.
I've used this exact approach in my game, so it should definitely work.
Well, the idea is that both enemies *and* party members will be able to use it at some point (two bosses use "THE WORLD" as their ultimate. A particular party member can learn "THE WORLD" by fighting either of the time stopping bosses), so how would that change things?
The way I did it was to add a separate switch for when an enemy used it. The first common event checks both switches and does its thing only if they're both off. When an enemy uses it, it's scripted using Force Action. At that point, after forcing the action (I also manually called the common event, not entirely sure if that's necessary), I turned off the switch indicating that the party used it and turned on the switch indicating that an enemy used it. To make it expire, I added a troop event that works similarly to the second common event, but checks that it's worn off on the enemy instead of on the party. Then, both expire events do nothing if it wears off but the other unit still has it (however, in your case, this might not be necessary – it sounds like it wouldn't be possible for both enemy and party to have it simultaneously).
If you want the enemy to be able to activate it at will via Action Patterns, it might be a bit more difficult. I haven't worked out exactly how that would work, since it wasn't necessary for my case, but… I think the common event called by the skill might need to be able to detect whether an enemy or actor activated it? Because if activated by an enemy, it needs to apply the state to the party, but if activated by an actor, it needs to apply the state to the enemies.
If you want the enemy to be able to activate it at will via Action Patterns, it might be a bit more difficult. I haven't worked out exactly how that would work, since it wasn't necessary for my case, but… I think the common event called by the skill might need to be able to detect whether an enemy or actor activated it? Because if activated by an enemy, it needs to apply the state to the party, but if activated by an actor, it needs to apply the state to the enemies.
Original thread: https://forums.rpgmakerweb.com/threads/what-plugins-can-i-use-to-make-status-effects-cause-special-events.182039/