Status
Not open for further replies.

Jay19

Veteran
Veteran
Joined
Dec 27, 2018
Messages
72
Reaction score
26
First Language
Français
Primarily Uses
N/A
Hello,
First, sorry to open another topic (especially since I still have plenty of questions in reserve) but I can't find a solution to my problem which nevertheless seems very simple.
I'm using yanfly plugins to create a skill that gives an absorption barrier to all the team. Equivalent to 10% of each member's HP until the end of the current turn.
My formula is:

<Custom Target Barrier 1 Turns>
value = target.mhp / 10;
</Custom Target Barrier 1 Turns>

My problem is that, for some reason I don't understand, whoever cast the spell benefits from this barrier for 2 turns (the turn the spell is cast + the next one).
What I would like is for the barrier to be dispelled for all my characters at the end of the turn. Anyone know a solution?
I specify that I do not use any other spell that gives barrier points. I can therefore use an event at the end of the turn to dissipate the barrier points of all my characters (whether they have them or not), but again, I tried several scripts found on forums, nothing works. JavaScript is not my strong point, neither is English v_v

(translation made by google, please ask me to rephrase if necessary)
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,943
Reaction score
3,140
First Language
English
Primarily Uses
RMMV
Are you using one of Yanfly's battle systems that adjusts how turns are calculated?

As far as doing it manually, you should be able to use the script calls provided in the instructions.
battler.barrierPoints()
- Returns the total amount of Barrier Points the battler has.
and
battler.loseBarrier(value)
- Makes the battler lose 'value' worth of Barrier Points.

So if you use the Script event command you can put in:
Code:
$gameParty.members().forEach(member => member.loseBarrier(member.barrierPoints()));
 

Jay19

Veteran
Veteran
Joined
Dec 27, 2018
Messages
72
Reaction score
26
First Language
Français
Primarily Uses
N/A
Thank you for your reply.
No, I don't use any plugin that changes the lap calculation (I imagine you are referring to ATB, CTB or other systems).
I had indeed used the 2 formulas you are telling me about, but I had copied and pasted them into the script command without changing anything.
So it works with your formulation.
The only problem. This shows me the barrier points lost...only on whoever cast the spell.
Since the caster keeps the barrier one more turn, it has already dissipated on the other members. It's a little weird.
Is there a way to not display the loss of barrier points?
Otherwise I can also extend the barrier to 2 turns for everyone, I would have the display of the barrier points lost for everyone at the end of the turn. But I confess that I prefer that there is nothing to display. Is it possible ? Otherwise it does not matter.
 

oooNUKEooo

Veteran
Veteran
Joined
Sep 22, 2020
Messages
151
Reaction score
41
First Language
br portuguese
Primarily Uses
RMMV
if youre using more yanflys plugins, create a state (either passive or applied to the user when he cast the skill) and put the notetag on the state note:

Code:
<Custom Turn End Effect>
   //replace the X below for your value, i think it can exceed the remaining barrier points
   user.loseBarrier(X);
   user.updateBarrierTurns();
</custom turn end effect>

it will grant that, by the end of that turn, no point remain. also, make the state be removed by the end of the turn.

the user.updateBarrierTurns(); line may work alone if all thats happening is that the plugin is not updating the turns right. i think this line decreases a turn and show it properly, but this needs testing.[/code]
 

Jay19

Veteran
Veteran
Joined
Dec 27, 2018
Messages
72
Reaction score
26
First Language
Français
Primarily Uses
N/A
Thanks a lot. It works as I wanted.
The first line always shows "barrier damage" at the end of the turn. But the second line used alone, corrects the problem since it rectifies the gap of one turn between the caster of the spell and the rest of the group.
Thanks a lot for your help. That gives me one less bug to fix.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
9,835
Reaction score
6,255
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

I just got all of my wisdom teeth out today, thankfully I have the rest of the week off.
Man I am learning I am bad at naming armor lmao.
The game's opening, now fully polished! :LZScheeze:





Aaand, here's me working on it in today's "Game Making Every Day" video! :LZSooo:

Hello! Can anyone help me? I followed making cooking tutorial for RPG Maker MV. But for some reason buff state that food gives doesn't work in overworld. It disappears. What am I supposed to do?
A shotgun is not a rifle. Huh.

Forum statistics

Threads
124,408
Messages
1,163,397
Members
163,207
Latest member
zapedrin
Top