Barrier Script Version 1.0 (Finished)

I thought I was seeing decimal points in my game too last night, but thought I was too tired and was just seeing things! Its probably a weird convert bug? I'll investigate it more.

Edit: I found the bug. Seems I didn't turn on the create barrier flag when one only used <HP Barrier: x>. I'll try to post the fix later on today (I'm on CST time, so its currently before noon in my timezone).
So far things are working with the project that I'm testing the script with.

However, while looking at the script I was reminded of the fact that the "penetrate", "shatter", and "opposite" effects are handled globally by being tied to a specific element. Would it be possible to have the option to handle this via notetags (for skills and such), instead?

For example, one specific attack that uses a normal-type element may be specifically designed to penetrate certain kinds of barriers, but cannot penetrate others, while the normal element isn't used for barrier penetration normally.
Actually, that is the intended plan in the final version. I just disabled the notetag for that in the meantime in version 0.94 (as I was re-writing the notetag code). The global for editing is to avoid a crash due to nil when we compare for it if you don't define one.

Edit: 0.94b posted now to fix the errors in 0.94a
I would love to use this script for a couple boss fights. Haven't started working on the game yet, but I will let you know if I have any problems when I do.
0.95 is now released. This should make it so that you can now refresh the barrier by recasting the skill. If you don't want enemies to be able to spam this skill, I would *highly* suggest either setting it to only be used on turn x + 0 (so it is only cast once ever), or add a cooldown to it (requires another script).

Plan is to look into the ability to heal the barriers next, though I am also on the road some during the next week, so that may take a little while.

Also...anyone know how to edit the initial title, so it can say version 0.95 and not 0.92a? I cannot find a button anywhere to do that.
Also...anyone know how to edit the initial title, so it can say version 0.95 and not 0.92a? I cannot find a button anywhere to do that.
When you edit your post (might need to be the original post), there should be a button somewhere in the lower right that says "Use Full Editor," and that will allow you to edit the title.
That worked, thanks! I was looking for a button on the main page to change it, as that seemed a good place to put it (for me).
Is there a way you could edit it to where, after a certain amount of turns, it reactivates? This would be cool for a challenging boss.
Directly...not sure. The battle system in RPGMaker is going to make that one tough due having to reset the states and the barrier, and it will be tough to do if the barrier is down. Though, I know that you can do it this way.

Under the battle troop event, add the command force action to the boss, and have them recast it every x turns (so use 5 + 5 turns if you want every 5). I recall in my game the boss still took a turn after the forced action, so it auto-reactivates that way, and the boss doesn't lose the turn either (unless you want them too, in which case I fixed that by adding a state that made them unable to move for 1 turn after adding the barrier). That should work for now, as I'm not sure adding a auto-reactivate is going to be doable without rewriting some methods (which starts to break other scripts).

Incidentally, this forced action method will also allow them to start with the barrier up on turn 0 if you wish that to occur.

I'll check into it though once I have healing of the barrier working properly. What I propose above should still work in the meantime.
I haven't started the project yet. I'm perusing the forums for scripts I'd like to use and came upon yours.

I'm also trying to get a custom script done but no one wants to reply to my thread.
What's the script? I'm still learning so been doing requests to learn (if I can do them that is). I could look at it once this is at version 1.0 and see if it is something I have an idea how to do.
Just gonna copy/paste. 

I got the idea of instead of characters just leveling up, their weapons and armor can as well. They level up with a Sudeki-like system. Every level, they get a point (2 at every 5 levels) to upgrade either HP, SP, Strength, Defense, Focus Spells (special abilities that can either do more damage or cast certain buffs), or Focus Power (allowing your Focus Spells to do more damage).

What I want to do is make it to where you gather materials to craft cores or find cores that can give your weapons or armor certain abilities or stat upgrades (like Double Attack, Triple Attack, Poison, Weaken, auto-buff, etc.). The first half of the game, you find cores, but in the second half, you can actually craft your own.

As you continue through the game, you will be able to upgrade the weapons and armors with items you find throughout the game that can increase the amount of core slots available.

You also will find items throughout the game that will permanently increase your stats.

I also want it where max level is 50.

Each character will have only one piece of armor and one weapon.

Also gonna try to make the game real-time battles if I can. And include chains. The higher your chains, the more damage you do, the more experience you get. In the first half of the game, you use gold, but in the second half of the game, you can use souls as currency for cores and core materials. Also, you need a total of 50,000 souls, along with 4 seals to get your old job back. Have it to where each monster drops a soul and you can retain them until the second half of the game where they're actually needed.

It seems like a lot, but I need a way for all this to work together.
Version 0.95a released. Added a damage pop-up under Yanfly's system, as well as an SE to play on hit. Ran out of time to add it to the default system, but that is pending.
Great idea of yours making a barrier skill script 🙂
I'd like to check it soon, hopefully can work well with my other scripts.
If I understood you correctly, would it be possible to implement this via modifying the default block skill in your game to add a barrier state with a single turn duration when used?
sure this is a possibilithy for that with tankentai you can almost do everything's
Great idea of yours making a barrier skill script 🙂

I'd like to check it soon, hopefully can work well with my other scripts.
Thanks, though you should probably thank spaceman5 for the idea, as I had never thought of it until the request was posted, and now, here I am using it in my own game even!
Well if that so then thanks to spaceman5 for the idea, and you for the script 🙂
And yes the script working great with my battle engine, though as we are expected, my pop up script poping "No Damage" when a shield is exist, don't worry that's being expected and it's a sign that your script worked nice. Keep up the good work.
With this latest update, if you have the barrier bar in Yanfly's system to update at -1 (the barrier's max HP), it just remains at 100% every time it takes damage. That is, if the barrier starts at 222 health, it will show a full bar at 222 health. Then if you take 50 damage, it will show a full bar at 172 health.
Yeah, didn't notice that due to having my barriers so low in health. Seems it was a bug that got introduced when I made it so that you could restart barriers by reapplying them, as it was refreshing then with the new HP. I have it fixed in my version of it, it required moving a function back to add_state to fix. I'll see if I can upload it sometime tomorrow.

Well if that so then thanks to spaceman5 for the idea, and you for the script 🙂
And yes the script working great with my battle engine, though as we are expected, my pop up script poping "No Damage" when a shield is exist, don't worry that's being expected and it's a sign that your script worked nice. Keep up the good work.
I added an item to game action called @result.shielded_hp. You might be able to use that in your pop-up script to set it to not show No Damage and the shield damage instead when @result.shieled_hp is not equal to zero. Just make sure to add a line that sets @result.shielded_hp = 0 after the pop-up script runs, else you may see weird double-popups. 
Thanks, though you should probably thank spaceman5 for the idea, as I had never thought of it until the request was posted, and now, here I am using it in my own game even!
I wasn't going to claim credit for this, but thank you! It makes me really happy to see this being both available for people to use and appreciated!

Original thread: https://forums.rpgmakerweb.com/threads/barrier-script-version-1-0-finished.31476/