Shield and Break system (Octopath traveler)

**Edit** Can confirm dodging no longer deducts shields, and that the shield impact notetag functions flawlessly. Great work!

Wow, I wasn't expecting such a positive and fruitful outcome on this! Thank you very much! I will definitely try this out when I get out of work tonight! The only other issue I've had between then and now, is the notetag to replenish shield stacks when the state ends isn't working for me, but as it's a fairly critical piece of code and nobody else has talked about it, I'm very confident that the problem is due to my ATB plugin not behaving with "turns" correctly. I can't even make "cannot move" states because in ATB if you can't move then a turn never passes and therefore the state never ends lol.

I'm absolutely not asking for a fix for that one, I've simply decided to work around it by only allowing regular enemies to be broken once, and my boss battles always work in phases anyways, so they can break once per phase. I'm cool with that, but I wanted to toss the incompatibility out there in case you get any further issues.
Hi. Awesome plugin. I actually prefer it over alternatives because how compatible it is with a variety of other plugins and how not overly complicated the code is. I wish I could put the whole information window below the battler sprite. My attempts at changing the position weren't successful, since the entire thing seems to be bound by the battler size. It becomes problematic with some of the smaller enemies. I would greatly appreciate any tips as I am not nearly as proficient with javascript as I was with ruby, and still that wasn't that great.
I've updated this again in order to fix a bug.
In the previous version if you used a notetag to modify the break state for a specific enemy all enemies would use the last state used as the break state instead of the one defined in the plugin parameters.
It's now fixed and the DBS notetag should only work for an individual enemy as advertised.

@rybamlot I don't understand exactly what you want to do. Make a mock up picture and I'll see if I can help.
Actually, can anyone test out this segment and see if it's working on their end or if it's just me?


<Custom Remove Effect>

user._sh = user._mSh;

</Custom Remove Effect>
That notetag works as advertised in my project with only the prerequiste plugins.
@rybamlot I don't understand exactly what you want to do. Make a mock up picture and I'll see if I can help.

I wanted to have the entire weakness window always underneath the battler and not over it. I finally figured it out by modifying the wy variable in Window_EnemyVisualSelect.prototype.refresh
All works perfectly now!
That notetag works as advertised in my project with only the prerequiste plugins.
Ahh it just occured to me. It's because of what I mentioned before. Buffs states core doesnt work for me, and it makes sense that plugin would allow that note tag. Damn that sucks. Thanks for helping me reach that at least.
You could probably try harcoding it then instead of relying on a notetag:

Code:
(function(){
var GBRS = Game_Battler.prototype.removeState
var BSID = 4 //replace 4 by your default break state id here
Game_Battler.prototype.removeState = function(stateId) {
    var eId = this._enemyId
    if ($dataEnemies[eId].meta.DBS) {BSID = eval($dataEnemies[eId].meta.DBS)}
    if (this.isStateAffected(stateId) && stateId === BSID ) {
this._sh = this._mSh
    }
GBRS.call(this,stateId)
};
})

Copy this in a text file name it whatever, save as a .js import in your project and see if it does the trick. Just put it below my plugin.
I'm rusty, but I'm like 95% sure that when states expire they get removed by calling that function so this should work.
**Edit** So, I managed to get BuffsStatesCore working correctly, turns out I'm a DUMMY and just had it named BuffStatesCore instead of BuffsStatesCore. Neither the original shield replenish notetag nor the new code are working however. Thought for sure this would have fixed it.

Unfortunately it didn't work 🙁 I put state 33 (my break state) into BSID as instructed, no change from before. Your efforts are hugely appreciated though.
Please delete this single post. I posted for help but quickly figured it out and can't figure out how to delete my posts.
Sorry to bump this, but I'm unclear on how to add shields to enemies.
The actors have pretty clear notetags to use, but I'm not seeing anything like that for enemies.
First help file section:

Code:
Set max shield notetags:
 *Order for max shield calculation: 
 *actor, class, equipment, passive states, states then floored
 *Notetags: <mSh: >, Ex: <mSh: num += 5>
[... ]
*Enemies are the same except you remove class and equipment calculations
Ah, in that case it's incompatible with my other scripts (FallenAngelOlivia's Octopath shield script is incompatible with the Grid Battle System in development by HimeWorks. Was hoping I could use this as an alternative).
Oh well. On to the next shield script...

shield.png
I never did get this plugin fully working, myself. I suspect compatibility as well. I don't get crashes like you did, but some aspects of it are non-functioning. It's a great plugin, just a shame about the conflicts.
sorry is there a way to make the shield icon and counter show up next to the actor rather than on the status menu?
My plugin does not currently offer that option. I have mostly stopped programming, so I am unlikely to add it in the foreseeable future, sorry.
My plugin does not currently offer that option. I have mostly stopped programming, so I am unlikely to add it in the foreseeable future, sorry.
no problem thank you for replying
Hi. I can't seem to make your plugin work in my game. The shield doesn't show up, and the effect doesn't work either after hitting an enemy with their weakness. I even put the effect as death to make it really obvious should it happen. But perhaps I am doing something wrong? I am sharing a few pics.

Thank you.


Hi there! I see nothing majorly wrong with the way your plugin is setup.
Could you share a screenshot of the console once you start a battle (press f12) and your plugin list?
This should allow me to see if it's an incompatibility between plugins you use or a bug within my own plugin.
Hey, thank you for responding! Here is my plugin list:


And the screenshot of the console right as the battle starts:

Original thread: https://forums.rpgmakerweb.com/threads/shield-and-break-system-octopath-traveler.99411/