Types of battles: standard, Preemptive, surprised and surrounded.

Hey all,

Is it possible to do these types of battles? Much like FF6?

Where you load into a screen and you have a different parameter and your battle are starting different.

Standard - You just load in and off you go
Preemptive - the party has a full guage
Surprised - the enemy has a full guage
Surrounded - enemies are everywhere and rows are ignored

I'm happy if the first three are possible!

Cheers,
"Preemptive" and "Surprise" exist and are processed for random encounters. The base chance of each of these is coded as 3% or 5%, depending on whether the mean AGI of all party battle members is higher or lower than the mean AGI of all troop members. That chance can be affected by traits, e.g. Raise Preemptive multiplies the preemptive chance by 4 (12%/20%).

For some reason MZ's Battle Processing command doesn't have those options, though. In case it helps, here's some code adapted from feature D12 of my work-in-progress plugin Cae_Tweaks:
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Cae_Tweaks D12 - setSurprise() & setPreemptive() script calls.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/156047/
 * @help Adds the following global functions, for use in Script commands:
 *   setSurprise();      // force enemy advantage for next battle
 *   setPreemptive();    // force party advantage for next battle
 * These effects are temporary! They will reset:
 *  - On New/Load game;
 *  - On ending the play session;
 *  - After applying to the next battle.
 * Intended for use with the Battle Processing command.
 *
 * ----------------------------------------------------------------------------
 * Terms of use:
 *   MIT License: https://opensource.org/licenses/mit-license.html
 *
 * [[ BEGIN LICENSE TEXT ]]
 *
 *   Copyright © 2023 Caethyril
 *
 *   Permission is hereby granted, free of charge, to any person obtaining a
 *   copy of this software and associated documentation files (the "Software"),
 *   to deal in the Software without restriction, including without limitation
 *   the rights to use, copy, modify, merge, publish, distribute, sublicense,
 *   and/or sell copies of the Software, and to permit persons to whom the
 *   Software is furnished to do so, subject to the following conditions:
 *
 *   The above copyright notice and this permission notice shall be included
 *   in all copies or substantial portions of the Software.
 *
 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 *   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 *   DEALINGS IN THE SOFTWARE.
 *
 * [[ END LICENSE TEXT ]]
 */

// D12) setSurprise() and setPreemptive() fcts for next battle.
;void (() => {
'use strict';

    /** Non-conflicting identifier for new "force surprise/preemptive" flag on `Game_Temp`. */
    const SYM = Symbol();

    /** @enum {number} enumerates flag values. */
    const ENUM = Object.freeze({
        DFAULT:     0,
        PREEMPTIVE: 1,
        SURPRISE:   2
    });

    /**
     * Sets flag to `value`.
     * @param {ENUM} [value] input value; omit to reset to default.
     */
    const setFlag = function(value = ENUM.DFAULT) {
        $gameTemp[SYM] = value;
    };

    /** @returns {ENUM} stored value. */
    const getFlag = function() {
        return $gameTemp[SYM] ?? ENUM.DFAULT;
    };

    /**
     * Updates preemptive/surprise flags for upcoming battle.
     * @returns {boolean} `true` iff a battle flag was set.
     */
    const updateFlags = function() {
        const f = getFlag();
        setFlag();
        switch (f) {
            case ENUM.PREEMPTIVE:
                return BattleManager._preemptive = true;
            case ENUM.SURPRISE:
                return BattleManager._surprise = true;
        }
        return false;
    };

    /** Forces next battle to be preemptive (favours party). */
    globalThis.setPreemptive = function() {
        setFlag(ENUM.PREEMPTIVE);
    };

    /** Forces next battle to be surprise (favours troop). */
    globalThis.setSurprise = function() {
        setFlag(ENUM.SURPRISE);
    };

    // Update surprise/preemptive flags after battle setup. Notes:
    //  - no script commands process between .setup() and .startBattle();
    //  - this feature's flag is stored on $gameTemp, which is not saved;
    //  - applies to all battles but is only designed for Battle Processing command;
    //  - random encounters still check ratePreemptive/rateSurprise as usual.
    void (alias => {
        BattleManager.setup = function(troopId, canEscape, canLose) {
            alias.apply(this, arguments);
            updateFlags();
        };
    })(BattleManager.setup);

})();

MZ doesn't have a built-in "Surrounded" option. RM2k3 does, though: it's called Pincer Attack and mechanically it's a Surprise fight (enemies go first) with escape disabled. There's also the party equivalent, Surround Attack. That doesn't help you directly, but it might mean there's a better chance of a plugin existing for it.
"Preemptive" and "Surprise" exist and are processed for random encounters. The base chance of each of these is coded as 3% or 5%, depending on whether the mean AGI of all party battle members is higher or lower than the mean AGI of all troop members. That chance can be affected by traits, e.g. Raise Preemptive multiplies the preemptive chance by 4 (12%/20%).

For some reason MZ's Battle Processing command doesn't have those options, though. In case it helps, here's some code adapted from feature D12 of my work-in-progress plugin Cae_Tweaks:
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Cae_Tweaks D12 - setSurprise() & setPreemptive() script calls.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/156047/
 * @help Adds the following global functions, for use in Script commands:
 *   setSurprise();      // force enemy advantage for next battle
 *   setPreemptive();    // force party advantage for next battle
 * These effects are temporary! They will reset:
 *  - On New/Load game;
 *  - On ending the play session;
 *  - After applying to the next battle.
 * Intended for use with the Battle Processing command.
 *
 * ----------------------------------------------------------------------------
 * Terms of use:
 *   MIT License: https://opensource.org/licenses/mit-license.html
 *
 * [[ BEGIN LICENSE TEXT ]]
 *
 *   Copyright © 2023 Caethyril
 *
 *   Permission is hereby granted, free of charge, to any person obtaining a
 *   copy of this software and associated documentation files (the "Software"),
 *   to deal in the Software without restriction, including without limitation
 *   the rights to use, copy, modify, merge, publish, distribute, sublicense,
 *   and/or sell copies of the Software, and to permit persons to whom the
 *   Software is furnished to do so, subject to the following conditions:
 *
 *   The above copyright notice and this permission notice shall be included
 *   in all copies or substantial portions of the Software.
 *
 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 *   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 *   DEALINGS IN THE SOFTWARE.
 *
 * [[ END LICENSE TEXT ]]
 */

// D12) setSurprise() and setPreemptive() fcts for next battle.
;void (() => {
'use strict';

    /** Non-conflicting identifier for new "force surprise/preemptive" flag on `Game_Temp`. */
    const SYM = Symbol();

    /** @enum {number} enumerates flag values. */
    const ENUM = Object.freeze({
        DFAULT:     0,
        PREEMPTIVE: 1,
        SURPRISE:   2
    });

    /**
     * Sets flag to `value`.
     * @param {ENUM} [value] input value; omit to reset to default.
     */
    const setFlag = function(value = ENUM.DFAULT) {
        $gameTemp[SYM] = value;
    };

    /** @returns {ENUM} stored value. */
    const getFlag = function() {
        return $gameTemp[SYM] ?? ENUM.DFAULT;
    };

    /**
     * Updates preemptive/surprise flags for upcoming battle.
     * @returns {boolean} `true` iff a battle flag was set.
     */
    const updateFlags = function() {
        const f = getFlag();
        setFlag();
        switch (f) {
            case ENUM.PREEMPTIVE:
                return BattleManager._preemptive = true;
            case ENUM.SURPRISE:
                return BattleManager._surprise = true;
        }
        return false;
    };

    /** Forces next battle to be preemptive (favours party). */
    globalThis.setPreemptive = function() {
        setFlag(ENUM.PREEMPTIVE);
    };

    /** Forces next battle to be surprise (favours troop). */
    globalThis.setSurprise = function() {
        setFlag(ENUM.SURPRISE);
    };

    // Update surprise/preemptive flags after battle setup. Notes:
    //  - no script commands process between .setup() and .startBattle();
    //  - this feature's flag is stored on $gameTemp, which is not saved;
    //  - applies to all battles but is only designed for Battle Processing command;
    //  - random encounters still check ratePreemptive/rateSurprise as usual.
    void (alias => {
        BattleManager.setup = function(troopId, canEscape, canLose) {
            alias.apply(this, arguments);
            updateFlags();
        };
    })(BattleManager.setup);

})();

MZ doesn't have a built-in "Surrounded" option. RM2k3 does, though: it's called Pincer Attack and mechanically it's a Surprise fight (enemies go first) with escape disabled. There's also the party equivalent, Surround Attack. That doesn't help you directly, but it might mean there's a better chance of a plugin existing for it.
Thank you for your help!
You're welcome! 👋
Surrounded - enemies are everywhere and rows are ignored
Just to mention it - this isn't in the engine because there's no such thing as rows in the default engine.

You would have to use a plugin for it and I haven't seen one written for MZ. You would have to see if Yanfly's Row Formation (or one of the other formation plugins for MV) works via Project FOSSIL.

Original thread: https://forums.rpgmakerweb.com/threads/types-of-battles-standard-preemptive-surprised-and-surrounded.161838/