Barrier Script, Version 1.1
by bgillisp
Introduction
This script allows you to create a state that will add a barrier to a character. All attacks to the character will hit the barrier instead of their HP, until the barrier falls. Also, barriers can fall due to time running out and will be auto-removed at that point.
Features
Adds a barrier which can be used to protect characters until the barrier falls.
How to Use
-Add the script in the materials section, but below main
-Start a new game to use! If you don't, some of the variables will not exist, and it WILL crash when you add the barrier.
-If you have any battle engines, you may wish to add this below the battle engine script. The script currently works with the default battle engine and Yanfly's, use with other battle engines at your own risk.
-To add a barrier, first add a skill which creates a barrier. Then, in the damage field, set it to HP Restore, and enter in the formula to create the barrier. Then, add the notetag <HP Barrier: Create> in the notebox of the skill or item which creates the barrier. Once you do this, the barrier will last until it runs out of HP.
If you wish the barrier to only last x turns or until the end of battle, you can link the barrier to a state which when the state leaves, the barrier is removed. Directions for that are in the script header.
You can heal your barriers with skills or items too! To do this, set the item or skill to be hp restore, and use the damage formula box to set it up. Then, add the notetag <HP Barrier: Restore> in the notes box to tell it to apply this to a barrier, and not an actor or enemy.
Do not ever use <HP Barrier: Restore> and <HP Barrier: Create> in the same note box. I have no idea what will happen if you do that, as the script is not meant to handle that.
Also, you can set a barrier's max HP to block with the notetag: <HP Barrier MAX: x>, where x is the highest HP you ever want that barrier to have.
Finally, you can make it so that equipment enhances or weakens your barriers, and actors and enemies can have stronger or weaker barriers than the norm. To do this, add the notetag <HP Barrier Modify: x>, where x is the number you want multiplied to the barrier (use 2 to double all barriers, 0.5 to half all barriers, 0 to make no barriers work cast by that person, etc).
Demo
None yet, soon.
Script
Version 1.1, released 10.23.2014:
FAQ
Q: I add the notetag and it didn't work!
A: Spacing is important. Did you remember the space between the : and the number? Also I think it is case-sensitive, so make sure to use caps for HP.
Q: I added an equip tag and now they are casting really huge barriers!
A: I have the script set up to where you post the number that is being multiplied, not the percent. So if you want that new sword to make it so that barriers cast by them are 2.5 times as strong as before, enter in 2.5, not 250.
Q: Why do I keep hearing the canceling sound effect when the barrier is hit? I set it up to use sound effect x instead!
A: I put in a rescue command to call the cancel effect if your sound effect is not found or loaded properly, which will load Cancel2 from the RTP if your file fails to load (this is to avoid it crashing and killing the game if your file ever gets corrupted). Check and make sure you entered in your file name correctly and that the sound effect is in the proper format.
Q: Will you convert this to MV?
A: No. Yanfly beat me to the punch with their excellent absorption barrier script, which has the added advantage of being compatible with all Yanfly scripts. So for that reason I have put the MV conversion of this script on hold, and recommend any MV users use Yanfly's absorption barrier script instead.
Author's Notes
This is now version 1.0! I would like to thank spaceman5 for the idea (and testing), and Zevia, Supernurse, and Ryidamist for the bug catches and posts on the board under Scripts under Development, and anyone else who tested it and didn't post suggestions.
Edit: Version 1.1 is out now. This adds the ability to have the barrier only block part of the damage taken, and also adds the ability to play an animation when the barrier falls. The animation will attempt to play while the battle still goes on, so it works best with ATB systems.
Terms of Use
-Free for use in commercial and non-commercial games with credit given.
Known Bugs:
In Yanfly's engine the bar for the HP of the shield is in an odd place after battles. This is due to how Yanfly rearranged the HP/MP bars. At the moment unsure how to fix and make it still work with the default engine too, so if you use Yanfly you may want to purge all barriers after battles end by linking them to a state which is removed at battle end.
Version 1.1 requires starting a new game, else the game will crash the first time anyone takes damage in a battle.
by bgillisp
Introduction
This script allows you to create a state that will add a barrier to a character. All attacks to the character will hit the barrier instead of their HP, until the barrier falls. Also, barriers can fall due to time running out and will be auto-removed at that point.
Features
Adds a barrier which can be used to protect characters until the barrier falls.
How to Use
-Add the script in the materials section, but below main
-Start a new game to use! If you don't, some of the variables will not exist, and it WILL crash when you add the barrier.
-If you have any battle engines, you may wish to add this below the battle engine script. The script currently works with the default battle engine and Yanfly's, use with other battle engines at your own risk.
-To add a barrier, first add a skill which creates a barrier. Then, in the damage field, set it to HP Restore, and enter in the formula to create the barrier. Then, add the notetag <HP Barrier: Create> in the notebox of the skill or item which creates the barrier. Once you do this, the barrier will last until it runs out of HP.
If you wish the barrier to only last x turns or until the end of battle, you can link the barrier to a state which when the state leaves, the barrier is removed. Directions for that are in the script header.
You can heal your barriers with skills or items too! To do this, set the item or skill to be hp restore, and use the damage formula box to set it up. Then, add the notetag <HP Barrier: Restore> in the notes box to tell it to apply this to a barrier, and not an actor or enemy.
Do not ever use <HP Barrier: Restore> and <HP Barrier: Create> in the same note box. I have no idea what will happen if you do that, as the script is not meant to handle that.
Also, you can set a barrier's max HP to block with the notetag: <HP Barrier MAX: x>, where x is the highest HP you ever want that barrier to have.
Finally, you can make it so that equipment enhances or weakens your barriers, and actors and enemies can have stronger or weaker barriers than the norm. To do this, add the notetag <HP Barrier Modify: x>, where x is the number you want multiplied to the barrier (use 2 to double all barriers, 0.5 to half all barriers, 0 to make no barriers work cast by that person, etc).
Demo
None yet, soon.
Script
Version 1.1, released 10.23.2014:
FAQ
Q: I add the notetag and it didn't work!
A: Spacing is important. Did you remember the space between the : and the number? Also I think it is case-sensitive, so make sure to use caps for HP.
Q: I added an equip tag and now they are casting really huge barriers!
A: I have the script set up to where you post the number that is being multiplied, not the percent. So if you want that new sword to make it so that barriers cast by them are 2.5 times as strong as before, enter in 2.5, not 250.
Q: Why do I keep hearing the canceling sound effect when the barrier is hit? I set it up to use sound effect x instead!
A: I put in a rescue command to call the cancel effect if your sound effect is not found or loaded properly, which will load Cancel2 from the RTP if your file fails to load (this is to avoid it crashing and killing the game if your file ever gets corrupted). Check and make sure you entered in your file name correctly and that the sound effect is in the proper format.
Q: Will you convert this to MV?
A: No. Yanfly beat me to the punch with their excellent absorption barrier script, which has the added advantage of being compatible with all Yanfly scripts. So for that reason I have put the MV conversion of this script on hold, and recommend any MV users use Yanfly's absorption barrier script instead.
Author's Notes
This is now version 1.0! I would like to thank spaceman5 for the idea (and testing), and Zevia, Supernurse, and Ryidamist for the bug catches and posts on the board under Scripts under Development, and anyone else who tested it and didn't post suggestions.
Edit: Version 1.1 is out now. This adds the ability to have the barrier only block part of the damage taken, and also adds the ability to play an animation when the barrier falls. The animation will attempt to play while the battle still goes on, so it works best with ATB systems.
Terms of Use
-Free for use in commercial and non-commercial games with credit given.
Known Bugs:
In Yanfly's engine the bar for the HP of the shield is in an odd place after battles. This is due to how Yanfly rearranged the HP/MP bars. At the moment unsure how to fix and make it still work with the default engine too, so if you use Yanfly you may want to purge all barriers after battles end by linking them to a state which is removed at battle end.
Version 1.1 requires starting a new game, else the game will crash the first time anyone takes damage in a battle.
Last edited:

