Lecode Tactical Battle System 0.77.2B

Discussion in 'JS Plugin Releases (RMMV)' started by Lecode, Nov 28, 2016.

  1. moldy

    moldy Veteran Veteran

    Messages:
    190
    Likes Received:
    28
    First Language:
    English
    Interesting! I was actually thinking about doing something similar (making actors corresponding to each enemy and just summoning them to the battle field in the enemy's place). Would there be a way to make the enemy regain its senses and return to the battle as an enemy though?
     
  2. cmcorbin

    cmcorbin Villager Member

    Messages:
    13
    Likes Received:
    6
    First Language:
    english
    Primarily Uses:
    RMMV
    Hey everyone. I have a quick question. Is it possible to create a skill that targets a single person when one tile away and does a small AoE at longer distances? My idea is to have a shotgun that does more damage to a single target right next to the user but then have the shot spread out at longer ranges. The distance modifier isnt a problem thanks to Pharonix (Thank you for posting that by the way), but I am not sure how or if its possible to build a skill like that. Thanks in advance!
     
  3. Adventurer_inc.

    Adventurer_inc. Technically a Programmer Veteran

    Messages:
    97
    Likes Received:
    40
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    @Pharonix
    It seems like Counter is quite buggy. I took a different approach to counter. My counter is similar to FFT where you would counter when the enemy is within the range of your current held weapon and with your current held weapon. I think my problem might be in the action sequence department.

    I even left myself a comment before I took a hiatus that I can't seem to make it out:
    Code:
    /*
    1/16/19 Note: When stacking forceAction the sequences are appended together and becomes one sequence.
    The problem is that only one actionEnd is played so the skill of the first forceAction replaces the second skill
    */
    Your charm gives me an idea of creating multiple teams in battle similar to Lecode's 0.8. Enemies that will attack both other enemies and players alike.
     
  4. Pharonix

    Pharonix Shadow Walker Veteran

    Messages:
    612
    Likes Received:
    267
    Location:
    Alpha Centauri Cluster
    First Language:
    English
    Primarily Uses:
    RMMV
    My counter system is actually quite in-depth

    each entity, thanks to passives/weapons/etc, has a list of "counter" skills that they have at their disposal.
    Each of these are then set to what I called a "counter distance" meaning, this is as far as that skill can be used to counter.
    It then determines the distance between attacker, and victim.

    It then works like this

    Say my character has 3 counter abilities active:
    Auto-Potion, Smash, Fire Ball
    Auto-Potion has a Counter Distance of 20
    Smash is 1
    Fire Ball is 7

    If the enemy is 6 cells away, the valid skills are then
    Fire Ball and Auto-Potion.

    Because the entity has 2 VALID counters, it randomly chooses one of them.
    Then that counter skill is used.

    The problem then became:
    What if I had auto-potion.

    Well, using the standard counter system, the victim would try to cast auto-potion on the enemy, which didn't work too well,

    This led me into using 2 branches (before adding several more counter types:

    Code:
    if(this.checkCounter(skillId) === "Offensive")
                    { 
                        var popup = $dataSkills[skillId].meta["Counter Type Display"];
                        var cName = $dataSkills[skillId].meta["Counter Name"];
                        if(!popup) popup = "Offensive Counter";
                        entity.addTextPopup(popup);
                        if(!cName) cName = skill.name;
                        entity.addTextPopup(cName);
                        entity.startSequence("counter");
                        this.setCursorCell(subject.getCell());
                        this.forceAction(skill, entity);
                        entity.battler()._counters+=1;
                    }
                   else
                    {
                        var popup = $dataSkills[skillId].meta["Counter Type Display"];
                        var cName = $dataSkills[skillId].meta["Counter Name"];
                        if(!popup) popup = "Defensive Counter";
                        entity.addTextPopup(popup);
                        if(!cName) cName = skill.name;
                        entity.addTextPopup(cName);
                        entity.startSequence("counter");
                        this.setCursorCell(entity.getCell());
                        this.forceAction(skill, entity);
                        entity.battler()._counters+=1;
                    }
    
    What this then meant was, If the skill was an offensive counter (like fireball, or smash) then it would set the "cursor" to the attacking entity,
    Otherwise, since it is a defensive counter, it sets the cursor to the victim. This means that now, instead of "attacking" the oriiginal attacker with auto-potion, the victim would use it on itself.

    This will make absolutely no sense to many of you, but this should be the entirety of my counter system, not including all the additions I made to YEP_Counter_Control

    Code:
    BattleManagerTBS.processCounterAttack = function (targets, subject, action) {
        console.log("____________________");
        console.log(action);
        console.log("____________________");
        if (!action) return;
        targets.forEach(function (entity) {
            if (entity) {
                var dist = LeUtilities.distanceBetweenCells(subject.getCell(), entity.getCell());
                //if (dist <= 1 && Math.random() < action.itemCnt(entity.battler())) {
                //var skill = $dataSkills[entity.battler().attackSkillId()];
                entity.battler().makeCounterSkills();
                if(entity.battler().counterSkills() && entity.battler()._counters<entity.battler().counterTotal() && Math.random() < action.itemCnt(entity.battler()) )
                {
                    var valid = true;
                    var defC = $dataSkills[1];
                    if(entity.battler().isActor())
                        {defC = $dataSkills[$dataActors[entity.battler().actorId()].defaultCounter];}
                    else
                        {defC = $dataSkills[1];}
                  
                    var skills = this.getBestCounter(entity.battler().counterSkills(),dist,defC);
                    console.log("skills");
                    console.log(skills);
                    console.log("Default skill");
                    console.log(defC);
                    if(!skills.indexOf(defC)){skills.push(defC);}
                    //Test
                    //skills = [1,1880];
                    //get random skill if user has multiple counter skills
                    if(skills.length <=0)
                    {return;}
                    var skillId = skills[Math.floor(Math.random()*skills.length)].id;
                    var sDist = this.checkCounterDistance(skillId);
                  
                    var skill = $dataSkills[skillId];
                    console.log(skill);
                    subject.battler().clearResult();
                    entity.lookAt(subject.getCell());
                    //Check Counter Type
                    if(this.checkCounter(skillId) === "Invalid" || dist > sDist || !valid)
                    {
                      
                    }
                    else if(this.checkCounter(skillId) === "Offensive")
                    { 
                        var popup = $dataSkills[skillId].meta["Counter Type Display"];
                        var cName = $dataSkills[skillId].meta["Counter Name"];
                        if(!popup) popup = "Offensive Counter";
                        entity.addTextPopup(popup);
                        if(!cName) cName = skill.name;
                        entity.addTextPopup(cName);
                        entity.startSequence("counter");
                        this.setCursorCell(subject.getCell());
                        this.forceAction(skill, entity);
                        entity.battler()._counters+=1;
                    }
                    else if(this.checkCounter(skillId) === "Support")
                    { 
                        var popup = $dataSkills[skillId].meta["Counter Type Display"];
                        var cName = $dataSkills[skillId].meta["Counter Name"];
                        if(!popup) popup = "Support Counter";
                        entity.addTextPopup(popup);
                        if(!cName) cName = skill.name;
                        entity.addTextPopup(cName);
                        entity.startSequence("counter");
                        this.setCursorCell(subject.getCell());
                        this.forceAction(skill, entity);
                        entity.battler()._counters+=1;
                    }
                    else if(this.checkCounter(skillId) === "Elemental")
                    { 
                        var popup = $dataSkills[skillId].meta["Counter Type Display"];
                        var cName = $dataSkills[skillId].meta["Counter Name"];
                        if(!popup) popup = "Elemental Counter";
                        entity.addTextPopup(popup);
                        if(!cName) cName = skill.name;
                        entity.addTextPopup(cName);
                        entity.startSequence("counter");
                        this.setCursorCell(subject.getCell());
                        this.forceAction(skill, entity);
                        entity.battler()._counters+=1;
                    }
                    else if(this.checkCounter(skillId) === "Physical")
                    { 
                        var popup = $dataSkills[skillId].meta["Counter Type Display"];
                        var cName = $dataSkills[skillId].meta["Counter Name"];
                        if(!popup) popup = "Physical Counter";
                        entity.addTextPopup(popup);
                        if(!cName) cName = skill.name;
                        entity.addTextPopup(cName);
                        entity.startSequence("counter");
                        this.setCursorCell(subject.getCell());
                        this.forceAction(skill, entity);
                        entity.battler()._counters+=1;
                    }
                    else if(this.checkCounter(skillId) === "Magical")
                    { 
                        var popup = $dataSkills[skillId].meta["Counter Type Display"];
                        var cName = $dataSkills[skillId].meta["Counter Name"];
                        if(!popup) popup = "Magical Counter";
                        entity.addTextPopup(popup);
                        if(!cName) cName = skill.name;
                        entity.addTextPopup(cName);
                        entity.startSequence("counter");
                        this.setCursorCell(subject.getCell());
                        this.forceAction(skill, entity);
                        entity.battler()._counters+=1;
                    }
                    else
                    {
                        var popup = $dataSkills[skillId].meta["Counter Type Display"];
                        var cName = $dataSkills[skillId].meta["Counter Name"];
                        if(!popup) popup = "Defensive Counter";
                        entity.addTextPopup(popup);
                        if(!cName) cName = skill.name;
                        entity.addTextPopup(cName);
                        entity.startSequence("counter");
                        this.setCursorCell(entity.getCell());
                        this.forceAction(skill, entity);
                        entity.battler()._counters+=1;
                    }
                }//Won't do anything if user has no Counter Skills
                  
                  
                //}
            }
        }.bind(this));
    };
    
    BattleManagerTBS.checkCounterDistance = function (skillId) {
        console.log(skillId);
        var CDist = 1;
            if ($dataSkills[skillId].meta["Counter Distance"])
            CDist = $dataSkills[skillId].meta["Counter Distance"];
        if(CDist)
        {
            return Number(CDist);
        }
        else
        {
        return 0;
        }
    };
    
    BattleManagerTBS.getBestCounter = function (counterSkills, cntDistance, defCounter)
    {
        counterSkills.push(defCounter);
        console.log("counter skills");
        console.log(counterSkills);
        var goodSkills = [];
        var bestSkills = [];
        counterSkills.forEach(function(skill)
        {
            console.log(skill);
            console.log(skill.id);
    
                //Skills with counter range 0 should be treated as permanent counters - able to counter all (auto-potion for example)
                if(BattleManagerTBS.checkCounter(skill.id) == "Invalid" || BattleManagerTBS.checkCounterDistance(skill.id)==0)
                {
                }
                else if(BattleManagerTBS.checkCounterDistance(skill.id)==cntDistance)
                {
                    //console.log("best skill")
                    //console.log(skill)
                    bestSkills.push(skill);
                }
                else if(BattleManagerTBS.checkCounterDistance(skill.id)>=cntDistance && BattleManagerTBS.checkCounterDistance(skill.id)>0 && BattleManagerTBS.checkCounter(skill.id))
                {
                    //console.log("good skill")
                    //console.log(skill)
                    goodSkills.push(skill);
                }
                else
                {
                    //console.log("bad skill")
                    console.log(skill)
                  
                }
              
        });
      
        if(bestSkills.length>=1)
        {
            console.log(bestSkills);
            return bestSkills;//[Math.floor(Math.random()*bestSkills.length)].id;
        }
        else if(goodSkills.length>=1)
        {
            console.log(goodSkills);
            return goodSkills;//[Math.floor(Math.random()*goodSkills.length)].id;
        }
        else
            return [];//null;
    
    
    
    };
      
    BattleManagerTBS.checkCounter = function (skillId) {
        var defensiveSkills = [1880];
        var cType = $dataSkills[skillId].meta["Counter Type"];
        if(!cType) cType = "Counter" ;
        var n = defensiveSkills.indexOf(skillId);
        var eva = $dataSkills[skillId].counterConditionEval;
        if(eva)
        {
        // If the skill has an eval, this will make sure the skill is valid.
        // Example: If the skill is "Auto-Potion" it will make sure the player has enough potions.
        // To give enemies Auto-Potion, make sure to create a duplicate skill without the eval.
            if(!eval(eva)){return "Invalid";}
        }
        if (n>=0 || cType =="Defensive")
        {
            return "Defensive";
        }
        else if(cType =="Support")
            return "Support";
        else if(cType =="Elemental")
            return "Elemental";
        else if(cType =="Physical")
            return "Physical";
        else if(cType =="Magical")
            return "Magical";
      
        return "Offensive";
    };
    
    BattleManagerTBS.getCounterType = function (skillId) {
        var type = $dataSkills[skillId];
    
    
    };

    Here's my Changelog For basically everything I added to LeTBS.js, not including various other plugins.
    # - 0.77.PHX
    # * ===========
    # * Positioning
    # * ===========
    # * Added support for variable-based actor cells
    # * Added support for switch-based actor cells
    # * Added support for leader-based actor cells (Party Leader auto-positioning
    # * Added support for neutral positioning cells that can be used by enemies or actors
    # * Added custom color for neutral positioning
    # * Added logic to determine of all player entities are placed in the pre-positioning phase.
    # * If this is the case, the battle is immediately started, eliminating the need for the player
    # to "Confirm" they are ready. Eliminates a bug where you could "Cancel" on a pre-placed unit.
    # Causing the game to crash.
    # * ===========
    # * Scope Select
    # * ===========
    # * Added support for Scope_Select if Actor is afflicted with a specific State
    # * Added support for Scope_Select if Enemy Unit is afflicted with a specific State
    # * Added support for Scope_Select if A Team Member is afflicted with a specific State
    # * Added support for Scope_Select if An Enemy Team Member (enemies if player, player if enemies0
    # * is afflicted with a specific State
    # * Added support for Scope_Select if Actor Knows a specific Skill
    # * Added support for Scope_Select if Enemy Knows a specific Skill
    # * ===========
    # * Turn Order
    # * ===========
    # * Added support for "Redrawing" the Turn Order
    # * If enabled, the turn order will be determined at the end of every turn.
    # * This allows for skills that raise a unit's agility to have a better advantage
    # The next turn.
    #
    # * Added support for Initiative Battle System:
    # ** Allows the configuring of
    # *** Bonus Initiative for non-movement / remaining move points
    # *** Non-Action - Not attacking/using skills/items/ect.
    # *** Default Initiative cost - Initiative cost per turn
    # * ===========
    # * Turn Order
    # * ===========
    # * [Order Types]
    # * Type 0
    # * Fair Order - Alternates between Ally and Enemy. Ally and Enemy order is
    # * based on agility. [Ally1, Enemy1, Ally2, Enemy2....etc]
    # *
    # * Type 1
    # * Simple Order - Takes all ally/enemy together and sorts indiscriminately based on
    # * agility. Can Cause unfair turn order if either side is faster in general
    # * ex. [Ally1, Ally2, Enemy1, Enemy3, Enemy2, Ally3]
    # *
    # * Type 2 (Also known as Pre-emptive Strike)
    # * Actor First - Sorts Actors and Enemies by Agility order respectively
    # * (Orders Actor List by AGI. and Enemy List by AGI.
    # * Then Combines the Two Lists. Results in order like the following:
    # * [Ally3, Ally1, Ally2, Enemy1, Enemy3, Enemy2]
    # *
    # * Type 3 (Also known as Surprise Attack)
    # * Enemy First - Sorts Actors and Enemies by Agility order respectively
    # * (Orders Actor List by AGI. and Enemy List by AGI.
    # * Then Combines the Two Lists. Results in order like the following:
    # * [Enemy1 ,Enemy3, Enemy2,Ally3, Ally1, Ally2]
    # *
    # * Reverse
    # *
    # * Type 4
    # * Fair Order - Alternates between Ally and Enemy. Ally and Enemy order is
    # * based on agility. [Ally1, Enemy1, Ally2, Enemy2....etc] Slowest Acts First
    # *
    # * Type 5
    # * Simple Order - Takes all ally/enemy together and sorts indiscriminately based on
    # * agility. Can Cause unfair turn order if either side is faster in general
    # * ex. [Ally1, Ally2, Enemy1, Enemy3, Enemy2, Ally3] Slowest Acts First
    # *
    # * Type 6
    # * Actor First - Sorts Actors and Enemies by Agility order respectively
    # * (Orders Actor List by AGI. and Enemy List by AGI.
    # * Then Combines the Two Lists. Results in order like the following:
    # * [Ally3, Ally1, Ally2, Enemy1, Enemy3, Enemy2] Slowest Acts First
    # *
    # * Type 7
    # * Enemy First - Sorts Actors and Enemies by Agility order respectively
    # * (Orders Actor List by AGI. and Enemy List by AGI.
    # * Then Combines the Two Lists. Results in order like the following:
    # * [Enemy1 ,Enemy3, Enemy2,Ally3, Ally1, Ally2] Slowest Acts First
    # *
    # * Special
    # * Type 8
    # * Initiative Order - Currently uses the Actor's initial move points and agility to determine level of initiative.
    # * the higher the player's initiative, the higher in the order they go.
    # * After a turn ends, bonuses can be set for:
    # * Non-Action (No attack / item / skill / etc
    # * Remaining Movepoints (ie: used 3 of 5 movepoints - results in 2 bonus initiative)
    # * Pre-Set initiative cost deducted on turn end (default of 10). When an actor or enemy
    # * has 0 or fewer initiative points, they are removed from the turn order, and must wait
    # * until the initiative order is re-structured (all units finished using all initiative)
    # * ===========
    # * Counter System
    # * ===========
    # * Repaired Counter System for 0.77
    # * Added support for Yanfly Counter Control
    # * Added support for Counter Conditions, Counter Distance
    # * Counter is selected by determining "Best Counters"
    #
    # * First, the skill's Counter Conditions are checked.
    # ** If no counter condition is set, it is evaluated as true -
    # ** otherwise it evaluates the counter condition. If false, it
    # it does not add the skill to any array, if true, proceed to next step.
    # * Second, it checks Counter distance (If unavailable, assumes "0") of all Counter Skills
    # for the "countering" entity.
    # * If Counter Distance = Distance between attacker and the entity that counters
    # or the Counter Distance = 0, then that counter skill is added to the "Best" counters
    # * If Counter Distance is greater than or equal to the distance between the two entities,
    # then it is considered a "good" or otherwise "valid" counter.
    # * If the "Best" counters has a length > 0 then it is returned, otherwise, it checks if
    # the "Good" counters array has a length of > 0, if so, that one is returned.
    # * If neither array has elements, it returns an empty array, and the character does NOT counter.
    #
    # * After the Counter SKills array is determined, it randomly selects one.
    # * This counter is then checked to see what "Type" of counter it is.
    # * Using an array of "Defensive Counters" (Will later be updated to use a notetag) it checks if the skill
    # selected is a Defensive Counter and returns such, otherwise it returns "Offensive".
    # ** CheckCounter is also used by getBestCounter(), which uses it to determine if the counter is Invalid
    # ** Here, it is simply used to determine if it is defensive or offensive.
    #
    # * If the skill is defensive, the cursor is set to the countering entity, and the action is performed.
    # ** A popup will display with "Defensive Counter" and "Skill Name"
    # * If the skill is offensive, the cursor is set to the entity to BE countered, and the action is performed.
    # ** A popup will display with "Offensive Counter" and "Skill Name"
    # *** Will add support later for other counter types such as:
    # **** Support Counter
    # **** Magic Counter
    # **** Physical Counter
    # **** Elemental Counters
    # ***** Fire,Ice,Thunder,Water,Wind,Earth,Light,Dark
    #
    # ****TO-DO****
    # * Check if counters affect allies.
    # * Add notetag to prevent ally counters
    # * Add notetag to allow ally counters
    # * Add notetag for specialiszed counters
    # ** Nearest Enemy
    # ** Nearest Ally
    # ** ETC
    # - 0.77.PHX.02
    # * Added support for "exclude_free_cells" in the AOE. previously
    # * this boolean did exist, but there was never a function to filter
    # * out cells without an entity in it. This also greatly reduces lag
    # * when selecting skills with 20+ range.
    # *
    # * Fixed "Charm" System.
    # * Lecode used isAlly and isEnemy to determine which side the enemy/
    # * target was on, rather than using isAlly to determine if the target
    # * was an actual Ally of the user.
    # *
    # * This resulted in crazy situations where the ally and enemy arrays
    # * for a confused user were identical, resulting in the AI getting confused.
    # * Any confused AI will continue to beat up their own allies, until the
    # * confusion wears off, the user dies, or all their allies are dead.
    # *
    # * In these cases, the user will then proceed to attack the actual enemy.
    # * I believe that if the confused enemy has healing skills, he will heal
    # * and/or resurrect their teammates. This can cause even more hilarious
    # * situations where an enemy kills/revives/kills again their teammates.
    # *

    In addition to all of this, I also have 3 other plugins for general Utility, and my region and terrain plugins,

    Combine those with the changes to LeTBS.js, and the yanfly plugins, I estimate I have added around 4,000 lines of code minimum to my project.
     
    Last edited: Aug 12, 2019
  5. moldy

    moldy Veteran Veteran

    Messages:
    190
    Likes Received:
    28
    First Language:
    English
    I love this concept! It's basically the Reactive Abilities in Final Fantasy Tactics. Any way to replicate the counter magic ability? It basically forces the user to cast any offensive magic that was used on them back at the original attacker as soon as the original spell lands.
     
  6. Pharonix

    Pharonix Shadow Walker Veteran

    Messages:
    612
    Likes Received:
    267
    Location:
    Alpha Centauri Cluster
    First Language:
    English
    Primarily Uses:
    RMMV
    Should be easy

    S8 basically counter fireball with fireball?
    Should be simple with what ive built.
    I woukd just add another branch before the counter skill ti check if victim has state [counter magicks] and if so force the skill
    Otherwise, counter normally

    Should be able to write a snippet that works for the base 77.2B coubter code sometime this week, Ive been quite busy with work
     
  7. Pharonix

    Pharonix Shadow Walker Veteran

    Messages:
    612
    Likes Received:
    267
    Location:
    Alpha Centauri Cluster
    First Language:
    English
    Primarily Uses:
    RMMV
    Replace BattleManagerTBS.processCounterAttack with the below, and give it a shot
    Replace 666/777/888 with the state you want your character to be affected with to counter skills with the same skill.
    This is very crude, but should work

    Note:
    Replace 666 with the skill that will counter [Certain Hit] Attacks with the same skill
    Replace 777 with the skill that will counter [Physical] Attacks with the same skill
    Replace 888 with the skill that will counter [Magical] Attacks with the same skill

    If you only want to use Reactive Magic, then set the other 2 states to an unused ID

    If you want different states to work for cetain/physical attack

    Code:
    BattleManagerTBS.processCounterAttack = function (targets, subject, action) { //Reactive Abilities
        if (!action) return;
        this.setCursorCell(subject.getCell());
        targets.forEach(function (entity) {
            if (entity) {
                var dist = LeUtilities.distanceBetweenCells(subject.getCell(), entity.getCell());
                if (dist <= 1 && Math.random() < action.itemCnt(entity.battler())) {
                    hitType = $dataSkills[BattleManagerTBS.activeEntity()._lastAction].hitType; // 0=certain, 1=Physical, 2= Magical
                    if(BattleManagerTBS.activeEntity().battler().isStateAffected(666) && hitType==0) //Change this value to your "Full Counter Skill"
                    {
                        var skill = $dataSkills[BattleManagerTBS.activeEntity()._lastAction];
                        subject.battler().clearResult();
                        entity.lookAt(subject.getCell());
                        entity.addTextPopup("Counter");
                        entity.startSequence("counter");
                        this.forceAction(skill, entity);
                    }
                    else if(BattleManagerTBS.activeEntity().battler().isStateAffected(777) && hitType==1) //Change this value to your "Full Counter Skill"
                    {
                        var skill = $dataSkills[BattleManagerTBS.activeEntity()._lastAction];
                        subject.battler().clearResult();
                        entity.lookAt(subject.getCell());
                        entity.addTextPopup("Counter");
                        entity.startSequence("counter");
                        this.forceAction(skill, entity);
                    }
                    else if(BattleManagerTBS.activeEntity().battler().isStateAffected(888) && hitType==2) //Change this value to your "Full Counter Skill"
                    {
                        var skill = $dataSkills[BattleManagerTBS.activeEntity()._lastAction];
                        subject.battler().clearResult();
                        entity.lookAt(subject.getCell());
                        entity.addTextPopup("Counter");
                        entity.startSequence("counter");
                        this.forceAction(skill, entity);
                    }
                    else
                    {
                        var skill = $dataSkills[entity.battler().attackSkillId()];
                        subject.battler().clearResult();
                        entity.lookAt(subject.getCell());
                        entity.addTextPopup("Counter");
                        entity.startSequence("counter");
                        this.forceAction(skill, entity);
                    }
                }
            }
        }.bind(this));
    };

    Let me know if this crashes
     
  8. Adventurer_inc.

    Adventurer_inc. Technically a Programmer Veteran

    Messages:
    97
    Likes Received:
    40
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    This is the closest I could get using sequence conditioning. If anyone finds a better way to do it, I'm all ears.
    ezgif.com-crop.gif

    @Pharonix My memory is hazy but, I don't think .lastAction is part of the lecode's default code base. Also wouldn't the parameter action be lastAction? What would it look like if you hit multiple enemies and multiple enemies counter you simultaneously?
    Code:
    BattleManagerTBS.activeEntity()._lastAction
     
    Last edited: Aug 14, 2019
  9. Pharonix

    Pharonix Shadow Walker Veteran

    Messages:
    612
    Likes Received:
    267
    Location:
    Alpha Centauri Cluster
    First Language:
    English
    Primarily Uses:
    RMMV
    You are right.

    I added ._lastAction via the LastUsedItem.js plugin.

    Since I'm unable to find anything regarding distribution, I'm uploading it here unless told otherwise to remove it.

    =========
    If you hit multiple enemies, I believe, from what I remember, is they end up getting queued up through the Battle Manager.
    I'll run some tests later. It's 11pm here :)
     

    Attached Files:

  10. BrightIdeaProduction

    BrightIdeaProduction Veteran Veteran

    Messages:
    37
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Hey another question/thought. After meddling witth 0.772B for a few days, I wanted to try to use some interactive skills. Legend of Dragoon. Wild arms, etc style.

    http://sumrndm.site/timed-attack-core/

    Something like that. I added the Script into the 0.772B and while it didn't crash or anything it just, didn't do anything. Lol. :hswt2:

    My thoughts are something just isn't updating correctly / or conflicting with the scene update of sorts. Sadly My Java isn't the greatest and LeTBS core is a pretty hefty chunk of code :rswt

    Can someone point me in the general direction?

    or does someone know of another Script like the one listed above? Perhaps a snippet that is floating around already?
     
  11. Pharonix

    Pharonix Shadow Walker Veteran

    Messages:
    612
    Likes Received:
    267
    Location:
    Alpha Centauri Cluster
    First Language:
    English
    Primarily Uses:
    RMMV
    Pretty sure LeTBS doesnt use the normal attack functionns when invoking forceAction, that wont work.
    At leas nit wothout rewriting quite a few chunks of the core code.
     
  12. BrightIdeaProduction

    BrightIdeaProduction Veteran Veteran

    Messages:
    37
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    I figured it does considering it uses the Dmg formula from skill #1 to express the damage done to enemy.

    Edit: Furthermore it wont work on skills either.
     
    Last edited: Aug 17, 2019
  13. Pharonix

    Pharonix Shadow Walker Veteran

    Messages:
    612
    Likes Received:
    267
    Location:
    Alpha Centauri Cluster
    First Language:
    English
    Primarily Uses:
    RMMV
    Yeah, a custom Script would need to be made for LeTBS.
     
    BrightIdeaProduction likes this.
  14. BrightIdeaProduction

    BrightIdeaProduction Veteran Veteran

    Messages:
    37
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    well my hopes and dreams have died lmao
     
  15. BrightIdeaProduction

    BrightIdeaProduction Veteran Veteran

    Messages:
    37
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Think I found a work around but, as expected there would still be an issue.

    I found this during some digging: https://forums.rpgmakerweb.com/index.php?threads/quick-time-events-r2-26-11.71268/

    I was able to get it to work(ish) once again doesn't break anything or give strange errors. Even works in battle too by running a common event from the skill.

    upload_2019-8-17_0-1-57.png



    Common event.

    upload_2019-8-17_0-2-25.png



    The problem is that it calculates the damage before analyzing the input. D'oh! :frown:


    upload_2019-8-17_0-3-51.png


    Any thoughts how to make input required before checking for DMG?

    Saw some comments further back about .floating damage and forcing actions.

    Thanks in advance:hwink:
     

    Attached Files:

  16. BrightIdeaProduction

    BrightIdeaProduction Veteran Veteran

    Messages:
    37
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    When I tried to do this it freaked out on me. It acted like I had no one to select and wouldn't let me "Start Battle"
     
  17. Pharonix

    Pharonix Shadow Walker Veteran

    Messages:
    612
    Likes Received:
    267
    Location:
    Alpha Centauri Cluster
    First Language:
    English
    Primarily Uses:
    RMMV
    Thos is because common events run at the end of the skill
     
    BrightIdeaProduction likes this.
  18. BrightIdeaProduction

    BrightIdeaProduction Veteran Veteran

    Messages:
    37
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    So is there currently anyway to force a player to make a secondary action? I might still be able to string something interesting together if so. If not I'll have to wait to 0.8 :rswt
     
  19. Aezriel

    Aezriel Shadow Slayer Member

    Messages:
    16
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    So I've been using the Lecode Tactical Battle System for awhile now and I've ran into a problem.
    I'm trying to make a skill that allows the character to transform into something else. It will change the characters sprite in battle and change its class. I made the skill, gave it an animation, then i made a common event that when activated, changed the class of Actor 0001 to the class for the transformation and after that, it would change the sprite of actor 0001 to the sprite for the transformation. I use the skill in battle and the animation works, his class changes, but the sprite wont change mid battle. Is there a way to make this work?

    Common Event:
    upload_2019-8-18_17-55-32.png

    Skill:
    upload_2019-8-18_17-56-37.png
     
  20. Pharonix

    Pharonix Shadow Walker Veteran

    Messages:
    612
    Likes Received:
    267
    Location:
    Alpha Centauri Cluster
    First Language:
    English
    Primarily Uses:
    RMMV
    I was actually working on something like that. I actually got a "Transfigure Skill" working. Where it transformed actors/enemies into puppies.
    I'll try to get you the correct steps tomorrow.
     

Share This Page