Shield and Break system (Octopath traveler)

Discussion in 'JS Plugin Releases (RMMV)' started by Astfgl66, Aug 28, 2018.

  1. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    590
    Likes Received:
    447
    First Language:
    French
    Shield and Break system from Octopath traveler.
    [​IMG]

    By Astfgl
    Credits: Yanfly

    Requirements: Yanfly's Core Engine, Battle Engine Core and Element core. Recommended Buffs and States Core.

    What it does:
    This plugin creates a shield counter for enemies or actors. This shield counter is set to a certain number at the beginning of battle, depending on notetags, and will decrease once a battler is hit by an attack of an element the battler is weak to.
    Once that shield counter reaches 0, a state will be inflicted on the battler, defined in parameters or on a case by case basis via notetags.
    And that's it for the shield and break system. What the state does, the effects it applies is all up to you. There are instructions in the help file if you want it to behave like Octopath Traveler's.

    Max shield number is determined by actor class equipment and states for actors, enemy type and states for enemies. It can also be dynamically modified in battle.

    The second part is a weakness icon display array.
    This plugin creates for all your enemies a global list that is saved for each enemy type. By default weaknesses are hidden, once you hit it however it will reveal itself, like you can see in the screenshot above.

    There are parameters and notetag available to make the shield break and/or weakness display available to actors or enemies only, to hide shield number (like you can see for the actor above), and more. You can for example only use the break system or only use the weakness display.

    Download: here

    How to use:
    Download, name it "AstfglSCB" without the quotes, import it, read the help file, set your parameters, and you should be all set.

    Terms of use: For reference, they are written in the plugin file. I pasted them here for your convenience:
    Code:
    // Free to use non commercially, commercially, repost and
    // edit, as long as the final product is kept under the same terms of use.
    // Credits required, any of Astfgl, Astgfl (Pierre MATEO), Pierre MATEO
    // Credits goes to yanfly for modified parts of battle engine core
    
    Modified as of v1.4 to allow commercial use for free.

    Shoutout goes to @Jiffy , for creating Octopath traveler's complete battle engine, with the BP system as well. Get it here.
    I believe my version to be more cutomizable, but Jiffy's looks great too and aside from reading the code I haven't tried it, so you should probably try out both and see for yourself.
    Unless you want a shield and break system for your actors too, in which case my plugin is your only solution for now.
    Oh and my version is not for commercial use if that matters to you.

    If you have any request, feel free to leave a message here or via PM.
    As usual, goodbye and happy making!
     
    Last edited: Sep 4, 2018
    #1
  2. SoSick.

    SoSick. Veteran Veteran

    Messages:
    209
    Likes Received:
    177
    Location:
    UK
    First Language:
    english
    Primarily Uses:
    RMMV
    Love that you have made this around yanfly plugins, works wonders with no problems.. hoping you soon make it possible to hide shield numbers! Many thanks :)
     
    #2
    Lonewulf123 likes this.
  3. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    590
    Likes Received:
    447
    First Language:
    French
    You can.
    Use the <shieldDisplay:false> notetag in an actor enemy or state notebox.
    It will display a ? symbol instead of a number, just like marsha in the screenshot
     
    #3
    Lonewulf123 and SoSick. like this.
  4. Neo Soul Gamer

    Neo Soul Gamer Veteran Veteran

    Messages:
    605
    Likes Received:
    320
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    N/A
    Seeing how this works with Yanfly's stuff, I'm pretty optimistic about it. But something about the icon display seems a little off. Have you considered placing the icons horizontally below the HP bar instead of over it? Also, for those who are using custom battle HUDs, is there any other way to display the element icons for the party?
     
    #4
  5. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    590
    Likes Received:
    447
    First Language:
    French
    I did not code a weakness display for actors. What you're seeing before the actor name is the actor's shield amount. I will not consider adding one as part of the HUD, as this would be hugely dependent on the custom HUD in itself and I can't write a compatibility patch for everyone and every HUD plugin available..
    I could probably add something similar to enemies below each actor sprite, though.

    It's kinda tough for the icon placement, not everyone has the hp bar plugin enabled. I'll look into allowing you to specify if you want the weakness display one or two lines below the name for those with the hp bar, but it will restrict enemy placement because the weakness display will overlap with the hud if you put the enemy too low then..
     
    #5
  6. Neo Soul Gamer

    Neo Soul Gamer Veteran Veteran

    Messages:
    605
    Likes Received:
    320
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    N/A
    Yup. So in other words, not worth coding because there are too many factors to consider. XD. I totally get it. I just figured I'd ask just in case. Thanks anyway!
     
    #6
  7. ThunderDragon32

    ThunderDragon32 Veteran Veteran

    Messages:
    59
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    N/A
    @Astfgl66
    Does the Weakness Display follow the enemies to other battles, so you wouldn't need to rediscover weaknesses?
    If this is already added this would be a cool option to disable/enable.
     
    #7
  8. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    590
    Likes Received:
    447
    First Language:
    French
    Yes the weakness display is saved by enemy type.
    I'll make it optionnal, good idea.
     
    #8
  9. ThunderDragon32

    ThunderDragon32 Veteran Veteran

    Messages:
    59
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    N/A
    @Astfgl66
    Another good feature to add is a notetag for a skill to allow weaknesses to be found.

    Or a ability for a actor where 1 undiscovered weakness will be autofound in the beginning of the battle, this is done in Octo path for one of the characters.
     
    #9
  10. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    590
    Likes Received:
    447
    First Language:
    French
    You can already do that with the following functions:
    Code:
    var ids = []
    $gameTroop.members().forEach(function(member){
        var eId = member._enemyId
        if (!ids.contains(eId)) {
            var dis = [];
            for (let i = 1; i < $dataSystem.elements.length; i ++){
                if (Astfgl.enemies.disWeak[eId][i] === 0 && member.elementRate(i) > eval(PluginManager.parameters("OT").defaultElemCutoff)) {dis.push(i)}
            }
            ids.push(eId)
            if (dis.length!==0) {
                var num = Math.floor(Math.random() * Math.floor(dis.length));
                Astfgl.enemies.disWeak[eId][dis[num]] = 1;
            }
        }
    })
    
    Put it in a battle start event or as a spell effect and it will reveal one random weakness for each enemy type.

    If you want it as a targeted ability for a single enemy: use the following in a skill notetag (from yanfly's skill core or action sequence)
    Code:
    var member = target
    var eId = member._enemyId
    var dis = [];
    for (let i = 1; i < $dataSystem.elements.length; i ++){
        if (Astfgl.enemies.disWeak[eId][i] === 0 && member.elementRate(i) > eval(PluginManager.parameters("OT").defaultElemCutoff)) {dis.push(i)}
    }
    if (dis.length!==0) {
        var num = Math.floor(Math.random() * Math.floor(dis.length));
        Astfgl.enemies.disWeak[eId][dis[num]] = 1;
    
    I'll implement them properly in the next update, but you can start using them right now with those script calls.
     
    Last edited: Sep 1, 2018
    #10
    SoSick. and ThunderDragon32 like this.
  11. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    590
    Likes Received:
    447
    First Language:
    French
    Hi everyone!
    I've released v1.4 which I think will be the last one for a while.
    It features the ability for specific enemies and actors not to use the shield system at all via the <shieldDisplay :none> notetag, the battler.revealRandomWeakness function and the $gameTroop.revealRandomWeakness function which do exactly what they're named after.

    You can also now delete know weaknesses after each fight using a parameter so they don't save.

    As of v1.4 I consider this feature complete and thus allow commercial use for free to. I will likely not be coming back to it unless there are bugs I missed.
    Have fun, and happy making!
     
    #11
    SoSick. likes this.
  12. ThunderDragon32

    ThunderDragon32 Veteran Veteran

    Messages:
    59
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    N/A
    @Astfgl66
    Not sure why..but when I used the updated version it completely didn't work.
    While when I went back to the old version everything was fine.
    Even updated Yanfly plugins..
     
    #12
  13. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    590
    Likes Received:
    447
    First Language:
    French
    This is not enough info to work with.
    What happened was there an error message?
    What's the console log when in battle?
     
    #13
  14. ThunderDragon32

    ThunderDragon32 Veteran Veteran

    Messages:
    59
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    N/A
    @Astfgl66
    Rpg maker MV Version 1.6.1
    The plugin seems to not work at all, no error in game but the console does say something about a error.
     

    Attached Files:

    #14
  15. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    590
    Likes Received:
    447
    First Language:
    French
    Alright I've updated it, it looks like I missed a bracket somewhere.
    Works fine on my end now.
     
    #15
  16. Anohe1

    Anohe1 Villager Member

    Messages:
    6
    Likes Received:
    1
    First Language:
    French
    Primarily Uses:
    RMMV
    please how to get it working for enemies
     
    #16
  17. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    590
    Likes Received:
    447
    First Language:
    French
    Please elaborate what might be your problem.
     
    #17
  18. Anohe1

    Anohe1 Villager Member

    Messages:
    6
    Likes Received:
    1
    First Language:
    French
    Primarily Uses:
    RMMV
    No it is working I just messed up things thank you very much
     
    #18

Share This Page