Yanfly's Absorption Barrer - Show current barrier

Status
Not open for further replies.

Fernyfer775

Veteran
Veteran
Joined
Oct 6, 2013
Messages
1,317
Reaction score
818
First Language
English
Anybody know if there is a way to show the current amount of barrier points the user has when using Yanfly's barrier plugin? http://yanfly.moe/2016/02/13/yep-70-absorption-barrier-rpg-maker-mv/

I know the plugin gives you a little "color change" in your HP bar when you have a barrier, but I like to provide my players with NUMBERS, so I was wondering if anybody knew how to actually show the exact amount of barrier points on the state itself?

This Tips&Tricks shows how you can show an "amount" on the state, so ideally, this is what I'd like to emulate for the barriers:
http://yanfly.moe/2016/10/03/tips-tricks-heal-jammer-rpg-maker-mv/
 

shockra

Slightly Crazy Programmer
Veteran
Joined
Feb 16, 2016
Messages
444
Reaction score
208
First Language
English
Primarily Uses
RMMV
If I remember correctly, the Absorption Barrier plugin has a parameter that applies a designated state if a barrier is active. Using such a state, something like this could work in the state notetag:

<Custom Apply Effect>
user._currentBarrierPoints = user.barrierPoints();
user.setStateCounter(StateID, user._currentBarrierPoints);
</Custom Apply Effect>

<Custom Remove Effect>
user._currentBarrierPoints = undefined;
user.setStateCounter(StateID, 0);
</Custom Remove Effect>

The 'user' may need to be 'target' instead. But this next part is where it gets tricky because the counter needs to update EVERY time the barrier changes, and it needs to be done manually each time. Try this out:

<Custom Deselect Effect>
var points = target.barrierPoints();
if (points !== target._currentBarrierPoints) {
target.setStateCounter(StateID, points);
}
</Custom Deselect Effect>

<Custom Regenerate Effect>
var points = user.barrierPoints();
if (points !== user._currentBarrierPoints) {
user.setStateCounter(StateID, points);
}
</Custom Regenerate Effect>

If the state priority is very low, like at 0, it should change after everything else applies. Remember, this state only monitors the barrier points; it doesn't actually change any of the numbers.

Edit: Made a mistake in the regenerate tag. Fixed it.
 
Last edited:

Fernyfer775

Veteran
Veteran
Joined
Oct 6, 2013
Messages
1,317
Reaction score
818
First Language
English
Duuuuuuuuuuuude, you're amazing, thank you so much! Just tested it (with a few tweaks) and it works perfectly! :D
 

Erodaisiki

Veteran
Veteran
Joined
Jul 18, 2018
Messages
48
Reaction score
3
First Language
English
Primarily Uses
RMMV
Duuuuuuuuuuuude, you're amazing, thank you so much! Just tested it (with a few tweaks) and it works perfectly! :D
I need this, if you have already succeeded, please give me a copy. Thank you.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
[necro]Erodaisiki[/necro]
You can either pm the Member or start a new thread with your query.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top