Shield States

Liquidize

Caffeine Overload
Developer
Joined
Nov 1, 2015
Messages
466
Reaction score
459
First Language
English
Primarily Uses
RMMV
Anima - Shield States v1.07
by Liquidize​
Introduction
This is a plugin that was requested in the request section. Anima Shield States is a plugin that provides the user with the ability to add different types of "Shields" to actors and enemies. These shields are simple states in the database with special notetags to enable the shield. When an actor or enemy has a shield, the shield will either absorb or reflect some of the damage that the actor or enemy was meant to take. In the process if the shield(s) reflect or absorb all the damage, then the actor or enemy takes no damage. Otherwise the actor or enemy will take all the left over damage. Shields have "health" and when that health is depleted, the shield is removed, unless the shield is set to be persistent. Upon removal of the shield the actor also loses the state. Shields get their Health pool through a formula that works similar to how damage formulas work, except in a notetag. Meaning you are capable of using any variable, or javascript code within the formula for the shields. Shields can also regenerate their HP over time (turns). At the end of an actors turn, a shield if it is set to do so, will regenerate a percentage of the shields maximum health. This allows for persistent shields that can be used as passives that need time to recharge. Shields can also be given element weaknesses, using a notetag and supplying the element ids separated by a comma. You are then able to apply a weakness rate that allows damage done to the shield to be multiplied to deal more damage against specific shields (e.g: If a shield is weak to fire, fire element abilities could deal 2x the damage.) Shields can be bypassed by using special notetags on any type of game object. Examples of these could be: Actors, Enemies, Items, Weapons, Armors, Skills, or States. These bypasses can be given a type of shield to bypass: all, certain hit shields, magic, or physical. There also exist an option for 'none', but that is set by default if the notetags don't exist and means that a particular ability is unable to bypass any shield. The visual aspect of a shield is through the usage of status icons. If a shield state is given a status icon, then when that status icon is drawn in any menu or scene a bar(similar to Health and Mana for actors) is drawn on the icon. This bar is customizable meaing you are able to change the gradient colors, have the bar display under the icon, and even on the icon itself. For more information see the request thread here: http://forums.rpgmakerweb.com/index.php?/topic/51005-stoneskin-damage-wall-state/

Features

- Add absorption, reflection, mana, or mana reflection shields to states

- Specify the shields health pool via a formula similar too damage formulas.

- Apply bonus damage if a shield is weak to a specific element

- Bypass shields of a specific type using note tags on states,items,skills,actors,enemies,or equipment

- Have shields that persist till you manually remove the state, sorta like passives.

- Have shields that can regenerate their health pool over time through the course of battle (at the end of the actors/enemies turn).

- Have a nifty gauge on your status icons that show the shields health pool, with changeable colors.

- Possibly more? :p

Video
Basic Setup Video

 Screen Shot

(See the gauges in action!)

How to Use
See help for detailed how to use information. A tutorial video will be coming soon!
 
Script v1.07

https://bitbucket.org/liquidize/anima-framework/raw/3c4a5c9e61dd2e223e4b309b242082fb6a77f405/Shield%20States/Anima_ShieldStates.js

FAQ
Q: Does this work with Yanflys plugins?
A: Yes, except AutoPassiveStates (it works, but the shields are not applied due to how AutoPassiveStates work. You can still use this and just apply states normally).

Q: Can i request features?
A: I suppose so.

Credit and Thanks
- Liquidize
 
Terms of Use:
This script is free for commercial and non-commercial use, just credit Liquidize or "Anima Framework" in your credits :) .
 
Last edited by a moderator:

Nohmaan

Veteran
Veteran
Joined
Jul 7, 2012
Messages
138
Reaction score
33
First Language
English
Yahoo!  Cant wait to try it out!

Looks like when I case Cure on someone with Shield state is gives me TypeError 'Cannot read property 'shield' of null'

TypeError: Cannot read property 'shield' of null at Game_Actor.equipBypassShields (/D:/Profile%20Data/Thisguy/Documents/RPGMV/TEST_GAME/js/plugins/Anima_ShieldStates.js:583) at Game_Actor.Game_Battler.allBypassShields (/D:/Profile%20Data/Thisguy/Documents/RPGMV/TEST_GAME/js/plugins/Anima_ShieldStates.js:527) at Game_Action.canBypassShield (/D:/Profile%20Data/Thisguy/Documents/RPGMV/TEST_GAME/js/plugins/Anima_ShieldStates.js:669) at Game_Action.executeDamage (/D:/Profile%20Data/Thisguy/Documents/RPGMV/TEST_GAME/js/plugins/Anima_ShieldStates.js:620) at Game_Action.apply (rpg_objects.js:1657) at Game_Action.apply (/D:/Profile%20Data/Thisguy/Documents/RPGMV/TEST_GAME/js/plugins/YEP_BattleEngineCore.js:2513) at Game_Action.apply (/D:/Profile%20Data/Thisguy/Documents/RPGMV/TEST_GAME/js/plugins/YEP_SkillCore.js:947) at Function.BattleManager.invokeNormalAction (rpg_managers.js:2181) at Function.BattleManager.invokeAction (/D:/Profile%20Data/Thisguy/Documents/RPGMV/TEST_GAME/js/plugins/YEP_BattleEngineCore.js:1357) at Function.<anonymous> (/D:/Profile%20Data/Thisguy/Documents/RPGMV/TEST_GAME/js/plugins/YEP_BattleEngineCore.js:1900)The shield state itself is:

Code:
<Absorb Shield><Shield Type: all><Shield Formula>a.mhp * 50</Shield Formula>
 
Last edited by a moderator:

RogdagoR

Veteran
Veteran
Joined
Oct 1, 2015
Messages
127
Reaction score
29
First Language
Italian
Is it possible to put the shield's gauge over the character's hp?
 

Nohmaan

Veteran
Veteran
Joined
Jul 7, 2012
Messages
138
Reaction score
33
First Language
English
Is it possible to put the shield's gauge over the character's hp?
That was discussed in the request thread, but the main problem with it was that it wasn't conducive to multiple shield states.  So it may be doable but it would likely require that characters can only have 1 shield state at a time (unless the bar was only drawn when damage was being applied).
 

Taemien

Veteran
Veteran
Joined
Sep 11, 2015
Messages
79
Reaction score
14
First Language
English
Primarily Uses
Found a graphical glitch.

When you refresh the state, it does not update the gauge, however the amount absorbed is refreshed. When the old gauge depletes, it disappears including the state icon. However the refreshed shield is still active until it fades from damage. If you reapply the state after that happens it works normally. If you reapply it before it happens the icon and gauge does not appear.

Here's the formula I'm using in case you need a reference:

<Absorb Shield><Shield Formula> value = 3 * a.mdf;</Shield Formula>Functionally everything works as I expected it to. Just that gauge glitch is happening.

-Edit to prevent double posting:

Actually did find an error when enemies apply the state. The icon shows up on the enemy but no gauge (not sure if this is intended or not). In addition when attacking the enemy to deal damage I get an error:

TypeError

Cannot read property 'shield' of null

I'm using the same formula as above. I also tried with a static value (rather than use the caster's mdf) and got the same error.
 
Last edited by a moderator:

RogdagoR

Veteran
Veteran
Joined
Oct 1, 2015
Messages
127
Reaction score
29
First Language
Italian
That was discussed in the request thread, but the main problem with it was that it wasn't conducive to multiple shield states.  So it may be doable but it would likely require that characters can only have 1 shield state at a time (unless the bar was only drawn when damage was being applied).
Well but it can be an option, reflect and other shields can work once, or just if one want just the shield stuff and put a secondary gauge over hp with different color, like in the fighting games with multi hp gauges
 

Liquidize

Caffeine Overload
Developer
Joined
Nov 1, 2015
Messages
466
Reaction score
459
First Language
English
Primarily Uses
RMMV
Last edited by a moderator:

Nohmaan

Veteran
Veteran
Joined
Jul 7, 2012
Messages
138
Reaction score
33
First Language
English
The bug with the type error you are all experiencing will be fixed within the hour.

EDIT: The type error bug has been fixed, you can get the the fixed version here: https://bitbucket.org/liquidize/anima-framework/raw/6bedefc1aeb920e816aa62b1cf3d70ae9e2cc2e5/Shield%20States/Anima_ShieldStates.js or in Opening Post.

In regards to the graphical glitch. I know it exists, I'm not entirely sure why its occurring, but it will be fixed sometime in the future.
This turned out really nice, I'm very impressed!
 

Liquidize

Caffeine Overload
Developer
Joined
Nov 1, 2015
Messages
466
Reaction score
459
First Language
English
Primarily Uses
RMMV
I'm glad you like it, I am willing to take suggestions on features for future versions.
 

Roguedeus

It's never too late to procrastinate...
Veteran
Joined
Mar 19, 2013
Messages
527
Reaction score
106
First Language
English
Primarily Uses
N/A
Just curious. Did you know that the Shield Rate: (when combined with a guarding actor) can result in the damage being applied as a float? Causing current HP to be a float as well?

I'm guessing this may also be the case for the other rates.

Also... Does the bar merely reflect the default HP bar? Your screen shot is so much better looking!

15_1122_shieldIssue_1.PNG

Edit:

Could I request the parameter option to set the bar to be thinner?

Also... Is there a feature note tag that allows the shield to regenerate? I could be totally missing it. :D
 
Last edited by a moderator:

Liquidize

Caffeine Overload
Developer
Joined
Nov 1, 2015
Messages
466
Reaction score
459
First Language
English
Primarily Uses
RMMV
@Roguedeus

1. No, I did not know this! Thank you for letting me know, I'll fix this with the next update.

2. Yes, it just uses the default drawGauge function. The screenshot is a screenshot of my game/testing ground, and in it I also have the "PrettierGauges" plugin installed. You can get that here: http://forums.rpgmakerweb.com/index.php?/topic/47077-prettier-gauges/  Just install it under my plugin.

3. Setting the bar to be thinner, Uhm I suppose this can be done.

4. use the notetag <Shield Heal Rate: x%> or <shealrate: x%> it will regenerate the percentage given of the shields max hp at the end of that actor/enemies turn. I would add real time regeneration, however other than actually using literal real time, i'm not quite sure how to go about it.

Some other things to note, I didn't take into account healing abilities, so heals from allies will not go through the shield. This is coming in a future update as another note tag. That way it adds more flexibility so you can have "Absolute" shields that block absolutely everything, or "Opposition" shields that only block opponent actions.  

I am looking into another way of actually making shields though, because currently its a lot of notetags and unless that is okay with you all, it may be a bit of a hassle?
 
Last edited by a moderator:

Roguedeus

It's never too late to procrastinate...
Veteran
Joined
Mar 19, 2013
Messages
527
Reaction score
106
First Language
English
Primarily Uses
N/A
Thanks for the info!

Can I suggest the option of a formula regeneration per turn? Rather than just a percentage?

edit:

Also, the more options the better IMO. The way you've got it set up now is the way I prefer honestly. I like being able to customize the look and the function of individual states. All the way down to the colors of the bar. You've done a great job.

If you are ever interested in making an Armor plugin... (as in alternative health bars) I have a VXAce armor mechanic I wrote that is gathering dust for me now. I am guessing that you would be able to make it much better than I did. ;)
 
Last edited by a moderator:

Liquidize

Caffeine Overload
Developer
Joined
Nov 1, 2015
Messages
466
Reaction score
459
First Language
English
Primarily Uses
RMMV
@Roguedeus

Sure I can add formulas for the regeneration as well.

I don't mind taking on any request, just link me to the original plugin if you can so I can take a look at what it does.
 

SpacemanFive

Meteor Mage
Veteran
Joined
Jun 25, 2013
Messages
191
Reaction score
23
First Language
English
Primarily Uses
I remember requesting something like this back with VX Ace. So glad to see that you've made this for someone for MV! Thank you very much!
 

Taemien

Veteran
Veteran
Joined
Sep 11, 2015
Messages
79
Reaction score
14
First Language
English
Primarily Uses
The bug with the type error you are all experiencing will be fixed within the hour.

EDIT: The type error bug has been fixed, you can get the the fixed version here: https://bitbucket.org/liquidize/anima-framework/raw/6bedefc1aeb920e816aa62b1cf3d70ae9e2cc2e5/Shield%20States/Anima_ShieldStates.js or in Opening Post.

In regards to the graphical glitch. I know it exists, I'm not entirely sure why its occurring, but it will be fixed sometime in the future.
Outstanding job on the bug fix. It works perfectly minus the graphical glitch of course. The only thing I could think of.. is every time the state is applied, maybe erase the gauge and apply it. This way logically its always adding it for the 'first time'. I'm not a JS expert by any means so I don't know if it would throw an error if you applied the state and it tried to erase something that wasn't yet there.

Is there a way to hide the gauge currently? I noticed the enemies that use shielding do not have it, and that seems pretty good for what I'm doing (though I'm sure others wouldn't mind displaying it).

As for having too many notetags, as others said I don't think there could be too many  :D . There's a ton of plugins with way more. Yanfly's action sequence comes to mind... The idea of blocking heals until enough is healed sounds like an interesting mechanic. Could name the state 'bleeding' and have to heal a certain amount before actual healing takes effect. Couple of MMORPGs have stuff like that.
 

Nohmaan

Veteran
Veteran
Joined
Jul 7, 2012
Messages
138
Reaction score
33
First Language
English
I am looking into another way of actually making shields though, because currently its a lot of notetags and unless that is okay with you all, it may be a bit of a hassle?
I think the note tags are great, and simple.  Truth is, once you create the state you're done- it's not like it's something you have to constantly go back and change around.
 

Liquidize

Caffeine Overload
Developer
Joined
Nov 1, 2015
Messages
466
Reaction score
459
First Language
English
Primarily Uses
RMMV
@SpacemanFive

You're welcome.

@Taemien

No, currently there is no way however It is planned. The enemy gauges use a different function to draw their Icons. However I do plan on making it so gauges can be turned off, and so enemy gauges can exist.
 

Taemien

Veteran
Veteran
Joined
Sep 11, 2015
Messages
79
Reaction score
14
First Language
English
Primarily Uses
@Taemien

No, currently there is no way however It is planned. The enemy gauges use a different function to draw their Icons. However I do plan on making it so gauges can be turned off, and so enemy gauges can exist.
Sounds great.

One question though, will there be any plans for compatibility/functionality with Yanfly's Auto Passive States? For example, an item that uses notetags from Auto Passive States to apply the shielding state?

Currently it seems to apply the state, but no gauge shows and no damage is prevented/absorbed.
 

Liquidize

Caffeine Overload
Developer
Joined
Nov 1, 2015
Messages
466
Reaction score
459
First Language
English
Primarily Uses
RMMV
I will see if I can make compatible.

EDIT:

I've updated the plugin to version 1.02, you can get 1.02 https://bitbucket.org/liquidize/anima-framework/raw/a15e6ec27cfadb6efeb94014015c49de08d63712/Shield%20States/Anima_ShieldStates.js or in opening post.

Change Log:

 - Fixed a graphical glitch that caused states applied more than
  once to not properly show the shield values. (The one posted on first page)


 - Added the ability too give shields using the Event Commands
  (see notes).
 - Added the ability to have shield regeneration done via formula.
 - Changed how shields are made for future updates.
 - Added parameter to turn on/off the drawing of shield
   gauges.


 - Added notetag to turn on/off the drawing of a shield gauge.
 - Changed it so friendlies can now bypass all shields by default.
 - Added notetag to turn off allowing friendlies to bypass the shield.
 - Shield damage is now rounded, to prevent floating point damage.
 - Added a notetag to enable shields health/effect to be reapplied/renewed
 when renewing or re-adding the state (useful for shields that can have variance
 in their health pools).
 - Changed how some notetags are written, to add consistency and better
 clarity.


IMPORTANT INFO

1. In regards to making it so the shields health bars can be over your health bars of your actors and enemies. While /technically/ possible, due to all the different possible gauge styles, drawing overwrites,huds,etc it is more of a 'per game' type of function, and is not something that I can really do on a generic level.

2. In regards to having a notetag/parameter to change the height/size of the bars, due to how the drawing gauge function works this can also /technically/ be done, but if someone else overwrites the draw gauge function it may break, or not look right. I would rather leave the actual style of the gauges up to a more specific gauge drawing plugin such as the PrettierGauges plugin.

3. In regards to compatibility with YEP_AutoPassiveStates due to how passive states are actually handled, its not really possible. Since your actors and battlers technically never have the states added, they are added in the sense that whenever the "Get States" function is called (every frame btw basically) it checks to see if passive states exist, and just includes them in the returned array. I could probably hack it to work, but even then it would have limited functionality. You can still have passive shields in a way, just add the state to the actor and never remove it.

4. In regards to showing the gauge of enemy shields, this is not possible without completely rewriting how they're shown, currently the engine just gets every icon id that the enemy has for any given reason, and just flashes through them. It does not give any of the drawing or sprite functions any information on the state, and while i could do it if all states had unique icons, this is not the case so i'd rather wait for a Enemy State Manager plugin to come out (or make one) before I do this. 

I also changed some of the notetags with this update to add more consistency to how shields are made. 

<Absorb Shield> and <Reflect Shield> have been replaced with <Shield :x> (where x is reflect or absorb). This was done to make it easier for me to add future types of shields (mana wall,mana shields, other type of stat shields, eh eh?) as well as add consistency to how it looked.

<Shield Gauge Below> has been to <Shield Gauge Below: x> where x is true or false. A lot of notetags that sort of acted as on/off switches were changed to be in this format, or shortened. Please see the help file for a full list of notetags, and how to use them.

You are now able to add shields via events (you could have before, but due to how the events add states, the actual shield effect was never created). There is a section in the help file on limitations of this, mainly the fact that there is no "subject", and only a "target" actor/battler, so actor,subject,a,b, and target all are the same object.

You are now able to use shield healing formulas to determine how much health the shield should heal at the end of the battlers turn, there is a section in the help on this. The healing formula is multiplied by the healing rate (default is 1.0 when using a formula, 0.0 if no formula or heal rate tag is given).

You are now able to have friendlies heal,damage,etc another friendly if they have a shield by default, you can make some shield block these things using a notetag.

Thanks for the support, and please as always if you have a suggestion feel free to mention it!
 
Last edited by a moderator:

Roguedeus

It's never too late to procrastinate...
Veteran
Joined
Mar 19, 2013
Messages
527
Reaction score
106
First Language
English
Primarily Uses
N/A
It seems that the shield states plugin is interfering with BUFF icons.

(They are totally transparent now)
15_1122_shieldIssue_2.PNG

(Disabling the plugin, makes them all visible again)

It doesn't appear to effect state icons at all. It may be related to Yanfly's plugins. I use them all. But I have not isolated it yet.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Writing out an idea for the No Travel Game Jam. I have a general plot and challenge written out, it's just a matter of filling the rest in and making it interesting.
A definite difficult time right now. How is everyone doing during this pandemic? I already have seen furloughs and layoffs.
Hollow 1977 wrote on Archeia's profile.
Hope you and your family are doing well during this difficult time. :)
My elderly neighbor whom I've been buying groceries for just got carried out of his home on a stretcher by guys with hazmat suits. Considering I've been his only point of contact for the past month it's probably safe to say my boss was right to tell me to stay home once I developed a mild cough after all.
Damn. All these new features to the forums. Takes some getting used to.

Forum statistics

Threads
95,642
Messages
930,673
Members
125,962
Latest member
seogenics
Top