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

● ARCHIVED · READ-ONLY
Started by RyanBram 3313 posts Page 151 of 166 View original ↗
  1. no no, i want GET the ID of actor and enemy of who enter in battle, i dont need the ID of the charaters in map, because i want make a custom battle popup, but for get the sprites of the actor, and enemy in need the ID, here a example

    1699388905537.png
  2. Does anyone know how to disable the hud that srpg added in when doing side battles, the character portratis/health/mana/tp etc? I tried using SRD hud and it doesn't work and the new hud overwrites my custom one. Any help is appreciated.
  3. Edit: Probably not the best way to do it, but open the SRPG_core and go to line 4067

    return Graphics.boxWidth / 2

    Change the 2 -> 0.01

    then right below it line 4071 change

    return this.fittingHeight(4)

    Change the 4 -> 0

    Now you won't see it in battle but all the functions still work. Someone probably has a better way but after 3 hours of searching this thread, it's the best i have found.
  4. Anyone know any plugins that allow you to use duplicate actors or control events using enemy ids?
  5. DevouringTheHeartOfGod_1 said:
    Anyone know any plugins that allow you to use duplicate actors or control events using enemy ids?
    i think it's already in the demo, check the first map -> Summoning Map
  6. xabileug said:
    i think it's already in the demo, check the first map -> Summoning Map
    Oh ok, thank you!
  7. Wondering if this is possible with the AIControl Plugin or if I should find a workaround for it. I want to make it so that the enemy will summon minions only onto specific region ids4.PNG
    For example, here I want it to only use the summon skill on the region ID 1, and will not use the summon skill on region ID 3. So far, I've got this in the skill notetags:

    <aiTarget: $gameMap.regionId()==1>
    <cellTarget>
    <anyTarget>
    I've also tried it with $gamePlayer, but that doesnt work either
  8. DevouringTheHeartOfGod_1 said:
    Wondering if this is possible with the AIControl Plugin or if I should find a workaround for it. I want to make it so that the enemy will summon minions only onto specific region idsView attachment 284508
    For example, here I want it to only use the summon skill on the region ID 1, and will not use the summon skill on region ID 3. So far, I've got this in the skill notetags:

    <aiTarget: $gameMap.regionId()==1>
    <cellTarget>
    <anyTarget>
    I've also tried it with $gamePlayer, but that doesnt work either
    $gamePlayer makes it so that it uses the summon only when the player is on the region ID, but I want to make it so that it'll use it regardless of if the player is there
  9. Why does this error keep occurring? Even with him being accused, the script still works.
    Error
    game_HrEcePgwat.png
  10. adramalesh159753 said:
    Why does this error keep occurring? Even with him being accused, the script still works.
    Error
    View attachment 284808
    When that error spits out, type into console $gameSystem.EventToUnit($gameVariables.value(81)) and you will find that it comes up with undefined instead of ["actor", 4]
  11. Hi !

    I recently added YEP_Extra_patameter_formula and YEP_Hit_accuracy to m'y game because I wanted Hit Eva Mev and cri to be affected by actor and enemy stats.

    It works perfectly but somethibg disturb me. In the SRPG prediction window, hit is display. Sometime hit > 100% so I can have a 110% hit and it's kinda "weird" to display a 100%> hit rate.

    Exemple
    1700826781806.png
    In this exemple my unit as a 140% hit. I want to display a 100% hit without alter the "true value" of hit rate (this enemy is a tutorial enemy, I changed hit / eva to be sure that any unit will have a 100% hit rate against it)


    Is it possible to configure the prediction window like : if hit<100 display hit valor in prédiction window if hit>= 100 display 100 in the prédiction window ?

    Also speacking of the prédiction Windows. I wanted to know if it's possible to show crit rate in it and if it's possible to put an icone next to damage when unit make an agi Attack (in fire Emblem games a "x2" is display next to damage in the window to day "this character Will attack twice". Just a visual thing to know directly if unit make an agi Attack instead of mentaly calculate diff between unit agi and enemy's agi)

    Illustration
    1.jpg
    Here, there is an "x2" icon to show "this unit will attack twice".
    Second line is hit rate.
    Third line is the crit rate.

    In my game it could do something like that

    1700827420892.png
  12. I will be leaving this plugin here if you want this effect :
    1700876466650.png

    SRPG_UnitMapInfo
    JavaScript:
    // =============================================================================
    // SRPG_UnitMapInfo.js
    // Version: 1.05 (dopan patch)
    // -----------------------------------------------------------------------------
    // Copyright (c) 2021
    // Released under the MIT license
    // http://opensource.org/licenses/mit-license.php
    // -----------------------------------------------------------------------------
    // [Homepage]: xabileug
    //             https://twitter.com/xabileug
    // =============================================================================
    
    
    /*:
     * @plugindesc v1.05 SRPG UnitMapInfo
     * @author xabileug
     *
     * @param Show HP Gauge
     * @desc Show HP Gauge on unit?
     * (true/false)
     * @type boolean
     * @default true
     *
     * @param Show HP Number
     * @desc Show HP Number on unit?
     * (true/false)
     * @type boolean
     * @default true
     *
     * @param Show Weapon Icon
     * @desc Show Weapon Icon on unit?
     * (true/false)
     * @type boolean
     * @default true
     *
     * @param Show State Icon
     * @desc Show State Icon on unit?
     * (true/false)
     * @type boolean
     * @default true
     *
     *
     * @param Gauge Width
     * @desc Default width of the gauges
     * @type number
     * @default 32
     *
     * @param Gauge Height
     * @desc Default height of the gauges
     * @type number
     * @default 5
     *
     * @param Gauge Fill
     * @desc Default fill height of the gauges
     * @type number
     * @default 3
     *
     * @param Gauge Outline
     * @desc Hex color.
     * @default #000000
     *
     * @param Actor hpFull Color
     * @desc Hex color.
     * @default #4be1fe
     *
     * @param Enemy hpFull Color
     * @desc Hex color.
     * @default #fe4b69
     *
     * @param Actor HPCurr Color
     * @desc Hex color.
     * @default #1b55c6
     *
     * @param Enemy HPCurr Color
     * @desc Hex color.
     * @default #d02442
     *
     * @param Actor HP Color
     * @desc Hex color.
     * @default #4be1fe
     *
     * @param Enemy HP Color
     * @desc Hex color.
     * @default #fe4b69
     *
     * @param HP Color
     * @desc Hex color.
     * @default #000000
     *
     * @param HP Outline
     * @desc Hex color.
     * @default #ffffff
     *
     * @param Font Size
     * @desc Default width of the gauges
     * @type number
     * @default 14
     *
     * @param HP Gauge Pos X
     * @desc Position X of HP Gauge
     * @type number
     * @max 100
     * @min -100
     * @default 0
     *
     * @param HP Gauge Pos Y
     * @desc Position Y of HP Gauge
     * @type number
     * @max 100
     * @min -100
     * @default 0
     *
     * @param HP Number Pos X
     * @desc Position X of HP Gauge
     * @type number
     * @max 100
     * @min -100
     * @default -42
     *
     * @param HP Number Pos Y
     * @desc Position Y of HP Gauge
     * @type number
     * @max 100
     * @min -100
     * @default 0
     *
     * @param State Icon Pos X
     * @desc position X of stateIcon
     * @type number
     * @max 100
     * @min -100
     * @default 0
     *
     * @param State Icon Pos Y
     * @desc position Y of stateIcon
     * @type number
     * @max 100
     * @min -100
     * @default -42
     *
     *
     * @param Att Icon Pos X
     * @desc position X of attIcon
     * @type number
     * @max 100
     * @min -100
     * @default -26
     *
     * @param Att Icon Pos Y
     * @desc position Y of attIcon
     * @type number
     * @max 100
     * @min -100
     * @default -32
     *
     *
     * @help
     *
     * 1.01 show unit HP bar, different color at 100%, below 100%
     *
     * 1.02 show unit HP value
     *
     * 1.03
     * show unit state icon : require YEP_AutoPassiveStates
     *
     * 1.03a improved hp guage color customization
     *
     * 1.04 debug compatiblety patch and addedweapon icon. by dopan
     *
     * 1.04a bush depth support
     *
     * 1.05 fixed when Game Party is less than unit events
     *
     * reference : ebinote SRPG_DispHPOnMap
     *             TM_SRPG updatehpGauge updatestateicon
     *             Fire Emblem Heroes
    */
    
    (function() {
    
        var parameters = PluginManager.parameters('SRPG_UnitMapInfo');
        var usehpNumUnit = (parameters['Show HP Number'] || "true") === "true";
        var usehpGaugeUnit = (parameters['Show HP Gauge'] || "true") === "true";
        var useStateIconUnit = (parameters['Show State Icon'] || "true") === "true";
        var useWeaponIconUnit = (parameters['Show Weapon Icon'] || "true") === "true";
        var hpGaugeWidth = Number(parameters['Gauge Width'] || 32);  // Sprite Character size 32 x 32 px
        var hpGaugeHeight = Number(parameters['Gauge Height'] || 5);
        var hpGaugeFill = Number(parameters['Gauge Fill'] || 3);
        var hpGaugeColor1 = parameters['Actor hpFull Color'] || "#4be1fe";
        var hpGaugeColor2 = parameters['Enemy hpFull Color'] || "#fe4b69";
        var hpGaugeColor3 = parameters['Actor HPCurr Color'] || "#1b55c6";
        var hpGaugeColor4 = parameters['Enemy HPCurr Color'] || "#d02442";
        var hpGaugeOutline = parameters['Gauge Outline'] || "#ccd1cd";
        var hpNumColor1 = parameters['Actor HP Color'] || "#4be1fe";
        var hpNumColor2 = parameters['Enemy HP Color'] || "#fe4b69";
        var hpNumtextColor = parameters['HP Color'] || "#000000";
        var hpOutlineColor = parameters['HP Outline'] || "#ffffff";
        var hpFontSize = Number(parameters['Font Size'] || 14);
        var hpOutline = Number(parameters['Outline'] || 3);
        var hpGaugePosX = Number(parameters['HP Gauge Pos X'] || 0);
        var hpGaugePosY = Number(parameters['HP Gauge Pos Y'] || 0);
        var hpNumPosX = Number(parameters['HP Number Pos X'] || -42);
        var hpNumPosY = Number(parameters['HP Number Pos Y'] || 0);
        var stateIconPosX = Number(parameters['State Icon Pos X'] || 0);
        var stateIconPosY = Number(parameters['State Icon Pos Y'] || -42);
        var attIconPosX = Number(parameters['Att Icon Pos X'] || -26);
        var attIconPosY = Number(parameters['Att Icon Pos Y'] || -32);
    
        var _debugSwitch = true;
    //---------------------------------------------------------------------------------
    // dopan_debug for "enemyEquip plugin" & Yep BuffStatesCore
    
        // check used SkillAction_itemObeject for meta"srpgSteal"
        // add debug Switch Setup
        var SRPG_Game_Action_apply = Game_Action.prototype.apply;
        Game_Action.prototype.apply = function(target) {
            SRPG_Game_Action_apply.call(this, target);
            if ($gameSystem.isSRPGMode() == true) {
                // add stuff to Game action if Break/Steal Meta & Hit
                 var result = target.result();
                 if ((this.item().meta.srpgSteal && result.isHit()) ||
                     (this.item().meta.srpgBreak && result.isHit())) {
                 _debugSwitch = false;
                 }
                 if (this.item().meta.actorStealItem && result.isHit()) {
                     _debugSwitch = false;
                 }
            }
        };
    
        // add stuff to eventAfterAction_scene
        //  add debug Switch Setup
        var _srpgAfterActionScene = Scene_Map.prototype.srpgAfterAction;
        Scene_Map.prototype.srpgAfterAction = function() {
         _srpgAfterActionScene.call(this);
    
             // switch is used to prevent conflict with state icon updates of other plugins
             if (_debugSwitch === false) {this.setSkillWait(30);_debugSwitch = true};
        };
    
        // override error causing function from Yep BuffstatesCore to not trigger if steal action happens
        // this YEP function is supposses to happen in "status" window scene ,
        // so this should be no problem if its disabled in battleaction
        Sprite_StateIcon.prototype.textColor = function(n) {
              if (SceneManager._scene._statusWindow && _debugSwitch === true) {
                  return SceneManager._scene._statusWindow.textColor(n);
              }
    };
    
    //=============================================================================
    // Sprite_Character
    //=============================================================================
    
    //-----------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------
    // Sprite_Character create AttackIcon
    
    
        // load attIcon Bitmap
        var _IconLoad_Character_setCharacterBitmap = Sprite_Character.prototype.setCharacterBitmap;
        Sprite_Character.prototype.setCharacterBitmap = function() {
              _IconLoad_Character_setCharacterBitmap.call(this);
              this.AttIconBitmap = ImageManager.loadSystem('IconSet');
        };
        
        Sprite_Character.prototype.getIconIndex = function() {
          //get data 
          var battler = $gameSystem.EventToUnit(this._character.eventId());
          var iconID = 0; // <-this is used to check if an weapon and related icon is not there
          // check if a weapon is equiped
          if (battler[1] && !battler[1].hasNoWeapons()) {
              if (battler[0] === 'actor') {
                  iconID = battler[1].weapons()[0].iconIndex;  // actor
                  }
              // checks if the "enemyEquip" plugin is used,
              // or if the "core weapon meta" is used ..
                  if (battler[0] === 'enemy') {
                      if (battler[1].enemy().meta.srpgWeapon) {   
                  var coreMeta = $dataWeapons[Number(battler[1].enemy().meta.srpgWeapon)];
                  iconID = coreMeta.iconIndex; // enemy
                  } else {iconID = battler[1].weapons()[0].iconIndex}; 
              }   
          }
        return iconID
        };
    
        // create AttackIcon   
        Sprite_Character.prototype.createAttIcon = function() {
          //get data 
          var battler = $gameSystem.EventToUnit(this._character.eventId());
              var iconIndex = this.getIconIndex();
          // add "this._AttIcon" + get Sprite data if "iconIndex is > 0"
              //"iconIndex is === 0" would mean "noWeapon equiped,so no iconIndex added"
              if (!this._AttIcon && (iconIndex > 0)) {
                  // add sprite
                  this._AttIcon = new Sprite();
                  // add all data
                  this._AttIcon._pw = 32;
                  this._AttIcon._ph = 32;
                  this._AttIcon._sx = iconIndex % 16 * 32;
                  this._AttIcon._sy = Math.floor(iconIndex / 16) * 32;
                  this._AttIcon._battler = battler[1];
                  this._AttIcon.x = attIconPosX;
                  this._AttIcon.y = attIconPosY;
                  this._AttIcon.z = 9;
                  this._AttIcon.anchor.x = 0.5;
                  this._AttIcon.anchor.y = 0.5;
                  this._AttIcon.scale.x = 0.5;
                  this._AttIcon.scale.y = 0.5;
                  // add child
                  this.addChild(this._AttIcon);
              }
        };
        
    // Sprite_Character updateCharacterFrame
        
        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.createStateIconSprite();
                    // create HP number for HP
                    if (usehpNumUnit) this.createhpNumberSprite();
                    // create HP gauge
                    if (usehpGaugeUnit) this.createhpGaugeSprite();
                    // 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};
                            }
                         }
                    }
                }
            }
        };
    
        // show HPGauge and StateIcon above bush depth
        var _Sprite_Character_createHalfBodySprites = Sprite_Character.prototype.createHalfBodySprites;
        Sprite_Character.prototype.createHalfBodySprites = function() {
            var flag = !this._upperBody;
            _Sprite_Character_createHalfBodySprites.call(this);
            if (flag) {
                if (this._hpGaugeSprite) this.addChild(this.removeChild(this._hpGaugeSprite));
                if (this._StateIconSprite) this.addChild(this.removeChild(this._StateIconSprite));
            }
        };
    
        //sprite Char create hpGaugeSprite
        Sprite_Character.prototype.createhpGaugeSprite = function() {
            if (!this._hpGaugeSprite) {
                this._hpGaugeSprite = new Sprite_hpGaugeSprite();
                var battler = $gameSystem.EventToUnit(this._character.eventId())[1];
                this._hpGaugeSprite.setBattler(battler);
                this.addChild(this._hpGaugeSprite);
            }
        };
    
        //sprite Char create hpNumberSprite
        Sprite_Character.prototype.createhpNumberSprite = function() {
            if (!this._hpNumberSprite) {
                this._hpNumberSprite = new Sprite_hpNumberSprite();
                var battler = $gameSystem.EventToUnit(this._character.eventId())[1];
                this._hpNumberSprite.setBattler(battler);
                this.addChild(this._hpNumberSprite);
            }
        };
    
    //sprite Char create StateIconSprite
        Sprite_Character.prototype.createStateIconSprite = function() {
            if (!this._StateIconSprite) {
                this._StateIconSprite = new Sprite_StateIcon();
                var battler = $gameSystem.EventToUnit(this._character.eventId())[1];
                this._StateIconSprite.setup(battler);
                this._StateIconSprite.x = stateIconPosX;
                this._StateIconSprite.y = stateIconPosY;
                this._StateIconSprite.z = 9;
                this._StateIconSprite.anchor.x = 0.5;
                this._StateIconSprite.anchor.y = 0.5;
                this._StateIconSprite.scale.x = 0.5;
                this._StateIconSprite.scale.y = 0.5;
                this.addChild(this._StateIconSprite);
            }
        };
    
        //-----------------------------------------------------------------------------
        // Sprite_SrpghpGauge
        //
    
        function Sprite_hpGaugeSprite() {
            this.initialize.apply(this, arguments);
        }
    
        Sprite_hpGaugeSprite.prototype = Object.create(Sprite.prototype);
        Sprite_hpGaugeSprite.prototype.constructor = Sprite_hpGaugeSprite;
    
        Sprite_hpGaugeSprite.prototype.initialize = function(character) {
            Sprite.prototype.initialize.call(this);
            this.bitmap = new Bitmap(hpGaugeWidth, hpGaugeHeight); // HP bar width, and thickness
            this.z = 9;
            this.anchor.x = 0.5;
            this.anchor.y = 1;
            this.x = hpGaugePosX;
            this.y = hpGaugePosY;
        };
    
        Sprite_hpGaugeSprite.prototype.setBattler = function(battler) {
            if (this._battler === battler) return;
            this._battler = battler;
        };
    
        Sprite_hpGaugeSprite.prototype.update = function() {
            Sprite.prototype.update.call(this);
            if (this._battler !== null) {
                if (this._hp !== this._battler.hp || this._mhp !== this._battler.mhp) {
                    this._hp = this._battler.hp;
                    this._mhp = this._battler.mhp;
                    this.refresh();
                }
            }
        };
        // hpGauge color
        Sprite_hpGaugeSprite.prototype.refresh = function() {
            this.bitmap.clear();
            if (this._hp === 0) return;
            this.bitmap.fillRect(0, 0, hpGaugeWidth, hpGaugeHeight, hpGaugeOutline);
            var d = hpGaugeWidth - hpGaugeHeight + hpGaugeFill;
            var w = Math.floor(this._hp / this._mhp * d);
    /*
            if (!this._battler || this._battler.isActor()) {
                var hpcolor = hpNumColor1;  // actor
            } else {
                hpcolor = hpNumColor2; // enemy
            }*/
            var fill1 = 0;
            var fill2 = 0;
            if (!this._battler || this._battler.isActor()) {
                fill1 = hpGaugeColor1;//"#4be1fe";
                fill2 = hpGaugeColor3;//"#1b55c6";
                this.bitmap.fillRect(1, 1, w, hpGaugeFill, this._hp === this._mhp ? fill1 : fill2);
            } else {
                fill1 = hpGaugeColor2//"#fe4b69";
                fill2 = hpGaugeColor4//"#d02442";
                this.bitmap.fillRect(1, 1, w, hpGaugeFill, this._hp === this._mhp ? fill1 : fill2);
            }
        };
    
        //-----------------------------------------------------------------------------
        // Sprite_hpNumberSprite
        //
    
        function Sprite_hpNumberSprite() {
            this.initialize.apply(this, arguments);
        }
    
        Sprite_hpNumberSprite.prototype = Object.create(Sprite.prototype);
        Sprite_hpNumberSprite.prototype.constructor = Sprite_hpNumberSprite;
    
        Sprite_hpNumberSprite.prototype.initialize = function(character) {
            Sprite.prototype.initialize.call(this);
            this.bitmap = new Bitmap(32, 32);
            this.bitmap.fontSize = hpFontSize;
            this.bitmap.textColor = hpNumtextColor;
            this.bitmap.outlineWidth = hpOutline;
            this.bitmap.outlineColor = hpOutlineColor;
            this.anchor.x = 0.5;
            this.anchor.y = 0.5;
            this.x = hpNumPosX;
            this.y = hpNumPosY;
        };
    
        Sprite_hpNumberSprite.prototype.setBattler = function(battler) {
            if (this._battler === battler) return;
            this._battler = battler;
        };
    
        Sprite_hpNumberSprite.prototype.update = function() {
            Sprite.prototype.update.call(this);
            if (this._battler !== null) {
                if (this._newNumber !== this._battler.hp) {
                    this._newNumber = this._battler.hp;
                    this.refresh();
                }
            }
        };
    
        Sprite_hpNumberSprite.prototype.refresh = function() {
            this.bitmap.clear();
            if (this._newNumber === 0) return;
            var width = this.bitmap.width;
            var height = this.bitmap.height;
    
            // set color hp @ 100 #66ff66 and hp not 100 #fce205
            if (!this._battler || this._battler.isActor()) {
                var hpcolor = hpNumColor1;  // actor
            } else {
                hpcolor = hpNumColor2; // enemy
            }
            this.bitmap.textColor = hpcolor;
            this.bitmap.drawText(this._newNumber + '', 0, 0, width, height, 'right');
        };
    
    })();
  13. xabileug said:
    I will be leaving this plugin here if you want this effect :
    View attachment 285051

    SRPG_UnitMapInfo
    JavaScript:
    // =============================================================================
    // SRPG_UnitMapInfo.js
    // Version: 1.05 (dopan patch)
    // -----------------------------------------------------------------------------
    // Copyright (c) 2021
    // Released under the MIT license
    // http://opensource.org/licenses/mit-license.php
    // -----------------------------------------------------------------------------
    // [Homepage]: xabileug
    //             https://twitter.com/xabileug
    // =============================================================================
    
    
    /*:
     * @plugindesc v1.05 SRPG UnitMapInfo
     * @author xabileug
     *
     * @param Show HP Gauge
     * @desc Show HP Gauge on unit?
     * (true/false)
     * @type boolean
     * @default true
     *
     * @param Show HP Number
     * @desc Show HP Number on unit?
     * (true/false)
     * @type boolean
     * @default true
     *
     * @param Show Weapon Icon
     * @desc Show Weapon Icon on unit?
     * (true/false)
     * @type boolean
     * @default true
     *
     * @param Show State Icon
     * @desc Show State Icon on unit?
     * (true/false)
     * @type boolean
     * @default true
     *
     *
     * @param Gauge Width
     * @desc Default width of the gauges
     * @type number
     * @default 32
     *
     * @param Gauge Height
     * @desc Default height of the gauges
     * @type number
     * @default 5
     *
     * @param Gauge Fill
     * @desc Default fill height of the gauges
     * @type number
     * @default 3
     *
     * @param Gauge Outline
     * @desc Hex color.
     * @default #000000
     *
     * @param Actor hpFull Color
     * @desc Hex color.
     * @default #4be1fe
     *
     * @param Enemy hpFull Color
     * @desc Hex color.
     * @default #fe4b69
     *
     * @param Actor HPCurr Color
     * @desc Hex color.
     * @default #1b55c6
     *
     * @param Enemy HPCurr Color
     * @desc Hex color.
     * @default #d02442
     *
     * @param Actor HP Color
     * @desc Hex color.
     * @default #4be1fe
     *
     * @param Enemy HP Color
     * @desc Hex color.
     * @default #fe4b69
     *
     * @param HP Color
     * @desc Hex color.
     * @default #000000
     *
     * @param HP Outline
     * @desc Hex color.
     * @default #ffffff
     *
     * @param Font Size
     * @desc Default width of the gauges
     * @type number
     * @default 14
     *
     * @param HP Gauge Pos X
     * @desc Position X of HP Gauge
     * @type number
     * @max 100
     * @min -100
     * @default 0
     *
     * @param HP Gauge Pos Y
     * @desc Position Y of HP Gauge
     * @type number
     * @max 100
     * @min -100
     * @default 0
     *
     * @param HP Number Pos X
     * @desc Position X of HP Gauge
     * @type number
     * @max 100
     * @min -100
     * @default -42
     *
     * @param HP Number Pos Y
     * @desc Position Y of HP Gauge
     * @type number
     * @max 100
     * @min -100
     * @default 0
     *
     * @param State Icon Pos X
     * @desc position X of stateIcon
     * @type number
     * @max 100
     * @min -100
     * @default 0
     *
     * @param State Icon Pos Y
     * @desc position Y of stateIcon
     * @type number
     * @max 100
     * @min -100
     * @default -42
     *
     *
     * @param Att Icon Pos X
     * @desc position X of attIcon
     * @type number
     * @max 100
     * @min -100
     * @default -26
     *
     * @param Att Icon Pos Y
     * @desc position Y of attIcon
     * @type number
     * @max 100
     * @min -100
     * @default -32
     *
     *
     * @help
     *
     * 1.01 show unit HP bar, different color at 100%, below 100%
     *
     * 1.02 show unit HP value
     *
     * 1.03
     * show unit state icon : require YEP_AutoPassiveStates
     *
     * 1.03a improved hp guage color customization
     *
     * 1.04 debug compatiblety patch and addedweapon icon. by dopan
     *
     * 1.04a bush depth support
     *
     * 1.05 fixed when Game Party is less than unit events
     *
     * reference : ebinote SRPG_DispHPOnMap
     *             TM_SRPG updatehpGauge updatestateicon
     *             Fire Emblem Heroes
    */
    
    (function() {
    
        var parameters = PluginManager.parameters('SRPG_UnitMapInfo');
        var usehpNumUnit = (parameters['Show HP Number'] || "true") === "true";
        var usehpGaugeUnit = (parameters['Show HP Gauge'] || "true") === "true";
        var useStateIconUnit = (parameters['Show State Icon'] || "true") === "true";
        var useWeaponIconUnit = (parameters['Show Weapon Icon'] || "true") === "true";
        var hpGaugeWidth = Number(parameters['Gauge Width'] || 32);  // Sprite Character size 32 x 32 px
        var hpGaugeHeight = Number(parameters['Gauge Height'] || 5);
        var hpGaugeFill = Number(parameters['Gauge Fill'] || 3);
        var hpGaugeColor1 = parameters['Actor hpFull Color'] || "#4be1fe";
        var hpGaugeColor2 = parameters['Enemy hpFull Color'] || "#fe4b69";
        var hpGaugeColor3 = parameters['Actor HPCurr Color'] || "#1b55c6";
        var hpGaugeColor4 = parameters['Enemy HPCurr Color'] || "#d02442";
        var hpGaugeOutline = parameters['Gauge Outline'] || "#ccd1cd";
        var hpNumColor1 = parameters['Actor HP Color'] || "#4be1fe";
        var hpNumColor2 = parameters['Enemy HP Color'] || "#fe4b69";
        var hpNumtextColor = parameters['HP Color'] || "#000000";
        var hpOutlineColor = parameters['HP Outline'] || "#ffffff";
        var hpFontSize = Number(parameters['Font Size'] || 14);
        var hpOutline = Number(parameters['Outline'] || 3);
        var hpGaugePosX = Number(parameters['HP Gauge Pos X'] || 0);
        var hpGaugePosY = Number(parameters['HP Gauge Pos Y'] || 0);
        var hpNumPosX = Number(parameters['HP Number Pos X'] || -42);
        var hpNumPosY = Number(parameters['HP Number Pos Y'] || 0);
        var stateIconPosX = Number(parameters['State Icon Pos X'] || 0);
        var stateIconPosY = Number(parameters['State Icon Pos Y'] || -42);
        var attIconPosX = Number(parameters['Att Icon Pos X'] || -26);
        var attIconPosY = Number(parameters['Att Icon Pos Y'] || -32);
    
        var _debugSwitch = true;
    //---------------------------------------------------------------------------------
    // dopan_debug for "enemyEquip plugin" & Yep BuffStatesCore
    
        // check used SkillAction_itemObeject for meta"srpgSteal"
        // add debug Switch Setup
        var SRPG_Game_Action_apply = Game_Action.prototype.apply;
        Game_Action.prototype.apply = function(target) {
            SRPG_Game_Action_apply.call(this, target);
            if ($gameSystem.isSRPGMode() == true) {
                // add stuff to Game action if Break/Steal Meta & Hit
                 var result = target.result();
                 if ((this.item().meta.srpgSteal && result.isHit()) ||
                     (this.item().meta.srpgBreak && result.isHit())) {
                 _debugSwitch = false;
                 }
                 if (this.item().meta.actorStealItem && result.isHit()) {
                     _debugSwitch = false;
                 }
            }
        };
    
        // add stuff to eventAfterAction_scene
        //  add debug Switch Setup
        var _srpgAfterActionScene = Scene_Map.prototype.srpgAfterAction;
        Scene_Map.prototype.srpgAfterAction = function() {
         _srpgAfterActionScene.call(this);
    
             // switch is used to prevent conflict with state icon updates of other plugins
             if (_debugSwitch === false) {this.setSkillWait(30);_debugSwitch = true};
        };
    
        // override error causing function from Yep BuffstatesCore to not trigger if steal action happens
        // this YEP function is supposses to happen in "status" window scene ,
        // so this should be no problem if its disabled in battleaction
        Sprite_StateIcon.prototype.textColor = function(n) {
              if (SceneManager._scene._statusWindow && _debugSwitch === true) {
                  return SceneManager._scene._statusWindow.textColor(n);
              }
    };
    
    //=============================================================================
    // Sprite_Character
    //=============================================================================
    
    //-----------------------------------------------------------------------------------
    //-----------------------------------------------------------------------------------
    // Sprite_Character create AttackIcon
    
    
        // load attIcon Bitmap
        var _IconLoad_Character_setCharacterBitmap = Sprite_Character.prototype.setCharacterBitmap;
        Sprite_Character.prototype.setCharacterBitmap = function() {
              _IconLoad_Character_setCharacterBitmap.call(this);
              this.AttIconBitmap = ImageManager.loadSystem('IconSet');
        };
       
        Sprite_Character.prototype.getIconIndex = function() {
          //get data
          var battler = $gameSystem.EventToUnit(this._character.eventId());
          var iconID = 0; // <-this is used to check if an weapon and related icon is not there
          // check if a weapon is equiped
          if (battler[1] && !battler[1].hasNoWeapons()) {
              if (battler[0] === 'actor') {
                  iconID = battler[1].weapons()[0].iconIndex;  // actor
                  }
              // checks if the "enemyEquip" plugin is used,
              // or if the "core weapon meta" is used ..
                  if (battler[0] === 'enemy') {
                      if (battler[1].enemy().meta.srpgWeapon) {  
                  var coreMeta = $dataWeapons[Number(battler[1].enemy().meta.srpgWeapon)];
                  iconID = coreMeta.iconIndex; // enemy
                  } else {iconID = battler[1].weapons()[0].iconIndex};
              }  
          }
        return iconID
        };
    
        // create AttackIcon  
        Sprite_Character.prototype.createAttIcon = function() {
          //get data
          var battler = $gameSystem.EventToUnit(this._character.eventId());
              var iconIndex = this.getIconIndex();
          // add "this._AttIcon" + get Sprite data if "iconIndex is > 0"
              //"iconIndex is === 0" would mean "noWeapon equiped,so no iconIndex added"
              if (!this._AttIcon && (iconIndex > 0)) {
                  // add sprite
                  this._AttIcon = new Sprite();
                  // add all data
                  this._AttIcon._pw = 32;
                  this._AttIcon._ph = 32;
                  this._AttIcon._sx = iconIndex % 16 * 32;
                  this._AttIcon._sy = Math.floor(iconIndex / 16) * 32;
                  this._AttIcon._battler = battler[1];
                  this._AttIcon.x = attIconPosX;
                  this._AttIcon.y = attIconPosY;
                  this._AttIcon.z = 9;
                  this._AttIcon.anchor.x = 0.5;
                  this._AttIcon.anchor.y = 0.5;
                  this._AttIcon.scale.x = 0.5;
                  this._AttIcon.scale.y = 0.5;
                  // add child
                  this.addChild(this._AttIcon);
              }
        };
       
    // Sprite_Character updateCharacterFrame
       
        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.createStateIconSprite();
                    // create HP number for HP
                    if (usehpNumUnit) this.createhpNumberSprite();
                    // create HP gauge
                    if (usehpGaugeUnit) this.createhpGaugeSprite();
                    // 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};
                            }
                         }
                    }
                }
            }
        };
    
        // show HPGauge and StateIcon above bush depth
        var _Sprite_Character_createHalfBodySprites = Sprite_Character.prototype.createHalfBodySprites;
        Sprite_Character.prototype.createHalfBodySprites = function() {
            var flag = !this._upperBody;
            _Sprite_Character_createHalfBodySprites.call(this);
            if (flag) {
                if (this._hpGaugeSprite) this.addChild(this.removeChild(this._hpGaugeSprite));
                if (this._StateIconSprite) this.addChild(this.removeChild(this._StateIconSprite));
            }
        };
    
        //sprite Char create hpGaugeSprite
        Sprite_Character.prototype.createhpGaugeSprite = function() {
            if (!this._hpGaugeSprite) {
                this._hpGaugeSprite = new Sprite_hpGaugeSprite();
                var battler = $gameSystem.EventToUnit(this._character.eventId())[1];
                this._hpGaugeSprite.setBattler(battler);
                this.addChild(this._hpGaugeSprite);
            }
        };
    
        //sprite Char create hpNumberSprite
        Sprite_Character.prototype.createhpNumberSprite = function() {
            if (!this._hpNumberSprite) {
                this._hpNumberSprite = new Sprite_hpNumberSprite();
                var battler = $gameSystem.EventToUnit(this._character.eventId())[1];
                this._hpNumberSprite.setBattler(battler);
                this.addChild(this._hpNumberSprite);
            }
        };
    
    //sprite Char create StateIconSprite
        Sprite_Character.prototype.createStateIconSprite = function() {
            if (!this._StateIconSprite) {
                this._StateIconSprite = new Sprite_StateIcon();
                var battler = $gameSystem.EventToUnit(this._character.eventId())[1];
                this._StateIconSprite.setup(battler);
                this._StateIconSprite.x = stateIconPosX;
                this._StateIconSprite.y = stateIconPosY;
                this._StateIconSprite.z = 9;
                this._StateIconSprite.anchor.x = 0.5;
                this._StateIconSprite.anchor.y = 0.5;
                this._StateIconSprite.scale.x = 0.5;
                this._StateIconSprite.scale.y = 0.5;
                this.addChild(this._StateIconSprite);
            }
        };
    
        //-----------------------------------------------------------------------------
        // Sprite_SrpghpGauge
        //
    
        function Sprite_hpGaugeSprite() {
            this.initialize.apply(this, arguments);
        }
    
        Sprite_hpGaugeSprite.prototype = Object.create(Sprite.prototype);
        Sprite_hpGaugeSprite.prototype.constructor = Sprite_hpGaugeSprite;
    
        Sprite_hpGaugeSprite.prototype.initialize = function(character) {
            Sprite.prototype.initialize.call(this);
            this.bitmap = new Bitmap(hpGaugeWidth, hpGaugeHeight); // HP bar width, and thickness
            this.z = 9;
            this.anchor.x = 0.5;
            this.anchor.y = 1;
            this.x = hpGaugePosX;
            this.y = hpGaugePosY;
        };
    
        Sprite_hpGaugeSprite.prototype.setBattler = function(battler) {
            if (this._battler === battler) return;
            this._battler = battler;
        };
    
        Sprite_hpGaugeSprite.prototype.update = function() {
            Sprite.prototype.update.call(this);
            if (this._battler !== null) {
                if (this._hp !== this._battler.hp || this._mhp !== this._battler.mhp) {
                    this._hp = this._battler.hp;
                    this._mhp = this._battler.mhp;
                    this.refresh();
                }
            }
        };
        // hpGauge color
        Sprite_hpGaugeSprite.prototype.refresh = function() {
            this.bitmap.clear();
            if (this._hp === 0) return;
            this.bitmap.fillRect(0, 0, hpGaugeWidth, hpGaugeHeight, hpGaugeOutline);
            var d = hpGaugeWidth - hpGaugeHeight + hpGaugeFill;
            var w = Math.floor(this._hp / this._mhp * d);
    /*
            if (!this._battler || this._battler.isActor()) {
                var hpcolor = hpNumColor1;  // actor
            } else {
                hpcolor = hpNumColor2; // enemy
            }*/
            var fill1 = 0;
            var fill2 = 0;
            if (!this._battler || this._battler.isActor()) {
                fill1 = hpGaugeColor1;//"#4be1fe";
                fill2 = hpGaugeColor3;//"#1b55c6";
                this.bitmap.fillRect(1, 1, w, hpGaugeFill, this._hp === this._mhp ? fill1 : fill2);
            } else {
                fill1 = hpGaugeColor2//"#fe4b69";
                fill2 = hpGaugeColor4//"#d02442";
                this.bitmap.fillRect(1, 1, w, hpGaugeFill, this._hp === this._mhp ? fill1 : fill2);
            }
        };
    
        //-----------------------------------------------------------------------------
        // Sprite_hpNumberSprite
        //
    
        function Sprite_hpNumberSprite() {
            this.initialize.apply(this, arguments);
        }
    
        Sprite_hpNumberSprite.prototype = Object.create(Sprite.prototype);
        Sprite_hpNumberSprite.prototype.constructor = Sprite_hpNumberSprite;
    
        Sprite_hpNumberSprite.prototype.initialize = function(character) {
            Sprite.prototype.initialize.call(this);
            this.bitmap = new Bitmap(32, 32);
            this.bitmap.fontSize = hpFontSize;
            this.bitmap.textColor = hpNumtextColor;
            this.bitmap.outlineWidth = hpOutline;
            this.bitmap.outlineColor = hpOutlineColor;
            this.anchor.x = 0.5;
            this.anchor.y = 0.5;
            this.x = hpNumPosX;
            this.y = hpNumPosY;
        };
    
        Sprite_hpNumberSprite.prototype.setBattler = function(battler) {
            if (this._battler === battler) return;
            this._battler = battler;
        };
    
        Sprite_hpNumberSprite.prototype.update = function() {
            Sprite.prototype.update.call(this);
            if (this._battler !== null) {
                if (this._newNumber !== this._battler.hp) {
                    this._newNumber = this._battler.hp;
                    this.refresh();
                }
            }
        };
    
        Sprite_hpNumberSprite.prototype.refresh = function() {
            this.bitmap.clear();
            if (this._newNumber === 0) return;
            var width = this.bitmap.width;
            var height = this.bitmap.height;
    
            // set color hp @ 100 #66ff66 and hp not 100 #fce205
            if (!this._battler || this._battler.isActor()) {
                var hpcolor = hpNumColor1;  // actor
            } else {
                hpcolor = hpNumColor2; // enemy
            }
            this.bitmap.textColor = hpcolor;
            this.bitmap.drawText(this._newNumber + '', 0, 0, width, height, 'right');
        };
    
    })();
    I wanted to use that plugin to display info on map, but when it was activated once I cannot save the game anymore because it crashed.


    Do you know how to fix that problem ?
  14. because you can't just add plugins and continue on a saved file. you need to start on new game.
  15. xabileug said:
    because you can't just add plugins and continue on a saved file. you need to start on new game.
    Even if I created a New save the game continued to crash when saving.

    So I deleted config + general in the save data + all save files. Even of I deleted those files the game still crash when saving.

    I finaly off the plugin and there was no problem after. Maybe I didn't have a parent plugin or the order in plugins was wrong.
  16. AngelYuko said:
    Even if I created a New save the game continued to crash when saving.

    So I deleted config + general in the save data + all save files. Even of I deleted those files the game still crash when saving.

    I finaly off the plugin and there was no problem after. Maybe I didn't have a parent plugin or the order in plugins was wrong.
    These are all the plugins for SRPG Gear MV 1.11Q. You can see the order, just place it below SRPG_Summon and above SRPG_ShowPath. There is no problem in my end.
    1700917500945.png
  17. How do I check if a user or active event is standing on a certain region? Intending to use this in a pre-battle event.
  18. xabileug said:
    These are all the plugins for SRPG Gear MV 1.11Q. You can see the order, just place it below SRPG_Summon and above SRPG_ShowPath. There is no problem in my end.
    View attachment 285080
    I re-tested to implement the plugin with your tips but it didn't crash. But when I save during battle it's extremly long to save (and sometime it can crash) and the saving time after battle is a little longer than before the first launch of the plugin.

    I think I will abandon the use of that plugin, my game definitly don't support it lol


    EDIT : @xabileug I re-tested to implement the UnitMapInfo by copying the code you droped in the post and everything works very well now
  19. Hello, I'm having a blast learning this script and playing around. I am stuck on something that I either missed or is not there. The actors im using are going to have a AP (Action Point) Stat and when they do a combat action (basic attack), skills/magic, or item action its -1AP per action, if they have 0AP they can not proceed to continue any actions except Move (If they have any MP left) is there anyway I can manipulate the amount of times an actor can act? If so i'd very much appreciate the assistance.
  20. @boomy I wanted to use your "SRPG Window" plugin to custom my battle windows. For Now I just put your plugin below all my SRPG Plugins (just to see if it works) with all default value in plugin parameters and I get that error message
    Error message
    View attachment 285279
    Here's my plugin list
    View attachment 285280
    View attachment 285281
    View attachment 285282
    View attachment 285283

    Other problem if anyone can help.

    It seems that Soukang SRPG_StatusWindows is not compatible with YEP_EquipCore. (I had a bug report when I called the status windows on an enemy. When I disabled the YEP_EquipCore the game works so it's just an incompatibility). Someone did it work with YEP_EquipCore ?
    In my game I can't disabled the EquipCore because I need the Equip_requirement plugin