Barrier Script Version 1.0 (Finished)

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. 
Actually I love when No Damage is poped up while the barrier is active, so the player won't know how many damage is done to the barrier because I don't draw the barrier hp gauge too. I believe this will make the game somewhat difficult because the player will not know when the barrier is exploded before the state expired, but thanks for noticing me that, =)
No problem. The feature is there if you change your mind.

Posted the version where if you set the HP on the barrier to be set equal to the max HP of the barrier, it doesn't auto-refresh the MaxHP to be the same as the current. I didn't change the version number due to this being a really minor change.

I hope to have either a 0.95b or 0.96 up this weekend, work's been busy this week so far.

Edit: 0.96 is posted! Took longer than I thought, but it adds the ability to have actors or enemies cast improved (or weaker) versions of the barrier skill (this way you can avoid having to create many version of the same skill), equipment can enhance (or weaken) barriers cast *on* that person, can set the maximum hp per barrier now, and you can heal barriers with items or skills by adding the notetag <HP Barrier: Restore> and it will apply whatever is in the damage box to the barrier.

For anyone who wants to write a damage pop-up, there is a new variable, @result.shielded_hp that you can access which stores the amount of damage done to the shield. Just be sure to set it to 0 once you are done with it.
FYI to all using the script, I had to rewrite the code after version 0.96. It seems the way I was applying the barrier as a state was causing targeting problems, as it was using the target's stats, not the caster's stats to apply the barrier. Version 0.97 will have it re-written so you can use skills or items instead to apply the barrier, and you can use the damage box to set up the formula (less notetags!). I'll keep 0.96 active in case someone just wants to stick with states and not redo all their tags/skills that use barriers, and have a new pastebin for 0.97 once it is debugged. 

I hope to have 0.97 debugged and posted in another week. It currently works with the damage box and a notetag to tell it this applies to a barrier, though there is a bug with equipment and a notetag I added that I still want to debug. I'll edit the main post once I finish figuring this out and post it. It might jump to 0.99 though (or maybe 1.0!) as I think there will be little left to add once this one posts.

PS - Hope the double post is ok, as the last post is from 9/9. Wanted to make sure those using the script where notified, and I don't think a notice is sent if I just do an edit.
i am sorry but due my internet problem I can't have access to your pastebin or mediafire can you send me the script via pm? or just in a code spoiller?

it will be really kind from you :3!
I could, though I'm close to posting the new version too. Do you want 0.96, which uses states for the barriers, or do you want the newer one which uses skills/items to apply the barrier?
the one you want this is for testing with tankentai : 3!
Ok, I'll send you the newest version then. It has a bug with the notetags on equips, so do not use those yet, but the rest works. To use the new version, go to skills or items, and set up the skill or item that creates the barrier. Use the damage box to set up the barrier formula, and set it to HP Restore (if it is anything but HP Restore, it will act as a normal skill or item). Then, add the following notetag:

<HP Barrier: Create>

This tells it that this skill is creating a barrier, and overrides using the skill to heal. This will then create a barrier that lasts until it is destroyed.

If you want a barrier that lasts only x turns, add this notetag:

<HP Barrier State: 113>

Where 113 is the state you want to link to the barrier (in my game its state 113). When the state expires, the barrier will be removed at the same time. So if you want barriers to only last until the battle ends, just set the linked state to remove at battle end, and set auto removal timing to none. If you want the barrier to last x turns, set the linked state to auto removal timing x actions or x turns.

If you want to have a skill heal a barrier and not create (or reset) a barrier, use this notetag:

<HP Barrier: Restore>

That's about all there is to it. I'll pm you the current version (0.96 and a half you could call it) in a few minutes.
thanks :3!

I also suggest to put something like 

A barriere defense who take consideration the actor line

exemple you

ACTOR  ACTOR (front

---------Barrier--------------

ACTOR ACTOR (back

in simple the barriere keep in consideration the first line actors defense

and when monster hit the back line ...this absord the damage :3!
thanks :3!

I also suggest to put something like 

A barriere defense who take consideration the actor line

exemple you

ACTOR  ACTOR (front

---------Barrier--------------

ACTOR ACTOR (back

in simple the barriere keep in consideration the first line actors defense

and when monster hit the back line ...this absord the damage :3!
Nice idea, though that would require a totally new script to do it well. Are you using a script that has a front and back row for battles?
Nice idea, though that would require a totally new script to do it well. Are you using a script that has a front and back row for battles?
not at all but I know zifee have this kind of battle system :/ 
Ah, I see. That would be a different way than I intended the barrier to be used, but maybe could do something to where a barrier could be shared between two battlers. That would then allow something like what you suggested to be able to be done.
yesh like that exemple when Eric activate is barrier this valor mind made him to send the barrier to Natasha when she have low hp :3!
The newest release seems to work great - the only thing I'm having an issue with is that setting the max HP via the actual script customization or adding "<HP Barrier MAX: x>" (with any value for x) to the skill notetag doesn't seem to actually limit it to whatever I set it to. For example, I have the HP Recover option set and the formula to be "(b.mhp/5) + (a.mat*2)", with the notetag "<HP Barrier MAX: 500>". However, if I save and playtest and kick the actor up to level 99, he can still create a shield that absorbs 1205 damage.
I think I found the error to that. In line 510 I have the following:

if(self.hp_barrier >= 100000)

Change that to

if(self.hp_barrier >= self.hp_barrier_set_max)

Let me know if that works for you until I can get a newer version uploaded.

Edit: Tested and it works, though the damage pop-up will report the value before the cutoff is applied. That is fixed in the newest version, which is now on the pastebin.
Yep, everything works great now - fantastic job, thanks much.
this script  make a row system : 3 http://forums.rpgmakerweb.com/index.php?/topic/28816-simple-battle-rows/
And...*drum roll* 1.0 is out. This fixes the equip bug, adds in the ability to let you heal and create a barrier at the same time (if you wish), and barriers can now regenerate a percent of their max HP per turn. I'll post version 1.0 over on the completed scripts forum once I get a chance.
Tried it. Works well.


Only one question- I tried loading a save game, it gave me a crash error about line 753 "undefined method > for nil:NilClass"


and error at 687 if I try to open the menu, same deal with undefined method.


Is there a way around this, or do I need to start a new game?


Understand that not being able to reload an old save is a minor setback at worst, I just want to see if I can.
@Crazy Rob: You have to start a new game. Sorry.

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