General Yanfly Lunatic Help?

Kzar

Warper
Member
Joined
Dec 3, 2018
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
There seems to be very little documentation for what the actual code is to do Lunatic stuff and unless it's been used in a Tips and Trick before, I can't really figure out how to do it. For example here are two skills I can't quite get to work right:

One is a skill that does AoE damage to enemies and heals all party members based on the damage dealt. It almost works but I don't know the code for 'target all allies and heal them based on a variable' I found a spreadsheet with some code stuff and it functionally works, it just doesnt have the healing number popups like it's supposed to:

<Post-Damage Eval>
var heal = value / 2;
$gameParty.members().forEach(function(m){
m.gainHp(Math.round(heal));
});
</Post-Damage Eval>

I was planning on using this idea of a skill that damages enemies and also heals the party for a couple different skills too, just with different numbers.

My other idea was a Passive Skill that, on a critical hit, would reduce all cooldowns by 1 turn. That one also almost works but not quite because I can't find the right code to do the thing. I've tried:

This one does nothing

<Custom Establish Effect>
if (target.result().critical)
{
user.setCooldown(44, -1);
}
</Custom Establish Effect>

this one also does nothing

<Custom Establish Effect>
if (target.result().critical)
{
this.actionGlobalCooldown(-1);
}
</Custom Establish Effect>

and this one used an external skill to lower the cooldowns using the notetags, but that one would interrupt multihit skills to use the cooldown reducing skill and it also had the problem of infinitely looping using the skill forever after your turn was over for some reason. But because this one does actually do something on a crit, I know that it's not a problem getting the passive to actually activate.

<Custom Establish Effect>
if (target.result().critical)
{
BattleManager.queueForceAction(user, 68, user);
}
</Custom Establish Effect>

The only code relating to cooldown timers I can find is user.setCooldown which sets it to a number, when I just want it to subtract from the already existing timer. Like a user.reduceCooldown or something but that also doesnt work, and I'm not experienced enough with js to be able to go through the script and actually tell what part of it is the code you would use in Lunatic stuff.
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
244
First Language
French
Primarily Uses
RMMV
Hello!
...it just doesnt have the healing number popups like it's supposed to:

<Post-Damage Eval>
var heal = value / 2;
$gameParty.members().forEach(function(m){
m.gainHp(Math.round(heal));
});
</Post-Damage Eval>
This code will run after Damages has been dealt, so popups have already 'poped out'. You need to add m.startDamagePopup() after gainHp to show additional popups.

The only code relating to cooldown timers I can find is user.setCooldown which sets it to a number, when I just want it to subtract from the already existing timer. Like a user.reduceCooldown...
Leave the setter and use the actual proprety instead; like this:
Code:
user._cooldownTurns[X] -= Y;
Replace X by the skill Id and Y by the value you want to subtract.
 

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,547
Members
137,835
Latest member
yetisteven
Top