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
5
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
317
Reaction score
888
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
5
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

You thought kids rooms were messy. Look at this.
Back in the house and I'm hungry
Yoshi!
DNPwhy.gif

You're using that item wrong... TwT

Trying to get the mechanics down for a cute, story-driven board game! I think I've accomplished dice movement, item effects, and activating a space's event when you land on it. Art is WIP. Hope to open a thread about the game soon!
My entire family and I have Covid... If it's this bad with the vaccine, without must be terrible. Stay safe, everyone. This thing is a doozy.

Forum statistics

Threads
118,524
Messages
1,116,623
Members
155,539
Latest member
NecroCaticGames
Top