MV [Solved] Yanfly Death Tip/Trick Help


I've added everything.

Spoiler: Screenshots
15-27-09.png



Spoiler: Notebox
<Custom EXP Mastery Formula: level * 5>

<No Damage Mastery Effect>



// Display cost

<Custom Cost Display>

\fs[20]\c[23]All MP\c[0]\fr

</Custom Cost Display>



// Requires user to have at least 1 MP

<Custom Requirement>

value = user.mp > 0;

</Custom Requirement>



<Pre-Damage Eval>

// Check if the target isn't a boss

if (!target.isStateCategoryAffected('boss')) {

// Set the damage to 0

value = 0;

// Remove the HP popups

target.result().hpAffected = false;

}

</Pre-Damage Eval>



<Post-Damage Eval>

// Check if the target isn't a boss

if (!target.isStateCategoryAffected('boss')) {

// Remove the HP popups

target.result().hpAffected = false;

// Get the target's death state ID

var deathStateId = target.deathStateId();

// Calculate the chance based on the user's current MP%

var chance = user.mpRate();

// Alter that based on the target's death resistance

chance *= target.stateRate(deathStateId);

// Check RNG if it passed

if (Math.random() < chance) {

// Check if the target is temporarily immortal from action sequences

if (target.isImmortal()) {

// If it is, remove the temporary immortal status

target.removeImmortal();

}

// Add the death state

target.addState(deathStateId);

} else {

// Display a miss if RNG failed

target.result().missed = true;

}

}

</Post-Damage Eval>



<After Eval>

// Set user's MP to 0

user.setMp(0);

</After Eval>


15-28-23.png

15-29-15.png

Regardless, it still does visual damage and dosnt one shot this or any enemy without the Boss category.

Could this be colliding with another plugin?

Spoiler: Plugin List
15-31-34.png15-31-43.png15-31-51.png15-32-00.png15-32-07.png15-32-13.png

Thanks guys. 🙂
The best way to determine whether it's a plugin causing the issue: disable everything except Battle Engine Core, Skill Core and State Categories (the ones needed for the effect) and see if it works as intended.
The best way to determine whether it's a plugin causing the issue: disable everything except Battle Engine Core, Skill Core and State Categories (the ones needed for the effect) and see if it works as intended.

Nope. Doesn't work. LOL?
What if you take out the mastery notetags that aren't part of the T&T?
1 - Make sure your Yanfly plugins are in the correct order according to his master list on the site.
2 - You don't actually show the important parts, which are the death state and the associated code in your notetag. Did you correctly replace "deathStateId" with the right number for your death state? Is your death state set up correctly?
What if you take out the mastery notetags that aren't part of the T&T?

Still the same. Does damage and doesn't one-shot.
1 - Make sure your Yanfly plugins are in the correct order according to his master list on the site.
2 - You don't actually show the important parts, which are the death state and the associated code in your notetag. Did you correctly replace "deathStateId" with the right number for your death state? Is your death state set up correctly?

OH! I need to actually define the Death State? I had no idea I had to. I figured it was all set up already with the hardcoded information available on MV. Let me check that.
I mean, it might be, but you should post it anyway. And then make sure about the other parts - the number one most common problem when people post about Yanfly's plugins is they didn't obey the correct ordering. And then show the rest of your code in the Death skill.
Assuming you coded it the same way as the page does, deathStateId should be equal to target.deathStateId() which SHOULD return the death state from the database. But yeah, ATT_Turan is right, you need to show us everything to help us figure out what's wrong here.
I mean, it might be, but you should post it anyway. And then make sure about the other parts - the number one most common problem when people post about Yanfly's plugins is they didn't obey the correct ordering. And then show the rest of your code in the Death skill.
Assuming you coded it the same way as the page does, deathStateId should be equal to target.deathStateId() which SHOULD return the death state from the database. But yeah, ATT_Turan is right, you need to show us everything to help us figure out what's wrong here.

I showed the code in the first spoiler and the plugin list in the second one. I did make sure it was in the correct order a while ago, I might need to go through it again tho.

Are we talking about Knockout or an actual Death state?
...the code showing in the first spoiler shows only a tiny fraction of what should be in the notebox, the custom cost. We can't see the entire functionality of the skill, the Pre-Damage and Post-Damage Eval tags, especially the line that applies your Death state, which I've mentioned twice.

Also, while the TP cost to use the skill shouldn't matter, it also has the Effect added to use Normal Attack damage stats, which could be screwing with the custom damage and effects. Make sure your skill matches what Yanfly shows in the tutorial.
I showed the code in the first spoiler and the plugin list in the second one. I did make sure it was in the correct order a while ago, I might need to go through it again tho.

Are we talking about Knockout or an actual Death state?
Well you seem to have Knockout as state 50; is your state 1 still the original Knockout state as per the default settings for a new project or have you changed it?

@ATT_Turan Not sure if it was edited in or was always there but the notebox contents are in the OP now.
No, as I described, and if you look at the tutorial OP is trying to emulate (and the scroll bar on the side of the notebox) it's only a portion of the contents. Unless somehow an entirely different screenshot is showing up for everyone else.
...the code showing in the first spoiler shows only a tiny fraction of what should be in the notebox, the custom cost. We can't see the entire functionality of the skill, the Pre-Damage and Post-Damage Eval tags, especially the line that applies your Death state, which I've mentioned twice.

Also, while the TP cost to use the skill shouldn't matter, it also has the Effect added to use Normal Attack damage stats, which could be screwing with the custom damage and effects. Make sure your skill matches what Yanfly shows in the tutorial.
There is a spoiler within the spoiler that shows the notebox contents

Also, all plugins are in order.
It's been posted in a slightly convoluted way but after you open the first screenshot spoiler there's a "notebox" spoiler between screenshots 1 and 2.
...so the exact question I asked you, "Did you correctly replace "deathStateId" with the right number for your death state?" is no. It still says "deathStateId", which will do nothing...
It does though, Turan:

JavaScript:
var deathStateId = target.deathStateId();
Hm, my bad.
...so the exact question I asked you, "Did you correctly replace "deathStateId" with the right number for your death state?" is no. It still says "deathStateId", which will do nothing...

Oh. Ok. See, there was no way of knowing that since it wasnt specified in the video or anywhere else for that matter. Lol. Let me see if that will work.

As for the Knockout State, here:16-46-34.png

Its slightly convoluted to what I want (Being Knocked out will give you 50% of the exp earned). Let me change those "deathStateId" fields with 1 and see what happens.

Edit: Nevermind. I take forever to respond

Edit 2: Also updated the OP so the Notebox Spoiler is easier to see
There's no point in changing it in your skill code, that function is hard-coded to return 1, since the engine tells you to leave state 1 as the state applied when a battler is killed.
There's no point in changing it in your skill code, that function is hard-coded to return 1, since the engine tells you to leave state 1 as the state applied when a battler is killed.
Right, I figured that by the way the notebox is setup in a new project.

Original thread: https://forums.rpgmakerweb.com/threads/solved-yanfly-death-tip-trick-help.134524/