Lecode Tactical Battle System 0.77.2B

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

  1. BrightIdeaProduction

    BrightIdeaProduction Veteran Veteran

    Messages:
    56
    Likes Received:
    2
    First Language:
    English
    Primarily Uses:
    RMMV
    Oh drat. Ok well thank you for the reply
     
  2. Aezriel

    Aezriel Shadow Slayer Member

    Messages:
    16
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Whenever I'm in a battle and I press the shift key, the screen goes to the upper right corner then says "Cannot read property 'x' of null"
    Anyone know whats going on?
    upload_2019-8-30_19-7-53.png
    Console:
    upload_2019-8-30_19-8-28.png
     
  3. Pharonix

    Pharonix Shadow Walker Veteran

    Messages:
    634
    Likes Received:
    274
    Location:
    Alpha Centauri Cluster
    First Language:
    English
    Primarily Uses:
    RMMV
    I've seen this.
    Sometimes, there's an issue where it registers "Shift" as the run key, and since there's... well no player, it crashes.
    I haven't had this issue in a while, so I'm not sure how to fix it exactly.
     
  4. Aezriel

    Aezriel Shadow Slayer Member

    Messages:
    16
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    I could try finding a plugin that allows you to disable sprinting by using a script, and make that script activate every time the player battles someone/something

    Edit: I found one http://www.yanfly.moe/wiki/Dash_Toggle_(YEP)
     
  5. Doktor_Q

    Doktor_Q I'm not a real doktor, but I am a real Q Veteran

    Messages:
    600
    Likes Received:
    333
    Location:
    Denial
    First Language:
    English
    Primarily Uses:
    RMMV
    @Aezriel It goes to the upper left because it's going into the "free look" mode, which is set to move toward the last click target, even when the target isn't active- by default, it'll be in the top left corner when inactive. You can optionally just disable free look.
     
  6. Lucary

    Lucary Dreamful Newbie Member

    Messages:
    4
    Likes Received:
    0
    Location:
    Sweden
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi guys, I recently started a project and I would love to use this battle system but I am struggling to really understand how to make it work properly even after looking at the demo and the documentation seems to be incomplete (?). Is there any guide or tutorial for how to set up and get going with LeBTS? Any help would be highly appreciated, I've spent quite a while agonizing over this ^^'

    Thanks in advance.
     
  7. BluePersonMan

    BluePersonMan Warper Member

    Messages:
    3
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    I Mean the amount of plugins you can have
     
  8. Lucary

    Lucary Dreamful Newbie Member

    Messages:
    4
    Likes Received:
    0
    Location:
    Sweden
    First Language:
    English
    Primarily Uses:
    RMMV
    As far as I know, you have unlimited slots, to add new plugins you scroll to the bottom of the list and double click on the blank slot. Once you put something there a new blank slot will appear underneath. If that doesn't work or you want to put in many plugins at once you can also copypaste plugins into the plugin manager from another project or folder. There should always be a blank space for you to click.
     
  9. UniqueName

    UniqueName Veteran Veteran

    Messages:
    38
    Likes Received:
    5
    First Language:
    Russian
    Primarily Uses:
    Other
    Sup guys, I noticed that "Rush" skill from demo version can be used as ranged skill if there's an obstacle between the user and the target
    in other words if there's an obstacle that doesnt block line of sight it prevents character from reaching the target but does not prevent damage
    is there any way to make that skill damage only if you can reach the target?
     
  10. Adventurer_inc.

    Adventurer_inc. Technically a Programmer Veteran

    Messages:
    99
    Likes Received:
    40
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    I had the same problem, however, my solution might not be exactly what you want.
    Find the "rush" sequence in the Config.js file and replace:
    Code:
    "effects: {aoe}_battlers, current_obj, obj_anim",
    with
    Code:
    "script: BattleManagerTBS.activeEntity()._sequenceManager._savedCells['front'] = [BattleManagerTBS.activeEntity().getForwardCell()];",
    "map_effects: saved(front), current_obj, obj_anim",
    
    What does this do exactly?
    It strikes the square directly in front of you, instead of the selected target at the cursor. This means that the object blocking you is damageable, you will attack it.

    Why do this?
    Although the most direct solution is conditional sequencing, if you don't strike a target, the strike animation won't play. Map_effect strikes the maps so the animation always plays.

    Will this cause bugs?
    This shouldn't cause bugs outside of the core scripts because none of the core scripts was touched. However, dashing through allies will cause you to indirectly damage them.

    On to newer things: Have anyone figured out how to do First Strike: Counterattack strike before the initial hit. This may kill attacking targets and not allow them to attack.
     
  11. Pharonix

    Pharonix Shadow Walker Veteran

    Messages:
    634
    Likes Received:
    274
    Location:
    Alpha Centauri Cluster
    First Language:
    English
    Primarily Uses:
    RMMV
    Do you mean you counter BEFORE the enemy attacks you?

    Thats interesting
    I could probably do that with my edited system.
     
  12. Adventurer_inc.

    Adventurer_inc. Technically a Programmer Veteran

    Messages:
    99
    Likes Received:
    40
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    @Pharonix That is exactly what I meant. I couldn't figure it out months ago and decided to tackle it again. :|
     
  13. Pharonix

    Pharonix Shadow Walker Veteran

    Messages:
    634
    Likes Received:
    274
    Location:
    Alpha Centauri Cluster
    First Language:
    English
    Primarily Uses:
    RMMV
    I'm working on an idea,
    It involves cloning processCounterAttack and renaming to processPreCounter
    For now, it'll just counter everthing(it should anyway) with "attack" but I gotta add stuff in, and test.

    I'll let you know, maybe this weekend.

    EDIT: Well that didn't work at all lol.
    This is gonna be much more complicated.
     
    Last edited: Sep 5, 2019
    Adventurer_inc. likes this.
  14. UniqueName

    UniqueName Veteran Veteran

    Messages:
    38
    Likes Received:
    5
    First Language:
    Russian
    Primarily Uses:
    Other
    Wow it really works thank you
    I wonder where did you find that script part
    Did you look it up in the main code?
     
  15. Danielcross

    Danielcross Veteran Veteran

    Messages:
    75
    Likes Received:
    7
    First Language:
    English
    Primarily Uses:
    RMMV
    Does anyone know how to change the skill behind counterattack?

    Specifically, to have it work when the character is attacked in square (0) instead of just circle(0)
     
  16. Pharonix

    Pharonix Shadow Walker Veteran

    Messages:
    634
    Likes Received:
    274
    Location:
    Alpha Centauri Cluster
    First Language:
    English
    Primarily Uses:
    RMMV
    That would be me, but I added like 100+ lines of code to fully customize my counter system.
     
  17. Danielcross

    Danielcross Veteran Veteran

    Messages:
    75
    Likes Received:
    7
    First Language:
    English
    Primarily Uses:
    RMMV
    Wanna give me a hint on where to start? :D

    I just want it so characters can counteratk enemies that hit them diagonally as well as in the four cardinal directions.
     
  18. Pharonix

    Pharonix Shadow Walker Veteran

    Messages:
    634
    Likes Received:
    274
    Location:
    Alpha Centauri Cluster
    First Language:
    English
    Primarily Uses:
    RMMV
    First off, Do counters work in your project?
    If you grabbed Chaosicaa's LeTBS 0.77.2B Demo, then you should see the function processCounterAttack in LeTBS.js

    This gets the distance between the entity getting attacked, and the person attacking.
    And if the "distance" is less than or equal to '1' then do counters.
    Code:
    BattleManagerTBS.processCounterAttack = function (targets, subject, action) {
        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())) {
                    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));
    };

    Unfortunately, this actually treats diagonals as "2" because you can't actually... move diagonally
    Because of this, you'll need to add a new function to LeUtilities


    Code:
    LeUtilities.isDiagonal = function (a, b) {
        return (Math.abs(a.x - b.x)==1) && (Math.abs(a.y - b.y)==1);
    };
    Put this right below distanceBetweenCells
    upload_2019-9-13_7-9-4.png

    This little function, returns whether or not the X and Y position of either entity is 1 away(covers top-left, top-right, bottom-left, bottom-right)
    as all diagonals are 1-x and 1-y position away
    This is needed to tell the system that "Diagonal attacks are fine for counters"

    Then You'll need to update the ProcessCounterAttack function to allow for this new function to work
    Here's the change,
    We set var isDiag to the result of our new function, then use it as an OR gate combined with dist<=1

    Code:
    BattleManagerTBS.processCounterAttack = function (targets, subject, action) {
        if (!action) return;
        this.setCursorCell(subject.getCell());
        targets.forEach(function (entity) {
            if (entity) {
                var dist = LeUtilities.distanceBetweenCells(subject.getCell(), entity.getCell());
                var isDiag = LeUtilities.isDiagonal(subject.getCell(), entity.getCell());
                if ((dist <= 1 || isDiag) && Math.random() < action.itemCnt(entity.battler())) {
                    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));
    };
    upload_2019-9-13_7-14-16.png
    Now what this says is
    if either distance<=1 or they're diagonal
    AND The math.random thing works out
    then do the counter stuff.

    This should work, as it isn't nearly as... intricate as mine.
    My system actually treats diagonals as >1, but I may actually add these changes in lol.
     
  19. Jomarcenter

    Jomarcenter jomarcenter-MJM Veteran

    Messages:
    1,231
    Likes Received:
    161
    Location:
    philippines
    First Language:
    ENGLISH
    Primarily Uses:
    RMMV
    the github link give me a 404
     
  20. pulsusego

    pulsusego Villager Member

    Messages:
    16
    Likes Received:
    13
    First Language:
    English
    Primarily Uses:
    RMMV
    Been working a lot on the, ah.. 'infrastructure' of the game while waiting for 0.8, setting up tables in google sheets that help autogenerate items and such with varied stats (to copy/paste into the game's text/database files). But I come back to check on things fairly regularly, and skimming through gave me a thought. Is it possible to make characters exert a sort of 'exclusion zone' around them that prevents movement, like an obstacle that does not block LoS? I don't think this is currently doable to be honest, given that I remember a while back that there wasn't a[t least a reasonably approachable] method of implementing 'large' units (2x2, 3x3, etc.), but as this would be based on a regular 1x1 unit simply with the surrounding tiles impassable, I thought it might be worth a shot to ask. I wouldn't be sure where to begin with trying it out though- maybe auras could be used somehow?

    @Jomarcenter that's odd, hang on I'll check then edit the post..
    Right, so I'd never even realized there were demo files for 0.8 available in any way, which is interesting lol.. but for now, I think you'd have to stick with the 0.77.2 Update link, the latest officially released build. That, and chaosicaa's demo setup as reference material. Maybe the 0.8 links are being replaced or some such? We'll see soon enough, I'm sure.
     
    Last edited: Sep 14, 2019

Share This Page