Sigil Switch Menu System - RPG Maker MV Battling

Discussion in 'Javascript/Plugin Support' started by Tagumon, Mar 29, 2019.

  1. Tagumon

    Tagumon Veteran Veteran

    Messages:
    73
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    I'm not sure if this is possible in RPG Maker MV or if it's even possible with plug-ins... But after a long period of thought, I decided to speak up and ask here for Support with this idea.

    -----------------------------------------------
    My idea or plug-in / what I'm trying to do
    -----------------------------------------------
    I want to add an option to the battle menu just above the "Defend" command, called the "Sigil Switch" command for each of the playable characters (actors)...

    When that option is selected, it displays a sub menu of five options, with the first option being selected by default.

    But each one of the other four options on this menu grants a slight change in stats, and changes a few of the magic attacks and skills available to the character that is 'Sigil Switching'.

    I'd like this sub-menu--- the "Sigil Switching" Menu--- to have these five options...
    • 'Balance'(default)
    • 'Strike'
    • 'Defend'
    • 'Support'
    • 'Disrupt'

    The default 'Sigil'--- the "Balance Sigil"--- simply has the characters default stats and uses their default magic/skill set for their class.
    ------------------------

    The 'Strike Sigil', when switched to, lowers a characters Defense and Magic Defense by 10% and increases their Attack and Magic Attack by 10%....

    The 'Strike Sigil' also removes certain healing/buffing magic and/or skills and replaces them with new Offensive magic/skills for combat.
    ------------------------

    When the 'Defend Sigil' is swapped to, it decreases the character's Attack and Magic Attack by 10% but raises their Defense and Magic Defense stats by 10%.

    Like the 'Strike Sigil' it also changes the magic/skills available to that character, but instead of replacing supportive/defensive magic/skills with offensive/damage-based ones, it does the opposite and replaces a few damaging magic/skills with those relating to buffing defense and protecting teammates.
    ------------------------

    The 'Support Sigil' grants a smaller version (5% change) to that characters stats the same way the 'Defend Sigil' does. (increasing defenses and reducing the attack stats.)

    It replaces a few default magic/skills with other ones focusing on healing and Team-buffing.
    ------------------------

    As for the 'Disrupt Sigil', it functions similar to 'Strike', but changes a smaller percentage to stats (5% change), similar to the 'Support Sigil'.

    The 'Disrupt Sigil' replaces some of the character's default magic/skills with several that focus on debuffing enemies and applying negative states to them.
    ------------------------
    So those are the effects of each Sigil (or option) in the sub-menu....

    So essentially, I want to have this set up so that---

    • Each Character can select the 'Sigil Switch' command from their Battle-Menu and open its sub-menu.
    • Each Character starts off with the first Sigil on the sub-menu, the 'Balance Sigil', selected by default.
    • During the Battle, Each Character can select one of the other four Sigils from the sub-menu to switch to it and gain its respective changes... And if a Sigil is already selected in the sub-menu, they can Swap to a different one or back to the default Sigil, 'Balance', as desired.
    • For Each Character, any Sigil that is currently selected will STAY SELECTED and provide its respective changes to that character for the duration of the Battle; until a different Sigil is MANUALLY selected/switched to by the player, via the aforementioned 'Sigil Switch' command and its sub-menu.
    • Extra 1 - If possible, I would like it so that each Character has their selected Sigil reset to 'Balance' (the default) at the beginning of each battle.
    • Extra 2 - If it is possible and easy to code... I would like to have it so that the previously mentioned 'Sigil Switch' command has a 4-Actor actions/turns cooldown, for each of the individual battlers...
      So if "Actor A" uses the 'Sigil Switch' command on his first turn and selects a different sigil to switch to it, then "Actor A" can't Switch his Sigils again until say... after four of his turns... But, "Actor B", "Actor C", and "Actor D", can still select the command and switch their Sigils, and when they do, they have their "four-of-my-turns" cooldown as well.
      TL;DR or understand... The 4-turns 'wait-time' until an actor can switch Sigils again only stops the character that just chose to Switch... Each character has their own 4-turns cooldown...
    --------------------------------------------

    So... is this possible to do in RPG Maker MV?
    I have a pretty decent understanding with customizing windows/screens/menus in RPG Maker's NORMAL Command menu... But not in the BATTLE command-menu....

    If it is possible, and so I can start making this.... What exactly do I put in my Plug-in to add the command and sub-menu to the actual BATTLE command-menu...?

    [​IMG]
     
    #1
  2. Traverse

    Traverse Veteran Veteran

    Messages:
    114
    Likes Received:
    66
    First Language:
    English
    An MV plugin is just a piece of custom Javascript code. They're usually intended just for modifying the engine but you can do anything with them, including cause to game to ignore all the default code and instead launch some entirely custom 3D engine or other software (or even malware) when you start it. Modifications that ignore that much of the default engine would probably also cause you to run foul of the software license agreement, but you could do it.

    Design-wise, the default MV engine (and Ace and XP before it) mainly splits its codebase into code that deals with visual aspects like the interface and graphics (Window_ and Sprite_ objects) and code that deals with the gameplay logic (Manager, Game_, etc). The Scene_ objects are where the two are usually combined.

    Right now, you've mentioned plenty about how you think the interface for you new "sigil" system will work, but I don't see as much on how the gameplay side is meant to work. A "slight change in stats" can be implemented in many different ways. It can be implemented as some hidden, unseen piece of equipment, it can be implemented as a state/status effect, it can be implemented as a direct alteration to the character's stats, it can be implemented as a set of Traits, it can be a whole new type of stat modifier made from scratch separate from everything else, etc, etc. Which parts of the engine you need to modify will depend on how you choose to implement it.

    So if I were to say how I'd do it, I'd probably make the new "sigil" Window using some sort of modified Window_Command or Window_Selectable and altering Scene_Battle to create it during combat and altering Window_ActorCommand to insert the option to open it. But beyond that, I wouldn't be able to say because what selecting any of the options would do depends on how it is meant to be implemented on the gameplay side.
     
    Last edited: Mar 29, 2019
    #2
  3. Magnus0808

    Magnus0808 Software Developer Veteran

    Messages:
    111
    Likes Received:
    103
    First Language:
    Danish
    Primarily Uses:
    RMMV
    EDIT: THIS CURRENTLY CONTAINS BUGS THAT WILL BE FIXED LATER
    EDIT2: BUGS HAVE BEEN FIXED. Now requires you to use Yanfly's Buff & Status Core.

    I made you this. It is a sigil systems that works by using states. You will need to make a state for each sigil and a single skill that is used to apply sigils. The apply sigil skill is used as a base and will be changed by the plugin depending on which sigil you chose to use in battle.
    The skill could look like this:
    upload_2019-3-30_1-30-19.png
    Then an Sigil State could look like this:
    upload_2019-3-30_1-32-37.png
    I have not added any support for replacing skills depending on which sigil is used. This can however still be done e.g. if you use Yanfly's Buff & States Core then you can use the following Lunatic Code to the sigil:
    Code:
    <Custom Apply Effect>
    if(a.isLearnedSkill(10)){
    a.addState(18);
    }
    </Custom Apply Effect>
    <Custom Remove Effect>
    a.removeState(18);
    </Custom Remove Effect>
    This will check if you have learned the skill you want to swap and if you have then it will add another state which should have the following traits:
    Code:
    Add Skill: THE_SWAPPED_IN_SKILL
    Seal Skill: THE_SWAPPED_OUT_SKILL
    If you have any questions feel free to message me :)

    Code:
    //=============================================================================
    // Sigil States
    // MRP_SigilStates.js
    // By Magnus0808 || Magnus Rubin Peterson
    //=============================================================================
    
    /*:
     * @plugindesc Requires Yanfly's Buff & Status Core. This plugin adds Sigils to the game.
     * @author Magnus0808
     *
     * @help Requires Yanfly's Buff & Status Core, so place this plugin after that one.
     * A sigil is basically a state that any actor can apply to themself in
     * battle. However, an actor can only have one sigil enabled at a time.
     *
     * You also need to create ONE sigil skill which is used as a base skill for all
     * sigils. The following will of the skill will be overritten:
     *
     *      * Name
     *      * Icon
     *      * Description (if the Sigil have a description)
     *
     * The sigil apply skill should then be set in the plugin parameters.
     * You also need to set which States are sigils in the parameters.
     *
     * You can add a description to a Sigil by using the following notetag:
     *
     *       <Description:YOUR DESCRIPTION>
     *
     * @param Sigil Command Text
     * @type string
     * @desc The text for the sigil command.
     * @default Switch Sigil
     *
     * @param Sigils
     * @type state[]
     * @desc If true then you regen health after each battle to have the same procent of health left
     * compared to what you had at the end of the battle.
     *
     * @param Apply Skill
     * @type skill
     * @desc The skill used to apply the sigil. It will be overritten.
     *
     * @param Starting Sigil
     * @type state
     * @desc This sigil will be applied to all battlers in the start of the battle. Leave
     * empty or 0 to disable.
     *
     * @param Change Sigil Cooldown
     * @type number
     * @desc The amount of turns after you have changed sigil until you can change it again
     * @default 0
     *
     * @param Change Sigil Uses Turn
     * @type boolean
     * @desc If true then changing the sigil will use the turn.
     * @default true
     
     */
     
     var Imported = Imported || {};
     Imported.MRP_SigilStates = true;
     
     var MRP = MRP || {};
     MRP.SigilStates = MRP.SigilStates || {};
     
    (function() {
     
        MRP.SigilStates.Parameters = PluginManager.parameters('MRP_SigilStates');
        MRP.SigilStates.sigilCommandText = String(MRP.SigilStates.Parameters['Sigil Command Text']);
        MRP.SigilStates.states = JSON.parse(MRP.SigilStates.Parameters['Sigils']);
        MRP.SigilStates.originalCustomApply = [];
        for (var i = 0; i < MRP.SigilStates.states.length; i++) {
            MRP.SigilStates.states[i] = Number(MRP.SigilStates.states[i]);
        }
        MRP.SigilStates.skillId = Number(MRP.SigilStates.Parameters['Apply Skill']);
        MRP.SigilStates.startingSigil = Number(MRP.SigilStates.Parameters['Starting Sigil']);
        MRP.SigilStates.cooldownSigil = Number(MRP.SigilStates.Parameters['Change Sigil Cooldown']);
        MRP.SigilStates.changeTurnSigil = (MRP.SigilStates.Parameters['Change Sigil Uses Turn'] == "true");
     
        MRP.SigilStates.updateOriginalCustomApply = function () {
            var states = MRP.SigilStates.states;
            for(var i = 0; i < states.length; i++){
                var state = states[i];
                $dataStates[state].customEffectEval['addState'] = MRP.SigilStates.originalCustomApply[i] + 'a._cooldownSigil = ' + (MRP.SigilStates.cooldownSigil + 1);
            }
        }
     
     
        //-----------------------------------------------------------------------------
        // DataManager
        //
        // Changes to DataManager
        MRP.SigilStates.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
        DataManager.isDatabaseLoaded = function() {
            if (!MRP.SigilStates.DataManager_isDatabaseLoaded.call(this)) return false;
            if (!MRP.SigilStates.loaded) {
                for (var i = 0; i < MRP.SigilStates.states.length; i++) {
                    MRP.SigilStates.originalCustomApply[i] = $dataStates[MRP.SigilStates.states[i]].customEffectEval['addState'];
                }
                MRP.SigilStates.updateOriginalCustomApply();
                MRP.SigilStates.loaded = true;
            }
            return true;
        };
     
        MRP.SigilStates.DataManager_isSkill = DataManager.isSkill;
        DataManager.isSkill = function(item) {
            if(item && item.id == MRP.SigilStates.skillId) {
                return true;
            } else {
                return MRP.SigilStates.DataManager_isSkill.call(this, item);
            }
        };
     
        //-----------------------------------------------------------------------------
        // Window_BattleSigil
        //
        // The window for selecting which sigil to use.
    
        function Window_BattleSigil() {
            this.initialize.apply(this, arguments);
        }
    
        Window_BattleSigil.prototype = Object.create(Window_SkillList.prototype);
        Window_BattleSigil.prototype.constructor = Window_BattleSigil;
    
        Window_BattleSigil.prototype.initialize = function(x, y, width, height) {
            Window_SkillList.prototype.initialize.call(this, x, y, width, height);
            this.hide();
        };
    
        Window_BattleSigil.prototype.show = function() {
            this.selectLast();
            this.showHelpWindow();
            Window_SkillList.prototype.show.call(this);
        };
    
        Window_BattleSigil.prototype.hide = function() {
            this.hideHelpWindow();
            Window_SkillList.prototype.hide.call(this);
        };
     
        Window_BattleSigil.prototype.makeItemList = function() {
            if (this._actor) {
                this._data = this.createSkills(MRP.SigilStates.states);
            } else {
                this._data = [];
            }
        };
     
        Window_BattleSigil.prototype.isEnabled = function(item) {
            return this._actor;
        };
     
        Window_BattleSigil.prototype.createSkills = function(states) {
            var skills = [];
            for(var i = 0; i < states.length; i++){
                var state = $dataStates[states[i]];
                var skill = JsonEx.makeDeepCopy($dataSkills[MRP.SigilStates.skillId]);
                if(state.meta.Description) skill.description = state.meta.Description;
                skill.effects.push({"code":21,"dataId":state.id,"value1":1,"value2":0});
                for(var j = 0; j < states.length; j++){
                    if(state.id == states[j]) continue;
                    skill.effects.push({"code":22,"dataId":states[j],"value1":1,"value2":0});
                }
                skill.iconIndex = state.iconIndex;
                skill.name = state.name;
                skills[i] = skill;
            }
            return skills;
        }
     
        Window_BattleSigil.prototype.item = function() {
            if(this._data && this.index() >= 0){
                var item  = this._data[this.index()];
                this._actor._sigilSkill = item;
                return item;
            } else {
                return null;
            }    
            return this._data && this.index() >= 0 ? this._data[this.index()] : null;
        };
     
        //-----------------------------------------------------------------------------
        // Scene_Battle
        //
        // Changes to Scene_Battle
     
        MRP.SigilStates.Scene_Battle_createAllWindows = Scene_Battle.prototype.createAllWindows;
        Scene_Battle.prototype.createAllWindows = function() {
            MRP.SigilStates.Scene_Battle_createAllWindows.call(this);
            this.createsigilWindow();
        };
     
        Scene_Battle.prototype.createsigilWindow = function() {
            var wy = this._helpWindow.y + this._helpWindow.height;
            var wh = this._statusWindow.y - wy;
            this._sigilWindow = new Window_BattleSigil(0, wy, Graphics.boxWidth, wh);
            this._sigilWindow.setHelpWindow(this._helpWindow);
            this._sigilWindow.setHandler('ok',     this.onSigilOk.bind(this));
            this._sigilWindow.setHandler('cancel', this.onSigilCancel.bind(this));
            this.addWindow(this._sigilWindow);
        };
     
        MRP.SigilStates.Scene_Battle_createActorCommandWindow = Scene_Battle.prototype.createActorCommandWindow;
        Scene_Battle.prototype.createActorCommandWindow = function() {
            MRP.SigilStates.Scene_Battle_createActorCommandWindow.call(this);
            this._actorCommandWindow.setHandler('sigil',   this.commandSigil.bind(this));
        };
     
        Scene_Battle.prototype.commandSigil = function() {
            this._sigilWindow.setActor(BattleManager.actor());
            this._sigilWindow.refresh();
            this._sigilWindow.show();
            this._sigilWindow.activate();
        }
     
        MRP.SigilStates.Scene_Battle_isAnyInputWindowActive = Scene_Battle.prototype.isAnyInputWindowActive;
        Scene_Battle.prototype.isAnyInputWindowActive = function() {
            return MRP.SigilStates.Scene_Battle_isAnyInputWindowActive.call(this) || this._sigilWindow.active;
        };
     
        Scene_Battle.prototype.onSigilOk = function() {
            var skill = this._sigilWindow.item();
            var action = BattleManager.inputtingAction();
            action.setSkill(skill.id);
            BattleManager.actor().setLastBattleSkill(skill);
            if(!MRP.SigilStates.changeTurnSigil){
                BattleManager.actor()._actions.push(new Game_Action(BattleManager.actor()));
                BattleManager.actor()._sigilExtraTurn = BattleManager.actor()._actionInputIndex;
            }
            this.onSelectAction();
        };
    
        Scene_Battle.prototype.onSigilCancel = function() {
            this._sigilWindow.hide();
            this._actorCommandWindow.activate();
        };
     
        MRP.SigilStates.Scene_Battle_onActorOk = Scene_Battle.prototype.onActorOk;
        Scene_Battle.prototype.onActorOk = function() {
            MRP.SigilStates.Scene_Battle_onActorOk.call(this);
            this._sigilWindow.hide();
        };
     
        MRP.SigilStates.Scene_Battle_onActorCancel = Scene_Battle.prototype.onActorCancel;
        Scene_Battle.prototype.onActorCancel = function() {    
            MRP.SigilStates.Scene_Battle_onActorCancel.call(this);
            if(this._actorCommandWindow.currentSymbol() == 'sigil'){
                this._sigilWindow.show();
                this._sigilWindow.activate();
            }
        };
        MRP.SigilStates.Scene_Battle_onSelectAction = Scene_Battle.prototype.onSelectAction;
        Scene_Battle.prototype.onSelectAction = function() {
            this._sigilWindow.hide();
            MRP.SigilStates.Scene_Battle_onSelectAction.call(this);
        };
     
        Scene_Battle.prototype.changeInputWindow = function() {
            if (BattleManager.isInputting()) {
                if (BattleManager.actor()) {
                    this.startActorCommandSelection();
                } else {
                    this.startPartyCommandSelection();
                }
            } else {
                this.endCommandSelection();
            }
        };
     
     
        //-----------------------------------------------------------------------------
        // Window_ActorCommand
        //
        // Changes to Window_ActorCommand
        Window_ActorCommand.prototype.makeCommandList = function() {
            if (this._actor) {
                this.addAttackCommand();
                this.addSkillCommands();
                this.addCommand(MRP.SigilStates.sigilCommandText, 'sigil', this._actor.canSigilSwitch()); // Maybe do some fancy stuff
                this.addGuardCommand();
                this.addItemCommand();
            }
        };
     
        //-----------------------------------------------------------------------------
        // Game_Action
        //
        // Changes to Game_Action
     
        MRP.SigilStates.Game_Action_item = Game_Action.prototype.item;
        Game_Action.prototype.item = function() {
            if(this._item.isSkill() && this._item._itemId == MRP.SigilStates.skillId){
                return this.subject()._sigilSkill;
            } else {
                return MRP.SigilStates.Game_Action_item.call(this);
            }
        };
       
        //-----------------------------------------------------------------------------
        // Game_Actor
        //
        // Changes to Game_Actor
       
        MRP.SigilStates.Game_Actor_selectPreviousCommand = Game_Actor.prototype.selectPreviousCommand;
        Game_Actor.prototype.selectPreviousCommand = function() {
            var b = MRP.SigilStates.Game_Actor_selectPreviousCommand.call(this);
            if(this._sigilExtraTurn == this._actionInputIndex) {
                this._actions.pop();
                this._sigilExtraTurn = -1;
            }
            return b;
           
        };
     
        //-----------------------------------------------------------------------------
        // Game_Battler
        //
        // Changes to Game_Battler
     
        MRP.SigilStates.Game_Battler_initMembers = Game_Battler.prototype.initMembers;
        Game_Battler.prototype.initMembers = function() {
            MRP.SigilStates.Game_Battler_initMembers.call(this);
            this._cooldownSigil = 0;
            this._sigilSkill = null;
            this._sigilExtraTurn = -1;
        };
        Game_Battler.prototype.canSigilSwitch = function() {
            return this._cooldownSigil < 1 && this._sigilExtraTurn == -1;
        };
     
        MRP.SigilStates.Game_Battler_onTurnEnd = Game_Battler.prototype.onTurnEnd;
        Game_Battler.prototype.onTurnEnd = function() {
            MRP.SigilStates.Game_Battler_onTurnEnd.call(this);
            this._cooldownSigil = this._cooldownSigil > 0 ? this._cooldownSigil - 1 : this._cooldownSigil;
        };
     
        MRP.SigilStates.Game_Battler_onBattleStart = Game_Battler.prototype.onBattleStart;
        Game_Battler.prototype.onBattleStart = function() {
            MRP.SigilStates.Game_Battler_onBattleStart.call(this);
            if(MRP.SigilStates.startingSigil && MRP.SigilStates.startingSigil != 0) {
                this.addState(MRP.SigilStates.startingSigil);
                this._cooldownSigil = 0;
                this._sigilExtraTurn = -1;
            }
        };
       
        //-----------------------------------------------------------------------------
        // BattleManager
        //
        // Changes to BattleManager
       
        MRP.SigilStates.BattleManager_updateTurnEnd = BattleManager.updateTurnEnd;
        BattleManager.updateTurnEnd = function() {
            console.log("updateTurnEnd");
            for(var i = 0; i < $gameParty.members().length; i++) {
                var actor = $gameParty.members()[i];
                actor._sigilExtraTurn = -1;
            }
            MRP.SigilStates.BattleManager_updateTurnEnd.call(this);
        };
         
    })();
     

    Attached Files:

    Last edited: Apr 2, 2019
    #3
  4. Traverse

    Traverse Veteran Veteran

    Messages:
    114
    Likes Received:
    66
    First Language:
    English
    Good try but I suspect that what you have might not work quite the way the OP wants it to.

    The way I suspect they want it to work is that the Sigil state immediately gets applied onto the actor the moment the option is selected and then the same actor can then continue to select another command like Attack or Magic afterwards. The way your plugin does it, selecting the Sigil takes up the actor's turn command like using Attack or Magic and it won't apply the state until the actor casts the skill when the turn begins (also the way you set it up, going back to the actor to re-select commands will also cancel the Sigil command but keep applying the cooldown).

    Of course I'm not the requester, so I may be wrong about this assumption. They would have to clarify that it fits what they want.

    (This is also leaving aside the bug in actually applying the state where if multiple actors try to change Sigil it only applies the one selected by the last actor on all of them... the first time. The second time you try, the code to dynamically generate the Sigil skill from State starts referencing a non-existent State and just doesn't work right)

    It is a fair attempt, so points for trying though.
     
    #4
    Magnus0808 likes this.
  5. Magnus0808

    Magnus0808 Software Developer Veteran

    Messages:
    111
    Likes Received:
    103
    First Language:
    Danish
    Primarily Uses:
    RMMV
    Yeah I thought about if the Sigil state should be applied immediately, however personally I think it would make it kinda tedious as it would mean you would probably change it every time you are about to use your big damage or defense skills with minimal drawbacks. But yeah if the requester wanted it to be immediate instead that could posibibly be done.

    I didn't think about the cooldown still applying if you cancel the Sigil command. You are of cause right and I should fix that. I did not think about what would happen if multiple actors try to change Sigil in the same turn either. Now when you point it out this obviously a huge mistake. So much for trying to be fancy and only using a single skill. Funny enough if I had gone with an approch where the Sigil state was appied immediately then this would not be a problem.

    I'll probably fix the bugs later today, however it is almost 8am and I haven't slept yet. I gotta sleep first :kaodes:
     
    #5
  6. Magnus0808

    Magnus0808 Software Developer Veteran

    Messages:
    111
    Likes Received:
    103
    First Language:
    Danish
    Primarily Uses:
    RMMV
    I have fixed the bugs that was pointed out by @Traverse. The plugin now requires you to use Yanfly's Buff & States Core.
    Applying a Sigil state still uses the turn, if you wish for it to be applied immediately instead without using the turn let me know and I will look into changing the plugin :)

    I have edited my original reply with the updates.
     
    #6
  7. Tagumon

    Tagumon Veteran Veteran

    Messages:
    73
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    I’m currently at work but will read these as soon as I get home! Thanks for the help everyone! I will check to see if it works in about 2~3 hours
     
    #7
  8. Tagumon

    Tagumon Veteran Veteran

    Messages:
    73
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    I haven’t tried it out yet, but after reading it over, is it possible to add the cooldown via...

    1. When the sigil is selected and applied to “Actor A” it seals the COMMAND for Sigil Switching for 4 turns for “Actor A”

    2. When the sigil is selected and applied to “Actor A” it seals all of the Sigil options inside the Command for 4 turns for “Actor A”
    ———————

    Similarly...

    If it does use up the turn... instead of messing with the Battle System’s code to avoid this... is it possible to make it so—-

    1. When a sigil is selected and applied to “Actor A” the sigil adds an additional, immediate state, that makes the Actor take an IMMEDIATE additional turn?

    If it can be done this way, then the battle would flow like such;

    1. “Actor A” switches Sigil’s and the Sigil’s state is applied. The Sigil-Switch command or the options are sealed for 5 of “Actor A”’s turns.

    2. An additional state is applied to “Actor A” so that “Actor A” can immediately take another turn. We’ll call this the “Bonus-Turn-State” (Could be via Speed stat increasing drastically maybe?)

    3. As soon as it becomes “Actor A”’s turn again, thanks to the “Bonus-Turn-State”, the “Bonus-Turn-State” is removed, so that the Sigil-State is the only one active now.

    4. “Actor A” takes their turn as normal now, and decides to Attack/Guard/Magic or whatever they decide to do.

    5. Since “Actor A” just took their additional turn, the Cooldown ticks down to 4 as it was intended to be.

    ————————

    Would this work...?

    Also everyone’s help is much much appreciated!!! You all have all my thanks!
     
    Last edited by a moderator: Apr 2, 2019
    #8
  9. Magnus0808

    Magnus0808 Software Developer Veteran

    Messages:
    111
    Likes Received:
    103
    First Language:
    Danish
    Primarily Uses:
    RMMV
    It should already do option 1. :)

    I came up with a way to make the Sigil State be applied without using your turn by allowing you to also take another action. However, it should be noted that the enemy might attack before you change your actions are taken. You can choose rather to make the changing of Sigil use the turn or not in the plugin parameter :)
     
    #9
  10. Tagumon

    Tagumon Veteran Veteran

    Messages:
    73
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    I was testing it out and it doesn't seem that the turn counter is working... after using the Sigil Switch once, it never allowed me to do it again even after 12 turns
     
    #10
  11. Magnus0808

    Magnus0808 Software Developer Veteran

    Messages:
    111
    Likes Received:
    103
    First Language:
    Danish
    Primarily Uses:
    RMMV
    Please download it again. It was a bug I have already fixed. The counter was set to your value + 1. But for some reason it calulated it as e.g. 41 instead of 5 :p
    Anyway that is fixed you're probably using an old version.
     
    #11
  12. Tagumon

    Tagumon Veteran Veteran

    Messages:
    73
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    I was just about to type "Update works now" but you beat me to it! haha! is there anyway to change the flash that appears when using the skill?
     
    #12
  13. Magnus0808

    Magnus0808 Software Developer Veteran

    Messages:
    111
    Likes Received:
    103
    First Language:
    Danish
    Primarily Uses:
    RMMV
    I am not entirely sure what "flash" you're talking about. Is the animation of the apply skill set to None? The animation of the apply skill is the animation displayed when using the skill. Or do you mean you want to change the animation by Sigil to Sigil basis?
     
    #13
  14. Tagumon

    Tagumon Veteran Veteran

    Messages:
    73
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    They are both set to None but it does the Special "Skill-flash" when it is used.
     
    #14
  15. Magnus0808

    Magnus0808 Software Developer Veteran

    Messages:
    111
    Likes Received:
    103
    First Language:
    Danish
    Primarily Uses:
    RMMV
    Ohhh you probably use Yanfly's Battle Engine. Use the notetag <Cast Animation: 0> for the apply skill to disable the cast animation for the skill.
     
    #15
  16. Tagumon

    Tagumon Veteran Veteran

    Messages:
    73
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    AH I NEVER NOTICED THIS SORRY!
     
    #16
  17. Traverse

    Traverse Veteran Veteran

    Messages:
    114
    Likes Received:
    66
    First Language:
    English
    Apologies in advance for being a snarky smartass - or at least, snarkier than normal - but I really feel the need to ask the obvious:

    If you're going to make people use external plugins like Yanfly's Buff and States to make it work...... why don't you just tell them to go grab Yanfly's Instant Cast and Skill Cooldown plugins and be done with it? (Honestly speaking I didn't remember those until you brought up Yanfly's stuff, but I'm pretty sure they'd accomplish the same job without the hassle of dynamically generating skills from states or this insertion additional turns.)

    Now before anyone runs off and actually does that, I'm going to go ahead and answer my own question.

    Because.

    Leaving aside from the fact that Yanfly's plugins tend to come with a whole bunch of extra features that you may not want, the fact is that GUI is not customisable. If you want a custom interface job like the OP requested, Yanfly doesn't do that. When you go with a Yanfly plugin, you're stuck with a Yanfly interface.

    GUI mods need to be custom-coded. That's the reality.

    On the other hand, many people don't actually realize how many gameplay mechanics you can implement without turning to scripting/plugins. And this is more or less one such example. And I'm going to explain why.

    When it comes down to it, the fact is that the only gameplay mechanic in this system that actually needs a coded plugin solution is the instant-cast in the middle of the turn. The rest can be done with states and skills, the Sigil battle command itself being a Skill Type like 'Magic' or 'Special', and the selectable options simply being Sigil-skill type Skills that are instantly cast when selection. Even learning/removing skills and putting them on "cooldown" can be done with default mechanics.

    But let's take a look at what actually needs the code work. We'll start with the GUI. Requester wants it in a single column box showing 5 options, just above the party HUD. Easiest way is to make a brand new Window for this. Depending on how the gameplay side of the stat/skill boost is implemented, you could use Command or Selectable as the base. But - and credit to you, Magnus0808 - Window_SkillList or BattleSkill makes a fine base to start since as you identified, we really only need to use Skills/States to pull it off.

    All our new Window_BattleSigil needs to be is mostly a copy of Window_BattleSkill, except tweaked to change some dimensions. The only additional code necessary is the stuff to remember (and highlight yellow) the currently "equipped" selected options (and to default to the first on the list if there is none).

    This will require giving actors a variable to store what their last personal sigil selection was, the same kind used to remember what their last ActorCommand selection was. This has nothing to do with stats, just affects what initially gets highlighted in the window.

    Code:
    // Game_Actor modified to add a "lastSigilSymbol" variable in order to store the
    // last selected Sigil for recall. Basically copied from 'lastCommandSymbol'.
    var sigil_alias_gmActor_initMembers_04042019 = Game_Actor.prototype.initMembers;
    Game_Actor.prototype.initMembers = function() {
        sigil_alias_gmActor_initMembers_04042019.call(this);
        this._lastSigilSymbol = null; // This can be changed to give all actors a default.
                                      // i.e. (this._lastSigilSymbol = 'Balance')
                                      // Note - this has nothing to do with applying any stats.
    }
    
    Game_Actor.prototype.lastSigilSymbol = function() {
        return this._lastSigilSymbol;
    };
    
    Game_Actor.prototype.setLastSigilSymbol = function(symbol) {
        this._lastSigilSymbol = symbol;
    };

    Next we make the actual Window. This is by far the biggest chunk of code, because most of the new stuff (mainly to do with highlighting/remembered options, etc.) is in here.

    Code:
    // Create the BattleSigil window based BattleSkill window, tweaked for required specs.
    function Window_BattleSigil() {
       this.initialize.apply(this, arguments);
    }
    
    Window_BattleSigil.prototype = Object.create(Window_SkillList.prototype);
    Window_BattleSigil.prototype.constructor = Window_BattleSigil;
    
    Window_BattleSigil.prototype.initialize = function(x, y) {
       // Width and height manually set below.
       var width = 192; // Manually set width to 192px, same width as Actor Command window.
       var height = this.fittingHeight(5); //Set height just enough for 5 rows.
       Window_SkillList.prototype.initialize.call(this, x, y, width, height);
       this.hide();
    };
    
    Window_BattleSigil.prototype.show = function() {
       this.selectLast();
       this.showHelpWindow();
       Window_SkillList.prototype.show.call(this);
    };
    
    Window_BattleSigil.prototype.hide = function() {
       this.hideHelpWindow();
       Window_SkillList.prototype.hide.call(this);
    };
    
    Window_BattleSigil.prototype.maxCols = function() {
    return 1;
    };
    
    Window_BattleSigil.prototype.numVisibleRows = function() {
       return 5;
    };
    
    // Highlight Yellow if the sigil is the currently selected/remembered one.
    Window_BattleSigil.prototype.drawItemName = function(item, x, y, width) {
        width = width || 312;
        if (item) {
            var iconBoxWidth = Window_Base._iconWidth + 4;
            this.resetTextColor();
            this.drawIcon(item.iconIndex, x + 2, y + 2);
           if (item.name == this._highlightedCommand) {
               this.changeTextColor(this.crisisColor());
               // crisisColor() refers to Color #17 on the message box skin.
               // So named because it is the bright yellow used for near-death HP display.
           };
            this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
           this.resetTextColor();
        }
    };
    
    // Code below is for remembering/highlighting the sigil selection.
    Window_BattleSigil._highlightedCommand = null;
    
    Window_BattleSigil.prototype.selectLast = function() {
        var lastActorSigil = this._actor.lastSigilSymbol();
       // Run through the sigil list and select actor's remembered sigil if exists.
       if (lastActorSigil) {
           for (var i = 0; i < this._data.length; i++) {
               if (this._data[i].name == lastActorSigil) {
                   this.select(i);
               }
           }
       } else {
       // If not, select the first option on the list.
           this.select(0);
       };
       // Updated the highlighted option and refresh the window.
       this.refresh();
       this._highlightedCommand = this.item().name;
    }
    

    And then we alter Scene_Battle to create and display the window at the desired co-ordinates. The only tricky bit is adding the new window to the list of those checked by the update. There is probably an sleeker way to do this by aliasing the update function (updateBattleProcess) but I'm lazy, so I just overwrite reader function here.

    Code:
    var sigil_alias_scBattle_createAllWindows_04042019 = Scene_Battle.prototype.createAllWindows;
    Scene_Battle.prototype.createAllWindows = function() {
        sigil_alias_scBattle_createAllWindows_04042019.call(this);
        this.createSigilWindow();
    };
    
    // Slightly modified copy of createSkillWindow function, generates the window.
    Scene_Battle.prototype.createSigilWindow = function() {
        var wx = this._statusWindow.x; // Set X-coordinates to that of the party status HUD.
       var wy = this._statusWindow.y - this._statusWindow.height; // Set Y to the same as HUD.
       var wy = wy - (this._statusWindow.standardPadding() * 2);      // Push Y above the window and its padding.
        this._sigilWindow = new Window_BattleSigil(wx, wy);
        this._sigilWindow.setHelpWindow(this._helpWindow);
        this._sigilWindow.setHandler('ok',     this.onSigilOk.bind(this));
        this._sigilWindow.setHandler('cancel', this.onSigilCancel.bind(this));
        this.addWindow(this._sigilWindow);
    };
    
    // Add sigil window to the detection of active input windows.
    // This is an OVERWRITE of the default method. Anything that also overwrites this will clash.
    Scene_Battle.prototype.isAnyInputWindowActive = function() {
           return (this._partyCommandWindow.active ||
                this._actorCommandWindow.active ||
                this._skillWindow.active ||
                this._itemWindow.active ||
                this._actorWindow.active ||
                this._enemyWindow.active ||
               this._sigilWindow.active);
    };
    

    Next we have to alter both Scene_Battle and Window_ActorCommand so that the Sigil window opens up INSTEAD of the BattleSkill window when the Sigil command is selected.

    How do we do this? Well Actor_Command generates its options on-the-fly based on what skill types the actor is set to use. We can just hijack that code to detect a specifically named skill type - i.e. "Sigil" - and make it it generate a special command that opens BattleSigil from that.

    This needs an overwrite, AFAIK, there's no real way around it. Even if you try to change makeCommandList instead, it still needs an overwrite. So anything else you have that also overwrites the ActorCommand window will invariable clash with this.

    Code:
    // Changes Window_ActorCommand to generate a special option instead of the regular if actor has 'Sigil' Skill Type.
    // This OVERWRITES the 'addSkillCommands' function.
    
    Window_ActorCommand.prototype.addSkillCommands = function() {
        var skillTypes = this._actor.addedSkillTypes();
        skillTypes.sort(function(a, b) {
            return a - b;
        });
        skillTypes.forEach(function(stypeId) {
            var name = $dataSystem.skillTypes[stypeId];
           // This is the only part we're actually changing, everything before this is default code.
           if (name === 'Sigil') {
               // Flags the option as a 'sigil' command instead of a generic 'skill' command.
               this.addCommand(name, 'sigil', true, stypeId);
           } else {
               // Default behaviour.
               this.addCommand(name, 'skill', true, stypeId);
           }
           // End changes.
        }, this);
    };
    
    // Directs options flagged as 'sigil' to run the 'commandSigil' function.
    var sigil_alias_scBattle_createActorComandWindow_04042019 = Scene_Battle.prototype.createActorCommandWindow;
    Scene_Battle.prototype.createActorCommandWindow = function() {
       sigil_alias_scBattle_createActorComandWindow_04042019.call(this);
        this._actorCommandWindow.setHandler('sigil',  this.commandSigil.bind(this));
    };
    
    // Function used to open the BattleSigil window.
    //  Except for 1 line, it's just a carbon copy of 'commandSkill', except for 'sigilWindow' instead of 'skillWindow'.
    Scene_Battle.prototype.commandSigil = function() {
       this._sigilWindow._highlightedCommand = BattleManager.actor().lastSigilSymbol(); // Highlights the actor's current sigil.
        this._sigilWindow.setActor(BattleManager.actor());
        this._sigilWindow.setStypeId(this._actorCommandWindow.currentExt());
        this._sigilWindow.refresh();
        this._sigilWindow.show();
        this._sigilWindow.activate();
    };
    

    Now we need some code to deal with what happens when an option on the Sigil menu option is selected or canceled. It's going to be 'instantly' applied BUT do we want the Sigil state - cooldown and all - to be applied the VERY MOMENT it is selected? Or only applied after the menu is shut, giving the player room to change their mind if they accidentally selected something they didn't want while it is open?

    We'll assume the latter, because the former is rather player-unfriendly. Even if it is slightly harder to code. Slightly. Not really. Compared to making a whole new window, it's a much shorter section.

    Code:
    // Highlight the new selection when OK is pressed.
    Scene_Battle.prototype.onSigilOk = function() {
        var skill = this._sigilWindow.item();
       this._sigilWindow._highlightedCommand = skill.name;
       this._sigilWindow.refresh();
       this._sigilWindow.activate(); // Keeps the window active and usable.
                                     // Since all Windows deactivate by default on pressing OK.
    };
    
    // Check if the highlighted sigil is different from the actor's. If it is, apply effects and close window.
    // If not, just close the window.
    Scene_Battle.prototype.onSigilCancel = function() {
       if (BattleManager.actor().lastSigilSymbol() != this._sigilWindow._highlightedCommand) {
           // Select the skill based on the name.
           for (var i = 0; i < this._sigilWindow._data.length; i++) {
               if (this._sigilWindow._data[i].name == this._sigilWindow._highlightedCommand) {
                   var skill = this._sigilWindow._data[i];
               }
           }
           // Apply the effects (use the skill immediately).
           BattleManager.actor().setLastSigilSymbol(skill.name);
           var sigilAction = new Game_Action(BattleManager.actor());
           sigilAction.setItemObject(skill);
           sigilAction.apply(BattleManager.actor());
           this._statusWindow.refresh();
       }
       this._sigilWindow.hide();
       this._actorCommandWindow.activate();
    };
    

    ...And we're done. That's all the code we need. All that's left is to wrap it up in a plugin function and present it as a plugin. While we're at it, we can also make it so that instead of looking for the specific word "Sigil", ActorCommand instead looks to plugin parameters to determine the word it uses for the special menu option.

    Code:
    //=============================================================================
    // "Sigil" System
    //   By: Traverse
    //=============================================================================
    //
    /*:
    * @plugindesc Allows the user to designate a Skill Type for instant casting via special menu.
    *
    * @param Designated Skill Type
    * @type text
    * @desc Text string. The name of the skill type that uses the special menu. Must match the name in database.
    * @default Sigil
    */
    
    (function() {
       var substrBegin = document.currentScript.src.lastIndexOf('/');
       var substrEnd = document.currentScript.src.indexOf('.js');
       var scriptName = document.currentScript.src.substring(substrBegin + 1, substrEnd);
       var parameters = PluginManager.parameters(scriptName);
     
       var sigilDesignatedSkillType = String(parameters['Designated Skill Type']);
    
    // PART 1 //
    // Modifies Game Actor to remember selected sigil and create the Sigil menu.
    
    // Game_Actor modified to add a "lastSigilSymbol" variable in order to store the
    // last selected Sigil for recall. Basically copied from 'lastCommandSymbol'.
    var sigil_alias_gmActor_initMembers_04042019 = Game_Actor.prototype.initMembers;
    Game_Actor.prototype.initMembers = function() {
       sigil_alias_gmActor_initMembers_04042019.call(this);
       this._lastSigilSymbol = null; // This can be changed to give all actors a default.
                                     // i.e. (this._lastSigilSymbol = 'Balance')
                                     // Note - this has nothing to do with applying any stats.
    }
    
    Game_Actor.prototype.lastSigilSymbol = function() {
        return this._lastSigilSymbol;
    };
    
    Game_Actor.prototype.setLastSigilSymbol = function(symbol) {
        this._lastSigilSymbol = symbol;
    };
    
    // Creates the BattleSigil window based BattleSkill window, tweaked for required specs.
    function Window_BattleSigil() {
       this.initialize.apply(this, arguments);
    }
    
    Window_BattleSigil.prototype = Object.create(Window_SkillList.prototype);
    Window_BattleSigil.prototype.constructor = Window_BattleSigil;
    
    Window_BattleSigil.prototype.initialize = function(x, y) {
       // Width and height manually set below.
       var width = 192; // Manually sets width to 192px, same width as Actor Command window.
       var height = this.fittingHeight(5); // Sets height just enough for 5 rows.
       Window_SkillList.prototype.initialize.call(this, x, y, width, height);
       this.hide();
    };
    
    Window_BattleSigil.prototype.show = function() {
       this.selectLast();
       this.showHelpWindow();
       Window_SkillList.prototype.show.call(this);
    };
    
    Window_BattleSigil.prototype.hide = function() {
       this.hideHelpWindow();
       Window_SkillList.prototype.hide.call(this);
    };
    
    Window_BattleSigil.prototype.maxCols = function() {
    return 1;
    };
    
    Window_BattleSigil.prototype.numVisibleRows = function() {
       return 5;
    };
    
    // Highlights in yellow if the sigil is the currently selected/remembered one.
    Window_BattleSigil.prototype.drawItemName = function(item, x, y, width) {
        width = width || 312;
        if (item) {
            var iconBoxWidth = Window_Base._iconWidth + 4;
            this.resetTextColor();
            this.drawIcon(item.iconIndex, x + 2, y + 2);
           if (item.name == this._highlightedCommand) {
               this.changeTextColor(this.crisisColor());
               // crisisColor() refers to Color #17 on the message box skin.
               // So named because it is the bright yellow used for near-death HP display.
           };
            this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
           this.resetTextColor();
        }
    };
    
    // Code below is for remembering/highlighting the sigil selection.
    Window_BattleSigil._highlightedCommand = null;
    
    Window_BattleSigil.prototype.selectLast = function() {
        var lastActorSigil = this._actor.lastSigilSymbol();
       // Runs through the sigil list and selects actor's remembered sigil if exists.
       if (lastActorSigil) {
           for (var i = 0; i < this._data.length; i++) {
               if (this._data[i].name == lastActorSigil) {
                   this.select(i);
               }
           }
       } else {
       // If not, selects the first option on the list.
           this.select(0);
       };
       // Updates the highlighted option and refreshes the window.
       this.refresh();
       this._highlightedCommand = this.item().name;
    }
    
    
    // PART 2 //
    // Modifies Scene_Battle to create the new window.
    
    
    var sigil_alias_scBattle_createAllWindows_04042019 = Scene_Battle.prototype.createAllWindows;
    Scene_Battle.prototype.createAllWindows = function() {
        sigil_alias_scBattle_createAllWindows_04042019.call(this);
        this.createSigilWindow();
    };
    
    // Slightly modified copy of createSkillWindow function, generates the window.
    Scene_Battle.prototype.createSigilWindow = function() {
        var wx = this._statusWindow.x; // Sets X-coordinates to that of the party status HUD.
       var wy = this._statusWindow.y - this._statusWindow.height; // Sets Y to the same as HUD.
       var wy = wy - (this._statusWindow.standardPadding() * 2);  // Pushes Y above the window and its padding.
        this._sigilWindow = new Window_BattleSigil(wx, wy);
        this._sigilWindow.setHelpWindow(this._helpWindow);
        this._sigilWindow.setHandler('ok',     this.onSigilOk.bind(this));
        this._sigilWindow.setHandler('cancel', this.onSigilCancel.bind(this));
        this.addWindow(this._sigilWindow);
    };
    
    // Adds sigil window to the detection of active input windows.
    // This is an OVERWRITE of the default method. Anything that also overwrites this will clash.
    
    Scene_Battle.prototype.isAnyInputWindowActive = function() {
           return (this._partyCommandWindow.active ||
                this._actorCommandWindow.active ||
                this._skillWindow.active ||
                this._itemWindow.active ||
                this._actorWindow.active ||
                this._enemyWindow.active ||
               this._sigilWindow.active);
    };
    
    
    // PART 3 //
    // Alters Scene_Battle and Actor_Command to make the Sigil command open the BattleSigil window.
    
    
    // Changes Window_ActorCommand to generate a special option if actor has 'Sigil' Skill Type.
    // This OVERWRITES the 'addSkillCommands' function.
    Window_ActorCommand.prototype.addSkillCommands = function() {
        var skillTypes = this._actor.addedSkillTypes();
        skillTypes.sort(function(a, b) {
            return a - b;
        });
        skillTypes.forEach(function(stypeId) {
            var name = $dataSystem.skillTypes[stypeId];
           // This is the only part we're actually changing, everything before this is default code.
           //if (name === 'Sigil') {
           if (name === sigilDesignatedSkillType) {
               // Flags the option as a 'sigil' command instead of a generic 'skill' command.
               this.addCommand(name, 'sigil', true, stypeId);
           } else {
               // Default behaviour.
               this.addCommand(name, 'skill', true, stypeId);
           }
           // End changes.
        }, this);
    };
    
    // Directs options flagged as 'sigil' to run the 'commandSigil' function.
    var sigil_alias_scBattle_createActorComandWindow_04042019 = Scene_Battle.prototype.createActorCommandWindow;
    Scene_Battle.prototype.createActorCommandWindow = function() {
       sigil_alias_scBattle_createActorComandWindow_04042019.call(this);
        this._actorCommandWindow.setHandler('sigil',  this.commandSigil.bind(this));
    };
    
    // Function used to open the BattleSigil window.
    //  Except for 1 line, it's just a carbon copy of 'commandSkill', except for 'sigilWindow' instead of 'skillWindow'.
    Scene_Battle.prototype.commandSigil = function() {
       this._sigilWindow._highlightedCommand = BattleManager.actor().lastSigilSymbol(); // Highlights the actor's current sigil.
        this._sigilWindow.setActor(BattleManager.actor());
        this._sigilWindow.setStypeId(this._actorCommandWindow.currentExt());
        this._sigilWindow.refresh();
        this._sigilWindow.show();
        this._sigilWindow.activate();
    };
    
    
    // PART 4 //
    // Logic for selection/cancelation of Sigil menu commands.
    
    
    // Highlights the new selection when OK is pressed.
    Scene_Battle.prototype.onSigilOk = function() {
        var skill = this._sigilWindow.item();
       this._sigilWindow._highlightedCommand = skill.name;
       this._sigilWindow.refresh();
       this._sigilWindow.activate(); // Keeps the window active and usable.
                                     // Since all Windows deactivate by default on pressing OK.
    };
    
    // Checks if the highlighted sigil is different from the actor's. If it is, applies effects and closes window.
    // If not, just closes the window.
    Scene_Battle.prototype.onSigilCancel = function() {
       if (BattleManager.actor().lastSigilSymbol() != this._sigilWindow._highlightedCommand) {
           // Find skill based on the name.
           for (var i = 0; i < this._sigilWindow._data.length; i++) {
               if (this._sigilWindow._data[i].name == this._sigilWindow._highlightedCommand) {
                   var skill = this._sigilWindow._data[i];
               }
           }
           // Apply the effects (use the skill immediately).
           BattleManager.actor().setLastSigilSymbol(skill.name);
           var sigilAction = new Game_Action(BattleManager.actor());
           sigilAction.setItemObject(skill);
           sigilAction.apply(BattleManager.actor());
           this._statusWindow.refresh();
       }
       this._sigilWindow.hide();
       this._actorCommandWindow.activate();
    };
    
    }) ();
    

    Now that's done, you're probably asking "what about the cooldowns and the skill removal, etc. etc."

    Well. That doesn't need a plugin.

    Remember, each Sigil is a skill. That means damage formulas can be used to add/remove skills (b.forgetSkill(99)) and can be used to apply states that SEAL or restrict a whole skill type. Like the Sigil skill type. A State that can be set to last for 4 or any amount of turns.

    See where this is going?

    Make and add the Skill Type 'Sigil' to an actor. Make 5 (or however many) Skills you want, call them Balance, Strike, Defend, whatever and set them under the 'Sigil' skill type. For each one, you will want them to do at least 2 things: A ) Apply a State that gives you the stat boost/adds skill you want and B ) Apply another state that inflicts Seal Skill Type (Sigil) on the actor for however many turns you need and disappears at the end of battle. If you want to remove skills, you use the damage formula to do so.

    Now there's only one thing left - applying a "default" Sigil to the party at the start of combat. The solution?

    Battle events. The way it was done in the 2k/3 era. Inflict the appropriate State on the whole party at the start of every fight. You can also use script box to manually set the last remembered Sigil for the actors. You will also need to manually wipe lastSigilSymbol off all the actors after every fight, or else when you open the menu next battle, the old selection will remain highlighted from them.

    There is also no functionality to display the number of remaining turns of cooldown, as this was never requested in the opening post.

    However, you can always modify this plugin if you need to make those additions, which should not be too difficult, given that you have now been walked through the entire construction of this plugin from start to end.
     
    Last edited: Apr 4, 2019
    #17
  18. Tagumon

    Tagumon Veteran Veteran

    Messages:
    73
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMMV
    I got a "cannot read property name of undefined"
     
    #18
  19. Traverse

    Traverse Veteran Veteran

    Messages:
    114
    Likes Received:
    66
    First Language:
    English
    That would be because you added the Skill Type without adding any Skills of the type to the Actor. If there's a blank list, it crashes because it tries to highlight a skill name that does not exist.

    Replace these lines:
    Code:
       // Updates the highlighted option and refreshes the window.
       this.refresh();
       this._highlightedCommand = this.item().name;
    with this:
    Code:
       // Updates the highlighted option and refreshes the window.
       if (this.item()) { this._highlightedCommand = this.item().name };
       this.refresh();
    I did accidentally put the highlight and refresh in the wrong order, but that only causes the highlight to not appear initially the first time you open the menu. The change needed to fix the issue you had is the if-clause checking to see if there's an actual item on the menu to read the name of.

    If you've messed around with the code for normal menus before, it really shouldn't have been too hard to figure out especially since I detailed the whole plugin construction and which parts did what. The point of that was not so you could just copy the end plugin and stick it in your project, but so you would know exactly how it was made and how to alter it if you needed something else.

    I could've added more parameters, like letting you adjust the width and height and X/Y positions of the new window box but I didn't, on purpose. I purposely kept the whole thing bare-bones so it was easier to study it and you'd know how to manually adjust it later.

    Remember you can open up the console with F8 to see exactly what line is causing a crash when you have one.
     
    Last edited: Apr 5, 2019
    #19

Share This Page