RMMV (SOLVED)(Yanfly) How do I create a variable in the skill notetag using the Absorption Barrier plugin?

Bad_Muppet

Villager
Member
Joined
Oct 4, 2021
Messages
6
Reaction score
3
First Language
English
Primarily Uses
RMMV
I am trying to create a variable that stores the value of the user's magic attack (divided by 10) and have the Absorption Shield plugin use the <User Barrier: +#> script in it. However, I am having a difficult time figuring out how I can store the value into the variable. Right now my code looks like this:

Code:
var addShield = user.mat / 10;

<Target Barrier: +addShield>

The skill targets one ally. I have all of the plugins, as well.

I also tried doing

Code:
<Target Barrier: +(user.mat/10)>

but it didn't work. It seems to only work with integers.
 

Cythera

Veteran
Veteran
Joined
Jul 31, 2019
Messages
338
Reaction score
999
First Language
English
Primarily Uses
RMMV
Yanfly put a custom option in most of his plugins - they're called 'lunatic mode' and allow you to use custom code to do effects.
Try:
Code:
  <Custom Target Barrier>
   value = Math.ceil(user.mat/10)
  </Custom Target Barrier>
in your skill notetag :)
Note that the Math.ceil isn't necessary; I just tend to use it to round numbers, because the engine doesn't always handle extreme decimals very well! But you can set value to anything you like.
 

Bad_Muppet

Villager
Member
Joined
Oct 4, 2021
Messages
6
Reaction score
3
First Language
English
Primarily Uses
RMMV
Yanfly put a custom option in most of his plugins - they're called 'lunatic mode' and allow you to use custom code to do effects.
Try:
Code:
  <Custom Target Barrier>
   value = Math.ceil(user.mat/10)
  </Custom Target Barrier>
in your skill notetag :)
Note that the Math.ceil isn't necessary; I just tend to use it to round numbers, because the engine doesn't always handle extreme decimals very well! But you can set value to anything you like.
Okay, I missed the lunatic mode code somewhere. Thank you so much! This really helped!
 

Latest Threads

Latest Profile Posts

Never play a random encounter RPG on the toilet. Just don't. Especially not one with save points instead of menu saving.
spent the entire day working on problems I was having in battle. enemy's tagging in and out was one of them.
Check out the Driftwood gamejam submissions, there's some pretty good projects in there.
Define purpose in your own words.
And assuming it doesn't contradict your definition: if someone takes your purpose away, can you get a new one?
At last, my fourth set of random sprites is finished! :kaojoy:
NebhyCL.jpg

Have fun recognizing characters!

Forum statistics

Threads
121,960
Messages
1,145,466
Members
160,233
Latest member
MechaHummus
Top