MZ Special Troops/Enemy Encounters

Plugin description:
This plugin adds some special enemy troop encounters via plugin parameters and commands:
  • Large Troops: In the plugin parameter two troops can be combined into a large troop of upto 16 enemies. The position of the enemies in the combines troop will not change from their database position, so enemies in the second part should be placed a different positions.

    Example:
    1649483269126.png
    I've combined troop 11 and 12 into large troop. It doesn't matter which one is encountered. The troop will always consist of the members of both troops. The only difference is, if troop 11 will be encounter the event pages of troop 11 will be used, else the pages of troop 12 will be used.

    Known Issues: Event commands obviously cannot target members of the second half of the troop.

  • Randomized Troops: Putting troop ids into this plugin parameter will make the enemy ids of the first given number of enemies be randomized from the entire pool of the troop. Large troops can be randomized allowing up to 16 randomized enemies. As this will use the positions of the first given number of enemies from the database, only enemies of approximately same size are recommended to be used with this functionality.

    1649483709904.png

    Example:
    My troop 12 is a large troop consisting of 3 sandworms, 3 gnomes, 2 salamander and 4 zombies, but the encounter will consist of only a random selection of 7 of them, while zombies are more likely to appear then salamander.

  • Wave Encounters: Triggered by a plugin command. Battle a certain number of troops consecutively in a single battle screen with the option to trigger a common event between the battles. The next wave of the enemies appear always after the common event is finished. Actor actions are preserved between battles, so if one actor has beaten the last enemy from the current troop while not all actors attacked during this turn, they will attack the incoming troop before it can act.
    1649484110932.png
    Known Issues: If used together with Visu_MZ_BattleCore, the visual enemy selection by mouse click won't work for wave 2 onwards. Luckily Visustella have their own consecutive battles.

  • Challenge Battles: The plugin command EnterChallengeArena opens up an entire new menu. Most of the plugin parameters are used to provide the text for this new menu. In the menu you can select from various battle challenges which can be setup in the plugin parameters. These battle challenge can include wave encounters. The new menu will show you a preview of the last troop encountered in the challenge or a silouhette if the challenge is not yet unlocked. Challenges can include having a preset item list in your inventory, a time limit given either in number of turns or seconds on the timer and/or allowing only certain party members to participate. On victory switches can be activated as an additional rewards and also on the first victory variables can be increased and a common events can be triggered. It's not recommended to use randomized troops or Visustella Swap Enemies with this, because you might never encounter what you see in the preview.
    The participating party members are fully healed before the challenge begins. The entire party is fully healed after the challenge has ended.
    1649484442718.png
TERMS OF USE:
1. This plugin may be used and redistributed with both free and commercial games.
2. This plugin may be redistributed only for free otherwise, but I would appreciate linking back to the original thread instead.
3. You may take code from this plugin for your own free plugins, but not for commercial plugins.
4. You may alter this plugin, but BurningOrca has still to be mentioned in the author section. You may not rename this plugin. You may redistribute the alterations for free.

Requirements:
This plugin requires BoMZ_PluginBase.

Remarks:
The plugin is technically finished but I'll put it into plugins in development, because I might still address the issue I already know if I can and maybe other issues will arise from other people using the plugin.

Get the plugins here:
BurningOrca Plugins (Google Drive)
Had to replace my base plugin and all plugins basing on it. It was causing problems, because it added extensions to Array.prototype which is highly discouraged to do and thus caused compatibility issues with other creators plugins. Replaced those Array extension by global functions taking an array, which is said, because the extensions where really nice to use for myself.
I'm currently actually trying to create a demo project for my MZ plugins, but I don't know if this will really be realesed sometime as this is not my first attempt to do this.
While trying to do this I discovered a lot of issues with this plugin, really needed enhancements and also bugs. So quick update history:

V1.1 Wave Encounters can be lost now without game over. Common Events can be triggered depending on the result of the battle win or loss.

V1.2 Changed Party Restrictions for challenge battles by adding plugin parameter for Kind of Party Restrictions.
Previously your party was always replaced during the battle with all the listed members, now the following two options are provided:
  1. Usable Party Members: New option, from your current party only these members are usable, all others are removed from the party during the challenge battle. This also counts as an availability condition. So party based conditions need not be set additionally.

  2. Forced Party Composition: Existing behaviour: Your party is replaced with all the listed actors.
V1.3 Added ability to set availability conditions and party restrictions for challenge battles by variables storing the relevant actor ids.

V1.4 Added sprite set to Scene_ChallengeArena, so that at least pictures can be shown in the common events triggered for the victory over a challenge battle.

V1.5 Bug Fix: Item drops from challenge battles having restricted inventory are now really given to the player after the battle.

V1.6 Bug Fix: Game Timer now stops after challenge battle has been finished.
Hello,
I keep on getting ReferenceError: Spriteset_Title is not defined when using this plugin. I just want it for the randomised troops, but can't seem to get it to work.
so3y6xx9rbvb1.png
4petxly3sbvb1.png

Do you have any idea why this doesnt work?
Sorry for late answer. I'm pretty inactive here. This was a mistake in the plugin.
I guess I just pasted SpriteSet_Title wrongly into this plugin.
I've fixed it now, but you don't need to redownload it, just open the plugin in a Texteditor and replace SpriteSet_Title by SpriteSet_ChallengeArena and save it.
Sorry for late answer. I'm pretty inactive here. This was a mistake in the plugin.
I guess I just pasted SpriteSet_Title wrongly into this plugin.
I've fixed it now, but you don't need to redownload it, just open the plugin in a Texteditor and replace SpriteSet_Title by SpriteSet_ChallengeArena and save it.
Thanks, but I already had found the issue! It's great that you've fixed it so quickly, I'll replace it with your code. All I did was delete the entire block of code that had SpriteSet_Title in it, and it worked just fine, because all I needed it for was the randomisation of troops anyways! Thanks again.
I was told in a conversation, that my plugin is unfortunately not compatible with VisuMZ_2_WeatherEffects. An error is caused when using the two plugins together and opening the challenge arena screen of my plugin. Adding the following code to the bottom of my plugin will work as workaround solution:

JavaScript:
BoMZ.SpecialTroops.updateWeather = Weather.prototype.update;
Weather.prototype.update = function()
{
    if( SceneManager._scene.constructor !== Scene_ChallengeArena )
    {
        BoMZ.SpecialTroops.updateWeather.call(this);
    }
}
Can It Work With Mv
Can It Work With Mv
Which features are you trying to use? You may likely find existing plugins written for MV.
The Battle Arena Feature
The Battle Arena Feature
Sorry, no this plugin uses MZ specific code to create the windows for arena scene. Everything else might also be specific to MZ.

Updated the version on Google Drive to 1.7.
Added new plugin parameter to be able to manually position and scale the enemy sprites in the arena screen.
By default (when the newer parameter is not set, or the values in the new parameter are set to -1), they will be positioned relatively to their position on the battle screen but the plugin at least tries to fit them in the window. However with the new parameter the positions can be set individually to your liking for each battler in the last troop added to the challenge battle. The index in the plugin parameter corresponds to the index of the enemy within the troop.

For example:
1732289697017.png

Goblin A was first added to the troop, so is at index 0.
The Treant is at index 1.
Goblin B is at index 2.
Sadly this screen does not display the indices of the enemies in the troop, so you have to remember in which order you have added them, to use them properly with my new plugin parameter.

These will then be the default positions in the arena:
1732289892099.png
As you might see my default position is a little flawed especially for large enemies like the treant.
And this is for side view battles. Just testet with front view and there the enemies are placed even more outside of bound of the window.

Therefore the following plugin parameter array has been added to each challenge battle plugin parameter. The newer parameter also allows to scale the sprites in order to handle large or very small sprites even better:
1732290192541.png
And here is how it looks now using front view battle system, although my position was far from ideal:
1732290430239.png


Attention:
This new update does not contain the fix for the VisuMZ_2_WeatherEffects plugin I posted in my previous post. It has to be added manually again to the plugin if required by the plugin user.
Attention:
This new update does not contain the fix for the VisuMZ_2_WeatherEffects plugin I posted in my previous post. It has to be added manually again to the plugin if required by the plugin user.
you could add it inside your code if you check if it's imported though.
if it uses that code, you can check what it does and else default what you did 🙂

it might be a win/win and no trouble ^^
you could add it inside your code if you check if it's imported though.
if it uses that code, you can check what it does and else default what you did 🙂

it might be a win/win and no trouble ^^
Yes, guess I could implement that if I put the Imported.VisuMZ_2_WeatherEffects check around it, but in the end making the weather update function constantly check if my arena scene is active and do nothing if this is the case is just a workaround I happen to think about in order to just bypass the problem, but I guess not really an ideal solution. Therefore I original decided not to add it officially to plugin, but I might reconsider. I haven't bought the visustella plugin myself and it is obfuscated so I might never find a better solution. Thank you for your opinion.
set a parameter for it: use visu weather effect? Yes No
if yes, it checks, default = no (disable).

but I don't own MZ or know its weather effects. so there are smart ways I think.
but just a small way, I don't think it's to much issues I think, but if there is a feature
or bug/update, see what can be done 🙂
Okay, justed updated the plugin and added the workaround at the end of the plugin like this:

JavaScript:
if( PluginManager._scripts.includes('VisuMZ_2_WeatherEffects') )
{
    BoMZ.SpecialTroops.updateWeather = Weather.prototype.update;
    Weather.prototype.update = function()
    {
        if( SceneManager._scene.constructor !== Scene_ChallengeArena )
        {
            BoMZ.SpecialTroops.updateWeather.call(this);
        }
    }
}
No need for a parameter, just checking if the other plugin I am incompatible to is known to RMMZ.

Original thread: https://forums.rpgmakerweb.com/threads/special-troops-enemy-encounters.146580/