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
149
Reaction score
90
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 Profile Posts

so, ive been gone for too long when i log in and see that everything is where is shouldn't be. XD
Steam killing my eyes.. I forgot why I use it only when I have no other choice
Making a map, my brain went "Look, Mjölnir!" as I plotted out a sacrificial entrance.

Actually, it went, "Look, hammer. Wait, Thor's hammer!"
CG tile rendering, take 3: windows.
which section you guys think looks more accurate to the perspective? left or right?

for reference, this is what it looks like "at street level"
Okay, Animal Crossing is remarkably addictive and exceptionally calming. I've been playing it pretty exclusively... like... 6 hours a day. Been a while since I've been this engrossed.

Forum statistics

Threads
95,402
Messages
928,920
Members
125,620
Latest member
Marlin
Top