Yanfly Lunatic Scripting - Shin Megami Tensei-styled Instant Death?

CombatJazz

Villager
Member
Joined
Dec 29, 2015
Messages
27
Reaction score
4
First Language
English
Primarily Uses
RMMV
Hello! I'm trying to get Shin Megami Tensei styled instant death abilities to work, and I'm having a bit of a doozy of a time since my scripting knowledge is lackluster, so any help would be appreciated.


By Shin Megami Tensei styled I mean that the instant death is elemental in nature - you have light elemental instant kills, and dark elemental instant kills, and these can be reflected, resisted, or nullified separately from a generic "apply state Death" ability - if I just made it so enemies nullified instant kills with state 0001, there wouldn't be a difference between using light elemental instant kills and dark ones, and I want there to be a difference. Connecting the state to the element isn't necessary (i.e if they have a resistance to Dark it wouldn't have to automatically resist Dark-Death either, I have no problem doing that manually), but just having the two separate elemental deaths would be great.


I tried repurposing the "Doom" code from Yanfly's Doom tips & tricks, but instead of being on expiry, it was on state application, and that didn't work. Then, I tried making it on Confirm effect, nothing, React effect, also nothing. The code I used is in the spoiler - the javascript itself is completely unmodified, the only thing I changed is that it was on apply (in state form), confirm, or react (on the spell itself). I also tried changing "user" to "target" for the variations where I coded it directly into the ability, but again, nada.

<Custom Leave Effect>


// Get the death state for the user.


var deathState = user.deathStateId();


// Check if the user is not immune to death nor resistant to it.


if (user.stateRate(deathState) > 0.01 && !user.isStateResist(deathState)) {


// Play animation on the user.


user.startAnimation(65);


// Set the user's HP to 0.


user.setHp(0);


// Check if the user is dead.


if (user.isDead()) {


// Make the user collapse.


user.performCollapse();


}


}


</Custom Leave Effect>



Any help would be appreciated! Thank you!
 
Joined
Aug 1, 2016
Messages
15
Reaction score
2
First Language
French
Primarily Uses
Maybe should you try using JavaScript on the skill. I haven't tried, but it can work:


<After Eval>


// Get the Death state for the target.


var deathState = target.deathStateId();


// Check if the target is not immune to death nor resistant to it.


if (target.stateRate(deathState) > 0.01 && !target.isStateResist(deathState)) {


  // Play animation on the target.


  target.startAnimation(65);


  // Set the target's HP to 0.


  target.setHp(0);


  // Check if the target is dead.


  if (target.isDead()) {


    // Make the target collapse.


    target.performCollapse();


  }


}


</After Eval>
 

CombatJazz

Villager
Member
Joined
Dec 29, 2015
Messages
27
Reaction score
4
First Language
English
Primarily Uses
RMMV
Maybe should you try using JavaScript on the skill. I haven't tried, but it can work:


<After Eval>


// Get the Death state for the target.


var deathState = target.deathStateId();


// Check if the target is not immune to death nor resistant to it.


if (target.stateRate(deathState) > 0.01 && !target.isStateResist(deathState)) {


  // Play animation on the target.


  target.startAnimation(65);


  // Set the target's HP to 0.


  target.setHp(0);


  // Check if the target is dead.


  if (target.isDead()) {


    // Make the target collapse.


    target.performCollapse();


  }


}


</After Eval>
Didn't work, even though it seems like it should - maybe it's a conflict with my other plugins. I figured out a viable workaround, however, and one that I arguably like slightly better, so don't worry about it!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,845
Messages
1,016,961
Members
137,561
Latest member
JaCrispy85
Top