MV - SRPG Engine MV - Plugins for creating Tactical Battle System

● ARCHIVED · READ-ONLY
Started by RyanBram 3313 posts Page 153 of 166 View original ↗
  1. the error is already there in the screen "TypeError: this.costWidth is not a function"

    it means your version does not this function at all, download SRPG Gear MV 1.11Q. You should always check the versions. from the rm version to the srpg core version. in my end it is functioning. i suggest you post in another thread for learning java script
  2. Yeah it works now. I just didn't used the right version, thanks !

    Just to know, did someone succeed to change the "in combat Windows"?

    By default during a fight the SRPG engine only shows unit name + portrait and HP / MP / TP gauges. It's fine on player phase because you can see battle prediction before the fight. But on enemy phase it's more "eheheh Will you survive ? What Will I do ? Surprise !!!" it's so frustrating.

    So this is my question : someone succeed to show hit / dmg / cri and the weapon / skill name used during a battle ?
    Like Fire Emblem indeed.
    (Here's an of in combat UI in GBA games)

    SacredStonesFight.png
  3. AngelYuko said:
    So this is my question : someone succeed to show hit / dmg / cri and the weapon / skill name used during a battle ?
    Edit Window_SrpgBattleStatus functions in srpg_core.js
    More specifically:

    drawContentsActor and drawContentsEnemy functions

    By default, these functions draw a face (drawActorFace), draw the actor's name (drawActorName) and draw some basic info (drawBasicInfoActor)

    I would rewrite the drawBasicInfo function to include hit/crit values

    You could add the following line to drawBasicInfoActor function:
    this.drawText(this._battler.cri, x, y, width)
    Change width to 24 for example and x/y to suit your battle status window

    To get weapon, use this._battler.weapons()[0].name
    To get skill name, use this._battler.currentAction().item().name
  4. Thanks !

    I Will try to write something later.
    I Will probably post the result and my edit if I succeed to do something good enought

    EDIT : I finaly succeed to put the prediction window with @xabileug code !
    I just needed to change certain values (because my game is in 1110 width, not 864) and it looks pretty great (I will one day change background windows).

    But just a question. How did you remove the status windows in battle + how did you move the command window (I would like to put it up)?
    Hit / dmg / crit are not displayed (and I think it's because of the command window position. It is where hit / dmg / crit would be written)
    prediction window
    windows.jpg
  5. Does anyone use the Dynamic Action for animated SideView Battle? I'm curious how to do special critical attack animations. here's the youtube.



    And here's the blog . It already has after image and SV Animated Battler for compatibility.

    Here's the list of plugins from the blog
    1702249548004.png
  6. xabileug said:
    Does anyone use the Dynamic Action for animated SideView Battle? I'm curious how to do special critical attack animations. here's the youtube.



    And here's the blog . It already has after image and SV Animated Battler for compatibility.

    Here's the list of plugins from the blog
    View attachment 287426

    Can you change the condition for the animation or motion used in the template?
    I haven't used it much but it might help
  7. The SRPG_Rescue and SRPG_UnitMapInfo has a incompatible. When a actor is rescued, the HP and states sprites don't disapear.
    It was expected considering they are made by different people, but I wanted to report it anyway.
  8. Hey! I had an idea for my game but can't seem to find a way to perform it. I read the documentation but maybe I missed something. I wanted to ask is there a way that, while in combat, make an event on the map that will force the actor to perform a skill? acting as an environmental hazard

    An example, there is a torch in the battlefield. I have a skill called "Ignite weapon" which boosts the damage of the weapon for some rounds and deals fire damage. How do I make it, so that in battle, I can interact with the torch and it will instantly use the skill, even if the actor doesn't have it.
  9. Regarding the compatibility problem between SRPG_UnitMapInfo and SRPG_Rescue, I managed to temporarily overcome the problem.

    First, I added it to SRPG_UnitMapInfo with the following code:​
    CODE
    JavaScript:
    //-----------------------------------------------------------------------------
        // Show the infos only if the specific states has off - Edited by Adra
        //
    
        Sprite_Character.prototype.shouldShowHPGauge = function() {
            var statesToHideGauge = [87]; // Add the state IDs that should hide the HP gauge
            var battlerArray = $gameSystem.EventToUnit(this._character.eventId());
            if (battlerArray && battlerArray[1]) {
                var battler = battlerArray[1];
                // Check if any of the states hiding the gauge are applied
                for (var i = 0; i < statesToHideGauge.length; i++) {
                    if (battler.isStateAffected(statesToHideGauge[i])) {
                        return false; // Don't show HP gauge if any hiding state is applied
                    }
                }
            }
            return true; // Show HP gauge when none of the hiding states are applied
        };

    Then, I edited the updateCharacterFrame of SRPG_UnitMapInfo and added the function below:

    CODE
    JavaScript:
    var _SRPG_Sprite_Character_updateCharacterFrame = Sprite_Character.prototype.updateCharacterFrame;
        Sprite_Character.prototype.updateCharacterFrame = function() {
            _SRPG_Sprite_Character_updateCharacterFrame.call(this);
            if ($gameSystem.isSRPGMode() == true && this._character.isEvent() == true) {
                var battlerArray = $gameSystem.EventToUnit(this._character.eventId());
                if (battlerArray) {
                    // create State Icon
                    //  add debug Switch Setup
                    if (useStateIconUnit && (_debugSwitch = true) && this.shouldShowHPGauge()) this.createStateIconSprite(); // add this.shouldShowHPGauge() EDITED BY ADRA
                    // create HP number for HP
                    if (usehpNumUnit) this.createhpNumberSprite();
                    // create HP gauge
                    if (usehpGaugeUnit && this.shouldShowHPGauge()) this.createhpGaugeSprite(); // add this.shouldShowHPGauge() EDITED BY ADRA
                    // create Weapon Icon
                    //  add debug Switch Setup
                    if (useWeaponIconUnit && (_debugSwitch = true)) {
                        this.createAttIcon();
                        // all battlers getting their attIcon displayed
                         if (this._AttIcon && this._AttIcon._battler) {
                            var pw = this._AttIcon._pw;
                            var ph = this._AttIcon._ph;
                            var sx = this._AttIcon._sx;
                            var sy = this._AttIcon._sy;
                            // install bitmap
                            this._AttIcon.bitmap = this.AttIconBitmap;
                            // install Sprite data
                            this._AttIcon.setFrame(sx, sy, pw, ph);
                            if (!this._AttIcon._battler.isDead()) {
                                // make sprite visible
                                 this._AttIcon.visible = true;
                            } else { // make sprite non visible if Unit is Dead
                                 if (this._AttIcon.visible === true) {this._AttIcon.visible = false};
                            }
                         }
                    }
                }
            }
        };

    Note that I only included it for the HP and status bar, as I don't use the rest of the information in my game.

    Therefore, if a character is affected by status 87, it will not show the information. This status is applied the moment the character is rescued. Unfortunately the "rescue state id" of SRPG_Rescue didn't work, so I had to do it manually through the common event below that is executed in AfterAction:
    IMAGE
    RPGMV_FkIU6eNZJs.png

    The conditional I used in the common event is $gameSystem.EventToUnit($gameActors.actor(ActorId).event().eventId())[1].rescuedBattler()._actorId === X. It pulls the actorId of the character that was rescued. It is important to check that the ActorId must be of the character rescuing and the "X" of the rescued person. There must be a way to automate this, but I couldn't think of anything.

    For the information to be hidden after rescuing, you need to run SceneManager.push(Scene_Map) to update the information on the map, otherwise it will still remain. Unfortunately, this command creates a fade-out that I couldn't remove, but it's a detail I can ignore.

    After all these changes, it still remains to hide the "E" sprite when a character ends their turn. To do this, I added this conditional to SRPG_core in updateCharacterFrame:
    CODE
    JavaScript:
    //dopan edit info Default=> 'false'
                            if (_srpgEXA ==='false') {
                                this._turnEndSprite.bitmap = this._turnEndBitmap;
                            } else {this._turnEndSprite.bitmap = ImageManager.loadCharacter('$srpg_set_E')};
                            this._turnEndSprite.visible = true;
                            //adra edit -  hidde when the actor has rescued
                            if (battlerArray[1].isStateAffected(87)) {
                                if (this._turnEndSprite) {
                                    this._turnEndSprite.visible = false;
                                }
                            }
                            this._turnEndSprite.setFrame(sx, sy, pw, ph);

    If you have a simpler way to resolve the incompatibility or fade-out, please share.
  10. adramalesh159753 said:
    The SRPG_Rescue and SRPG_UnitMapInfo has a incompatible. When a actor is rescued, the HP and states sprites don't disapear.
    It was expected considering they are made by different people, but I wanted to report it anyway.
    I will try to check on it. It must be on the update character sprite section
  11. When an actor is in certain positions on the screen in the default ActorCommandStatusWindow setting, the character would be under the window.

    So I added a small change to SRPG_core that fixes this problem and changes the position of the window if the character is under it.

    I inserted this code right below the Scene_Map.prototype.createSrpgActorCommandStatusWindow function:

    CODE
    JavaScript:
    //EDITED BY ADRA
    
    Scene_Map.prototype.adjustActorCommandStatusWindowPosition = function() {
            var activeEvent = $gameTemp.activeEvent();
            if (activeEvent) {
                const eventScreenY = activeEvent.screenY(); //check the screen position of active actor
                
                // Check if the event position would be under de window
                if (eventScreenY >= 522) { // change the 522 value depending on game resolution
                    // Update the window position
                    this._mapSrpgActorCommandStatusWindow.x = 15;
                    this._mapSrpgActorCommandStatusWindow.y = 0;
                } else { //insert here the default status window of your game
                    this._mapSrpgActorCommandStatusWindow.x = Graphics.boxWidth / 4;//120;
                    this._mapSrpgActorCommandStatusWindow.y = Graphics.boxHeight - this._mapSrpgActorCommandStatusWindow.windowHeight();
                }       
            }
        };


    Then, I called the new function in the code below:

    CODE
    JavaScript:
    //行動アクターの簡易ステータスウィンドウの開閉
            var flag = $gameSystem.srpgActorCommandStatusWindowNeedRefresh();
            if (!flag) {
                flag = [false, null];
            }
            if (flag[0]) {
                if (!this._mapSrpgActorCommandStatusWindow.isOpen() && !this._mapSrpgActorCommandStatusWindow.isOpening()) {
                    this._mapSrpgActorCommandStatusWindow.setBattler(flag[1][1]);
                }
                //EDITED BY ADRA
                // Adjust window position when refresh is needed
                this.adjustActorCommandStatusWindowPosition();
            } else {
                if (this._mapSrpgActorCommandStatusWindow.isOpen() && !this._mapSrpgActorCommandStatusWindow.isClosing()) {
                    this._mapSrpgActorCommandStatusWindow.clearBattler();
                }
            }


    The result looks like this:


  12. How do you delete/add a state to an actor/enemy and have them not considered a battler anymore (similar to how it skips their action when the actor is knocked out, but I want to do this without using the knockout state)?

    I'm trying to create an escape interaction. I'm using a common event and the Advanced Interactions plugin to have the actor that used it remove itself from battle upon using an advanced interaction.

    I've been scouring the thread but haven't been able to find a solution that works for me so far.

    When I use Erase Event alone, the game still automatically moves the cursor to the erased character's space when the turn begins and requires them to act even when everyone else has, effectively soft locking.

    When I add the command $gameSystem._srpgAllActors.splice($gameSystem._srpgAllActors.indexOf([Actor's ID]), 1); It correctly removes them from the list of all actors, but continues to act incorrectly in the described way.

    When I add the command $gameSystem._EventToUnit([Actor's ID]) = null or otherwise make that actor's index empty, I get this runtime error due to the Advanced Interaction and various other plugins needing that value to perform AfterAction functions:

    1703959917077.png

    Any help is appreciated! I really would like this function to work since escaping battles in this way is an important feature of my game.

    Edit: I've added an "Escaped" state, with the restriction "cannot move" which is added when they use the interaction. This fixes the softlock, but unfortunately does not fix the issue with the cursor automatically moving to their last position.
  13. Has anyone made a transform skill for the current version? i wanted a transform command option to appear when the TP is 100. And I cant get the character sprite to change in the map.

    from Doktor Q post
    Code:
    target.event().setImage('newCharacterImageFilename', index);

    in SRPG Gear MV 1.11+ there's this tag

    <srpgActorCommandOriginalId:47>
    I want a new tag
    <srpgActorCommandUltimaId:n>
    that appears when the TP is 100, like ultimate attack. can anyone help on this?


    So i successfully added the Ultima Command like in FFTA, there where several lines, basically replicate all the codes with the srpgActorCommandOriginalId CTRL+F on SRPG Core. Don't forget to add the notetags on the actor's note, the custom command list order, and the ultima skill ID
    1704258169626.png
    EDIT SRPG Core
    1. the params at the beginning, there are 2 of this for EN and JP
    Code:
     * @param srpgActorCommandUltimaId
     * @parent srpgActorCommandList
     * @desc actor command 'ultima' execute specified skill. The ID of that skill.
     * @type skill
     * @default 1

    2. the variable
    Code:
        var _srpgActorCommandUltimaId = Number(parameters['srpgActorCommandUltimaId'] || 1); // ultima

    3. var _SRPG_Window_ActorCommand_makeCommandList
    Code:
                        // ultima command   
                        case 'ultima':
                            this.addUltimaCommand();
                            break;
    4. adding the function addUltimaCommand, so the command will only be added when the Actor TP is 100
    Code:
        // ultima command
        Window_ActorCommand.prototype.addUltimaCommand = function() {
            if (this._actor.actor().meta.srpgActorCommandUltimaId) {
                var skill = $dataSkills[Number(this._actor.actor().meta.srpgActorCommandUltimaId)];
            } else {
                var skill = $dataSkills[_srpgActorCommandUltimaId];
            }
            if (skill && this._actor.tp === 100) {
                this.addCommand(skill.name, 'ultima', this._actor.canUse(skill));
            }
        };
    5. Scene_Map.prototype.createSrpgActorCommandWindow, make the command useable
    Code:
            this._mapSrpgActorCommandWindow.setHandler('ultima',  this.commandUltima.bind(this)); // ultima
    6. Scene_Map.prototype.commandUltima, create the functiob commandUltima
    Code:
    Scene_Map.prototype.commandUltima = function() {
            var actor = $gameSystem.EventToUnit($gameTemp.activeEvent().eventId())[1];
            if (actor.actor().meta.srpgActorCommandUltimaId) {
                actor.action(0).setSkill(Number(actor.actor().meta.srpgActorCommandUltimaId));
            } else {
                actor.action(0).setSkill(_srpgActorCommandUltimaId);
            }
            this._deadActorWindow.setBack('null');
            this.startActorTargetting();
        };
  14. When I try to use the call gainExp script, the exp is not added to the actor.

    I found it strange, because using $gameSystem.EventToUnit(eventID)[1].gainHp(number) and derivatives works, but the specific exp doesn't work.

    I know I can use an event command, but I need it to be via scriptcall.

    It's not a problem in my project, I tried using the available demos and none of them work.

    Edit:
    For example, in the code below, I create a new phase after the after action, however, only the actor who ended the after action and started this new phase gains the exp even though the code checks all events and adds the experience for all actors on the map.

    CODE
    JavaScript:
    Game_System.prototype.srpgStartVictoryPhase = function() {
            this.setBattlePhase('victory_phase');
            $gameSystem.setSubBattlePhase('normal');
            for (var i = 1; i <= $gameMap.events().length; i++) {
                var battleunit = $gameSystem.EventToUnit([i]);
                var eventunit = $gameMap.event([i]);
                if (battleunit && eventunit && battleunit[0] === 'actor') {
                    ImageManager.loadFace(battleunit[1].faceName());
                    battleunit[1]._preVictoryExp = battleunit[1].currentExp();
                    battleunit[1]._preVictoryLv = battleunit[1]._level;
                    battleunit[1]._victorySkills = [];
                    var exp = vaExpReward;
                    battleunit[1].gainExp(exp);
                    battleunit[1]._expGained = battleunit[1].currentExp() - battleunit[1]._preVictoryExp;
                    battleunit[1]._postVictoryLv = battleunit[1]._level;
                }
            };
            SceneManager.push(Scene_VictoryBattle);   
        };
  15. I was looking in the thread to see how to disable auto battle and only found 1 response but what I want is to disable it completely from as an option from the menu. Is there a way to remove it?
  16. adramalesh159753 said:
    battleunit[1].gainExp(exp);
    Insert a console.log(battleunit[1]._exp) before and after this line and see if exp does change
    If it does then probably something wrong with Scene_Victory
    If it doesn't then something wrong with gainExp function (or maybe try changeExp)
    lcj271 said:
    I was looking in the thread to see how to disable auto battle and only found 1 response but what I want is to disable it completely from as an option from the menu. Is there a way to remove it?
    Code:
        var _SRPG_Window_MenuCommand_makeCommandList = Window_MenuCommand.prototype.makeCommandList;
        Window_MenuCommand.prototype.makeCommandList = function() {
            if ($gameSystem.isSRPGMode() == true) {
                this.addTurnEndCommand();
                if (_srpgAutoBattleStateId > 0) this.addAutoBattleCommand();
                if (_srpgWinLoseConditionCommand == 'true') this.addWinLoseConditionCommand();
            }
            _SRPG_Window_MenuCommand_makeCommandList.call(this);
        };

    Remove the this.addAutoBattleCommand() for no auto battle
    If you want it to be available sometimes, add a conditional like $gameSwitches.value(3) == true
  17. Hey guys, not so long time lurker here.

    I don't know how to write anything in java, but I saw someone mention this earlier in the thread and I don't know if it was every brought up again, but I want to mix this plugin with MV3D, and I actually managed to get it working. Combat works fine and everything, the only problem is that it doesn't display ranges.

    3DMV2.PNG

    Here's me selecting Harold, and you can see it works fine.

    3DMV1.PNG

    However once MV3D is enabled, the range doesn't show up, even when I select Harold. The selector appears fine because it's an actor, but since the range is displayed on the screen instead of the actual ground itself, it doesn't show up. Ideally, it should look something like this:

    3DMV3.PNG

    I thought of a solution, but since I don't know how to code anything myself, so I came here looking for help. By changing the actual tile on the map itself, it could display the range just fine, and it could even be modified by MV3D using notes.

    I know that MV3D is complicated, but I don't think that this would require any messing around with the MV3D script, only with SRPG ones. Could anyone help me with this? Or at least point me in the right direction?

    Sorry if my English is bad, it's not my first language.
  18. NesliK said:
    it doesn't display ranges
    Movement range is saved in $gameTemp._MoveTable
    So $gameTemp._MoveTable[3][4] = -1 means that at coordinates (3,4), the active event cannot move to that tile. This array stores the blue movement tiles.
    There is also $gameTemp._RangeMoveTable and $gameTemp._RangeTable which deals with attack ranges. AoE adds its own tables too for AoE ranges
    So basically if you want to show display movement ranges, you need to:
    1. check when to show them ($gameSystem.isSubBattlePhase() == "actor_move" for example)
    2. turn the tiles to whatever colour you want

    SRPG turns tiles into colours by drawing a basic bitmap (Sprite_SrpgMoveTile) over them and filling the bitmap with a colour.
    Unfortunately, the 3DMV plugin is paid so don't expect anyone to provide any help
  19. boomy said:
    Insert a console.log(battleunit[1]._exp) before and after this line and see if exp does change
    If it does then probably something wrong with Scene_Victory
    If it doesn't then something wrong with gainExp function (or maybe try changeExp)
    It worked! I just needed to make a few adjustments.

    I'm trying to insert a level up window if the actor increases the level after Window_SrpgBattleResult closes, however, I couldn't find in SRPG_core at which point I could call this window.

    By the way, in this window I have to save the actor's information before and after gaining experience. I don't know if I understand correctly, but in map battle mode, the SRPG_core just adapt the BattleManager functions to be executed in the SceneMap like in the code below?

    JavaScript:
    // use all the existing code for rewards, so it can inherit plugin modifications
        Scene_Map.prototype.makeRewards = BattleManager.makeRewards;
        Scene_Map.prototype.gainRewards = BattleManager.gainRewards;
        Scene_Map.prototype.gainExp = BattleManager.gainExp;
        Scene_Map.prototype.gainGold = BattleManager.gainGold;
        Scene_Map.prototype.gainDropItems = BattleManager.gainDropItems;
  20. boomy said:
    SRPG turns tiles into colours by drawing a basic bitmap (Sprite_SrpgMoveTile) over them and filling the bitmap with a colour.
    Unfortunately, the 3DMV plugin is paid so don't expect anyone to provide any help

    This is already a great help, thank you! I will see if I can throw something together myself, and if I do get it working I'll post it here anyone can use it.