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

● ARCHIVED · READ-ONLY
Started by RyanBram 3313 posts Page 117 of 166 View original ↗
  1. Shoukang said:
    I updated the SRPG_ActionOrder as I noticed that character images in the turn indicator window sometimes won't show up. It seems really hard to fix. So I decide to draw battler faces instead. You can put a Face frame and Face back images in the system folder to change the appearance. Samples are in the attachment.
    View attachment 218534
    Yeah, SRPG engine is quite finicky about randomly deciding not to make a face for no discernable reason
  2. Hello! I'm using SRPG_DirectionMod.js. However, when attacking from side and back, the correct damage and hit values are not displayed on the prediction window. Is this a specification? I would appreciate it if anyone could provide information.
    By the way, in SRPG_TerrainEffect.js The correct value was displayed.
  3. Hello, how to have a weapon behave like a "missile" even though its category isn't?
    Case in point, I would like to include a knife that can be thrown whereas regular knives can't.
    Therefore it has the tag <weaponRange:2>.
    But I would also like to know if it's possible to add another tag so that when using this weapon, the battler doesn't move and only the animation of the weapon is played?
  4. Indinera said:
    Hello, how to have a weapon behave like a "missile" even though its category isn't?
    Case in point, I would like to include a knife that can be thrown whereas regular knives can't.
    Therefore it has the tag <weaponRange:2>.
    But I would also like to know if it's possible to add another tag so that when using this weapon, the battler doesn't move and only the animation of the weapon is played?
    I use the <On Creation Eval> tag. Then simply add w/e custom properties you want to the weapon.

    <On Creation Eval>
    item._weaponDmg = 50;
    item._tags = ["light", "finesse"];
    </On Creation Eval>
    You can then reference the custom properties/tags on the weapon like so:
    a.equips()[0]._tags.contains("finesse") ? stuff : stuff
  5. This seems pretty complicated to me (who is really a beginner at it).
    Is there not a srpg_core tag that forces the battler to stay immobile (in essence replicating what "missile" type of weapon does)?
  6. Indinera said:
    Hello, how to have a weapon behave like a "missile" even though its category isn't?
    Case in point, I would like to include a knife that can be thrown whereas regular knives can't.
    Therefore it has the tag <weaponRange:2>.
    But I would also like to know if it's possible to add another tag so that when using this weapon, the battler doesn't move and only the animation of the weapon is played?
    Hi, I assume you are testing on the 1.32Q demo. It has something to do with the Dynamic Motion plugin. The default attack skill has a note tag:<D-Motion:near&foot&Wait/>, which will cause the battler to move close to the target and attack.
    You can assign another attack skill Id to the weapon, which doesn't have this note tag.
    You can refer to the setup of bow attack skill (Id 32) in the 1.32Q demo.
    For more usage and samples of Dynamic action and dynamic animation, you can refer to the documentation translated by Ryan, I'm not an expert on these.
    pocoquwashi said:
    Hello! I'm using SRPG_DirectionMod.js. However, when attacking from side and back, the correct damage and hit values are not displayed on the prediction window. Is this a specification? I would appreciate it if anyone could provide information.
    By the way, in SRPG_TerrainEffect.js The correct value was displayed.
    In the direction mod plugin:
    Solution
    1. replace theGame_Action.prototype.evalDamageFormula function wih this one:
    JavaScript:
        Game_Action.prototype.evalDamageFormula = function(target) {
            var value = _Game_Action_evalDamageFormula.call(this, target);
            if ($gameSystem.isSRPGMode() == true) {
                if ($gameTemp.activeEvent() && $gameTemp.targetEvent()) {
                    if ($gameSystem.isSubBattlePhase() == 'battle_window') decideAttackdirection(); // Shoukang add this line
                    if (this.subject() == $gameSystem.EventToUnit($gameTemp.activeEvent().eventId())[1] &&
                        $gameSystem.EventToUnit($gameTemp.activeEvent().eventId())[0] !=
                        $gameSystem.EventToUnit($gameTemp.targetEvent().eventId())[0]) {
                        if ($gameTemp.getAttackDirection() == 'side') {
                            value *= side_dmg;
                        } else if ($gameTemp.getAttackDirection() == 'back') {
                            value *= back_dmg;
                        }
                    }
                }
            }
            return value;
        };

    2. Add this poorly designed function(I would never write such fuction, it's a part of a function in direction mode plugin:
    JavaScript:
        decideAttackdirection = function() {
            var differenceX = $gameTemp.activeEvent().posX() - $gameTemp.targetEvent().posX();
            var differenceY = $gameTemp.activeEvent().posY() - $gameTemp.targetEvent().posY();
            if (Math.abs(differenceX) == Math.abs(differenceY)) {
                if (differenceX < 0 && differenceY < 0) {
                    switch ($gameTemp.targetEvent().direction()) {
                        case 2:
                        case 8:
                            $gameTemp.activeEvent().setDirection(2);
                            break;
                        case 4:
                        case 6:
                            $gameTemp.activeEvent().setDirection(6);
                            break;
                    }
                }
                if (differenceX > 0 && differenceY < 0) {
                    switch ($gameTemp.targetEvent().direction()) {
                        case 2:
                        case 8:
                            $gameTemp.activeEvent().setDirection(2);
                            break;
                        case 4:
                        case 6:
                            $gameTemp.activeEvent().setDirection(4);
                            break;
                    }
                }
                if (differenceX < 0 && differenceY > 0) {
                    switch ($gameTemp.targetEvent().direction()) {
                        case 2:
                        case 8:
                            $gameTemp.activeEvent().setDirection(8);
                            break;
                        case 4:
                        case 6:
                            $gameTemp.activeEvent().setDirection(6);
                            break;
                    }
                }
                if (differenceX > 0 && differenceY > 0) {
                    switch ($gameTemp.targetEvent().direction()) {
                        case 2:
                        case 8:
                            $gameTemp.activeEvent().setDirection(8);
                            break;
                        case 4:
                        case 6:
                            $gameTemp.activeEvent().setDirection(4);
                            break;
                    }
                }
            } else {
                if (Math.abs(differenceX) > Math.abs(differenceY)) {
                    if (differenceX < 0) {
                        $gameTemp.activeEvent().setDirection(6);
                    } else if (differenceX > 0) {
                        $gameTemp.activeEvent().setDirection(4);
                    }
                } else {
                    if (differenceY < 0) {
                        $gameTemp.activeEvent().setDirection(2);
                    } else if (differenceY > 0) {
                        $gameTemp.activeEvent().setDirection(8);
                    }
                }
            }
            var direction = 'side';
            switch ($gameTemp.targetEvent().direction()) {
                case 2:
                    switch ($gameTemp.activeEvent().direction()) {
                        case 2:
                            direction = 'back';
                            break;
                        case 8:
                            direction = 'front';
                            break;
                    }
                    break;
                case 4:
                    switch ($gameTemp.activeEvent().direction()) {
                        case 4:
                            direction = 'back';
                            break;
                        case 6:
                            direction = 'front';
                            break;
                    }
                    break;
                case 6:
                    switch ($gameTemp.activeEvent().direction()) {
                        case 4:
                            direction = 'front';
                            break;
                        case 6:
                            direction = 'back';
                            break;
                    }
                    break;
                case 8:
                    switch ($gameTemp.activeEvent().direction()) {
                        case 2:
                            direction = 'front';
                            break;
                        case 8:
                            direction = 'back';
                            break;
                    }
                    break;
            }
            var battlerArray = $gameSystem.EventToUnit($gameTemp.activeEvent().eventId());
            var skill = battlerArray[1].action(0).item();
            if (skill.meta.srpgDirection) {
                if (skill.meta.srpgDirection == 'false') {
                    direction = 'front';
                }
            }
            $gameTemp.setAttackDirection(direction);
        };
    LEe123132 said:
    I want to compete with sprite image characters in more than 3 frames and 5 frames. What should I do? Please tell me in detail.
    No idea, I don't feel like it's related to SRPG games either.
    How about trying this first? Galv's Character Frames
  7. Hey Shoukang, I would like to suggest a setting for your Action Order plugin: in addition to the way you have set things up, you should create a "fair turns" option where once a unit makes its move, every unit on the map gets a turn before it gets to move again.
  8. Shoukang said:
    Hi, I assume you are testing on the 1.32Q demo. It has something to do with the Dynamic Motion plugin. The default attack skill has a note tag:<D-Motion:near&foot&Wait/>, which will cause the battler to move close to the target and attack.

    In the direction mod plugin:
    Solution
    1. replace theGame_Action.prototype.evalDamageFormula function wih this one:
    JavaScript:
        Game_Action.prototype.evalDamageFormula = function(target) {
            var value = _Game_Action_evalDamageFormula.call(this, target);
            if ($gameSystem.isSRPGMode() == true) {
                if ($gameTemp.activeEvent() && $gameTemp.targetEvent()) {
                    if ($gameSystem.isSubBattlePhase() == 'battle_window') decideAttackdirection(); // Shoukang add this line
                    if (this.subject() == $gameSystem.EventToUnit($gameTemp.activeEvent().eventId())[1] &&
                        $gameSystem.EventToUnit($gameTemp.activeEvent().eventId())[0] !=
                        $gameSystem.EventToUnit($gameTemp.targetEvent().eventId())[0]) {
                        if ($gameTemp.getAttackDirection() == 'side') {
                            value *= side_dmg;
                        } else if ($gameTemp.getAttackDirection() == 'back') {
                            value *= back_dmg;
                        }
                    }
                }
            }
            return value;
        };

    2. Add this poorly designed function(I would never write such fuction, it's a part of a function in direction mode plugin:
    JavaScript:
        decideAttackdirection = function() {
            var differenceX = $gameTemp.activeEvent().posX() - $gameTemp.targetEvent().posX();
            var differenceY = $gameTemp.activeEvent().posY() - $gameTemp.targetEvent().posY();
            if (Math.abs(differenceX) == Math.abs(differenceY)) {
                if (differenceX < 0 && differenceY < 0) {
                    switch ($gameTemp.targetEvent().direction()) {
                        case 2:
                        case 8:
                            $gameTemp.activeEvent().setDirection(2);
                            break;
                        case 4:
                        case 6:
                            $gameTemp.activeEvent().setDirection(6);
                            break;
                    }
                }
                if (differenceX > 0 && differenceY < 0) {
                    switch ($gameTemp.targetEvent().direction()) {
                        case 2:
                        case 8:
                            $gameTemp.activeEvent().setDirection(2);
                            break;
                        case 4:
                        case 6:
                            $gameTemp.activeEvent().setDirection(4);
                            break;
                    }
                }
                if (differenceX < 0 && differenceY > 0) {
                    switch ($gameTemp.targetEvent().direction()) {
                        case 2:
                        case 8:
                            $gameTemp.activeEvent().setDirection(8);
                            break;
                        case 4:
                        case 6:
                            $gameTemp.activeEvent().setDirection(6);
                            break;
                    }
                }
                if (differenceX > 0 && differenceY > 0) {
                    switch ($gameTemp.targetEvent().direction()) {
                        case 2:
                        case 8:
                            $gameTemp.activeEvent().setDirection(8);
                            break;
                        case 4:
                        case 6:
                            $gameTemp.activeEvent().setDirection(4);
                            break;
                    }
                }
            } else {
                if (Math.abs(differenceX) > Math.abs(differenceY)) {
                    if (differenceX < 0) {
                        $gameTemp.activeEvent().setDirection(6);
                    } else if (differenceX > 0) {
                        $gameTemp.activeEvent().setDirection(4);
                    }
                } else {
                    if (differenceY < 0) {
                        $gameTemp.activeEvent().setDirection(2);
                    } else if (differenceY > 0) {
                        $gameTemp.activeEvent().setDirection(8);
                    }
                }
            }
            var direction = 'side';
            switch ($gameTemp.targetEvent().direction()) {
                case 2:
                    switch ($gameTemp.activeEvent().direction()) {
                        case 2:
                            direction = 'back';
                            break;
                        case 8:
                            direction = 'front';
                            break;
                    }
                    break;
                case 4:
                    switch ($gameTemp.activeEvent().direction()) {
                        case 4:
                            direction = 'back';
                            break;
                        case 6:
                            direction = 'front';
                            break;
                    }
                    break;
                case 6:
                    switch ($gameTemp.activeEvent().direction()) {
                        case 4:
                            direction = 'front';
                            break;
                        case 6:
                            direction = 'back';
                            break;
                    }
                    break;
                case 8:
                    switch ($gameTemp.activeEvent().direction()) {
                        case 2:
                            direction = 'front';
                            break;
                        case 8:
                            direction = 'back';
                            break;
                    }
                    break;
            }
            var battlerArray = $gameSystem.EventToUnit($gameTemp.activeEvent().eventId());
            var skill = battlerArray[1].action(0).item();
            if (skill.meta.srpgDirection) {
                if (skill.meta.srpgDirection == 'false') {
                    direction = 'front';
                }
            }
            $gameTemp.setAttackDirection(direction);
        };
    >> Miss Shoukang

    After adding the script you taught to SRPG_DirectionMod,
    the display was as expected! thank you very much!
  9. @Shoukang Does your SRPG_ActionOrder plugin support turn order manipulation? For example, this is how LeTBS does it:
  10. Shoukang said:
    No idea, I don't feel like it's related to SRPG games either.
    How about trying this first? Galv's Character Frames
    First of all, thank you for answering my question.
    Galv's Character Frames
    I tried using it.
    It does not work normally in the SRPG On map Battle.
    I could get a hint from Dopan's answer, but I don't understand his answer exactly.
    How can I properly understand and copy his answer?
  11. Shoukang said:
    You just need to avoid having zero as the denominator. Replace all actor.mmp with Math.max(1, actor.mmp)

    I dunno why it didn't click until I read it like that, but I realized what the issue was. All my test enemies had 0 mana points, which was causing the error. Still, that little tweak will provide a good failsafe.

    So, it ultimately took me 2 afternoons to reverse engineer and tweak this plugin in a way that a knowledgeable coder could have done in minutes, but I think other people could use a plugin like this as well! Can I add this to the list of extensions?
  12. MetalKing11417 said:
    Hey Shoukang, I would like to suggest a setting for your Action Order plugin: in addition to the way you have set things up, you should create a "fair turns" option where once a unit makes its move, every unit on the map gets a turn before it gets to move again.
    I considered this suggestion for quite some time but I feel like it will mess up the code. So I'm not going to do it.

    Frostorm said:
    @Shoukang Does your SRPG_ActionOrder plugin support turn order manipulation? For example, this is how LeTBS does it:
    Yes, it's quite simple, if your battler is 'a', then a.distToAction stores the distance to its action. You can change this value to make it move sooner or later. The lower the sooner, the initial value is 100.
    You can download the latest version to do this. (In the previous version it's a._distToAction, which is not good coding practice so I changed it.)

    =====================================================================
    I made a new plugin SRPG_Developer to speed up game development.
    It will allow you to change fps, skip animations, accelerate moves and messages. It can make the game pace ultra fast.
    It also provides an SRPG battle log which allows you to review previous moves, stats with hotkeys.
    You can also make battlers auto-battle till you break it.

    I think it's a good tool to test game difficulty, battler strength, or AI, as it can finish a battle in seconds with max acceleration (and with the SRPG_BattleResultAutoClose plugin).
    Demo of an accelerated battle
    demo developer.gif
  13. Shoukang said:
    (In the previous version it's a._distToAction, which is not good coding practice so I changed it.)
    May I ask why the underscore is bad coding practice? Cuz I actually have that habit with my coding, but wasn't aware it was bad practice...
  14. Shoukang said:
    I considered this suggestion for quite some time but I feel like it will mess up the code. So I'm not going to do it.
    So how about creating a mutually exclusive plug-in that does so?
  15. Frostorm said:
    May I ask why the underscore is bad coding practice? Cuz I actually have that habit with my coding, but wasn't aware it was bad practice...
    It's a tradition. All the properties start with '_' are considered as internal. Internal basically means you can use it inside the object's field but not outside. So this._someProperty is fine but object._someProperty violates the rule.(Though JS will allow you to do so, such a casual language XD)
    EDIT: I think the right term is 'private', not 'internal'.
    MetalKing11417 said:
    So how about creating a mutually exclusive plug-in that does so?
    I mean you are content with the FE system so far, do you really need this battle mode or is it just a suggestion?
  16. Shoukang said:
    It's a tradition. All the properties start with '_' are considered as internal. Internal basically means you can use it inside the object's field but not outside. So this._someProperty is fine but object._someProperty violates the rule.(Though JS will allow you to do so, such a casual language XD)

    I mean you are content with the FE system so far, do you really need this battle mode or is it just a suggestion?
    mostly a suggestion.
  17. Shoukang said:
    I updated the SRPG_ActionOrder as I noticed that character images in the turn indicator window sometimes won't show up. It seems really hard to fix. So I decide to draw battler faces instead. You can put a Face frame and Face back images in the system folder to change the appearance. Samples are in the attachment.
    View attachment 218534
    is it possible to use the SV battler animated frames instead of the battler face graphic? and change them to horizontal layout?
  18. Good afternoon.

    Please tell me how can I track if actor A attacked anyone; and was enemy B attacked by anyone?
  19. Hello guys ! Hope you have a good day. First of all, i'm french so i apologize about my english.
    I encounter some problem about the SRPG plugin and the Immediate skin plugin.
    When i use a spell with the <ImmediateSkill> tag, it work properly (the character didn't finish his turn) but when i press the key 0 on the Numepad, it cancel the turn and put back the character at the place who he's start the turn. So, if i move BEFORE the skill, he go back to a saffer place (who isn't the goal) but more important, the ennemis who get hit by the spell, still have the HP lost by the spell and you recover ALL of the movement point you have use.
    So you can do something like that :
    Move => Use a skill at close range (or a skill that make you gap close) => Press 0 on Numepad that make you back to your position at the start of your turn => Do it again till the ennemy die.

    I would like to know if there is something to do with that probleme. I know i can use the <addActionTimes> but i don't want to give a new turn to the character, i just want him to continue to play, like move (but not reset his movement), do another action etc...

    With this i have a question. Is it possible to create a mecanic like the MMORPG Dofus ? In this game, you character have Action Point (AP) and Movement Point (MP). When you play your turn, you can move till you dont have MP anymore and use spell till you dont have AP. But you can do something like move 2 MP, use 2 spell, move again, use the rest of your AP then move again and finish your turn. Is it possible to do something like that with the SRPG plugin and all of his addons ? I know the Le_TBS plugin exist and maybe cand do something like that but i prefer the SRPG cause of all the support he has.

    Sorry for this long post and hope you can help me ! Have a good day again !
  20. Brother_Fox said:
    actor A attacked anyone; and was enemy B attacked by anyone
    There isn't an easy way to check this.
    Unfortunately, srpg_core.js deletes all troop and party data after a battle (via clearSrpgBattleActors and clearSrpgBattleEnemy functions) so you can't just read data using a <type:afterAction> event. You could do it using other plugins (such as yanfly buff and states core) or by adding a script into srpg_core.js itself (srpgBattleStart function would be a good place to store this data)

    WhitteRabbite said:
    I would like to know if there is something to do with that probleme.
    Here is a script that will move the unit's "starting zone" to their last known position (vs. their original position) and add a state. The state is designed to have <srpgMovePlus:-69> so the unit cannot move anymore. I am using state 69 as this "disabled" state with 1 turn expiry. A better way to do this would be to script a new variable to game_actor to track "actions" and then disable movement if "actions" have been performed but that seems too much work so I'm going with the "addState" option

    Code
    Code:
        // SRPG Immediate skill edit
        var _SRPG_IS_Scene_Map_srpgAfterAction = Scene_Map.prototype.srpgAfterAction;
        Scene_Map.prototype.srpgAfterAction = function () {
            if ($gameTemp.SrpgImmediateSkill() == true) {
                $gameTemp.setSrpgImmediateSkill(false);
                var event = $gameTemp.activeEvent();
                var battlerArray = $gameSystem.EventToUnit(event.eventId());
                //Add inactive state to user
                battlerArray[1].addState(69);
                //Change "starting" point
                $gameTemp.reserveOriginalPos($gameTemp.activeEvent().posX(), $gameTemp.activeEvent().posY());
    
                $gameSystem.setSrpgActorCommandStatusWindowNeedRefresh(battlerArray);
                $gameSystem.clearSrpgStatusWindowNeedRefresh();
                $gameSystem.clearSrpgBattleWindowNeedRefresh();
                $gameTemp.setSrpgDistance(0);
                $gameTemp.clearTargetEvent();
                $gameTemp.clearMoveTable();
                $gameTemp.initialMoveTable(battlerArray[1].event().posX(), battlerArray[1].event().posY(), battlerArray[1].srpgMove());
                event.makeMoveTable(battlerArray[1].event().posX(), battlerArray[1].event().posY(), battlerArray[1].srpgMove(), [0], battlerArray[1].srpgThroughTag());
                var list = $gameTemp.moveList();
                for (var i = 0; i < list.length; i++) {
                    var pos = list[i];
                    event.makeRangeTable(pos[0], pos[1], battlerArray[1].srpgWeaponRange(), [0]);
                }
                $gameTemp.pushRangeListToMoveList();
                $gameTemp.setResetMoveList(true);
                battlerArray[1].srpgMakeNewActions();
                $gameSystem.setSrpgActorCommandWindowNeedRefresh(battlerArray);
                $gameSystem.setSubBattlePhase('actor_command_window');
            } else {
                _SRPG_IS_Scene_Map_srpgAfterAction.call(this);
            }
        };
    WhitteRabbite said:
    But you can do something like move 2 MP, use 2 spell, move again, use the rest of your AP then move again and finish your turn
    Shoukang's Move after action plugin deals with the "move again" but there's no function or plugin that combines the both. With Shoukang's plugin, after an action you can use remaining "move points" to move but you cannot perform any other actions. ImmediateSkill notetag allows users to make another action but if you use the above script then movement will be disabled after an action. I guess you could change <srpgMovePlus> state to be equal to remaining "move points" left.