MV Yanfly Buffs & States Core + State Categories | State that spreads States of a specific category to all allies on death?

As the title implies, I'm trying to use those specific Yanfly Engine plugins to create a State that spreads other States on death (For simplicities sake I'm just gonna call them debuffs from here).

I saw the "Death Nova" tips & tricks thing on the site for Yanfly's plugins, and thought I could maybe reverse engineer it to do stuff with State categories and target allies instead of enemies, but had no luck on account of the fact I don't have a lick of experience when it comes to scripting of any kind.

So I decided to make an account and call out for help in this thread, what I'm trying to do is have this State that checks for debuffs (Categorized as StatusDebuff with the Categories plugin) on the target when they die, and just have them spread those same debuffs to their allies when they die. (Preferably with cutting the amount of turns left on those debuff states when they do for the sake of balancing.)

Basic example: Enemy with State dies, if they have one or more states tagged with "<Category: StatusDebuff>", it combs through their allies and gives them the same states.

I have no idea how feasible this is, I'm operating under the assumption that I'm just too inexperienced/dumb to make this work.

If you need any more information, just lemme know I want to help as much as I can, even though I don't think I can be much help. Sorry and thanks in advance!
try putting this in the notebox of your state:
Code:
<Custom Remove Effect>
if ($gameTemp._deathStateClear)
  user.states().forEach(s => {
    if (s.category.contains("STATUSDEBUFF"))
      user.friendsUnit().aliveMembers().forEach(m => {
        if (user != m) m.addState(s.id)
      })
  })
</Custom Remove Effect>

also welcome!
try putting this in the notebox of your state:
Code:
<Custom Remove Effect>
if ($gameTemp._deathStateClear)
  user.states().forEach(s => {
    if (s.category.contains("STATUSDEBUFF"))
      user.friendsUnit().aliveMembers().forEach(m => {
        if (user != m) m.addState(s.id)
      })
  })
</Custom Remove Effect>

also welcome!
Hey! Thanks for the quick reply and apologies for the late response! Didn't think it'd be that quick, so i left it sit for some time.

I tried putting it into the state I want to trigger the on death effect (I assume that's what I was meant to do?) but it doesn't appear to have worked, here's some images along with a descriptor of what I did, if that helps.

Here's the state I want to cause the debuffs to spread, couldn't fit the whole notetag in there (Dunno if I can pop out that window or make it bigger, as you can see Im a total novice.) but trust me, its the whole thing.

1751984880023.png


And here's a basic "Burn" debuff I created with the category.

1751985036392.png


I tried a couple of things after trying to get it to work a few times, like changing the category to be EXACTLY like the provided notetag, or getting rid of the category thing in general and just typing it as written.

Sorry if this was something that I completely messed up, and thank you in advance for you patience!
couldn't fit the whole notetag in there (Dunno if I can pop out that window or make it bigger, as you can see Im a total novice.)
you cant, but in cases where you need to share it just pasting the text is good. of course, since it was just to make sure what i gave you was there, just showing it in the box is enough.

I tried a couple of things after trying to get it to work a few times, like changing the category to be EXACTLY like the provided notetag, or getting rid of the category thing in general and just typing it as written.
yanfly had the plugin set up the category data to be saved in uppercase. capitalizations shouldn't matter in the <Category: StatusDebuff> tags, but if you're trying to use category info through JS like in the state notetag i gave you, you need to use uppercase there. Exactly as ive written it should be good for how you said you needed it.


just a few things for confirmation. when you tried it, you've:
- saved the project after placing the notetag in the box?
- did the test on a newly created save file?
- had yanfly's state categories AND yanfly's buffs and states core plugins installed?

the third point is self explanatory, but the first two matter as well. notebox and plugin configs arent saved and reflected ingame until the project has been saved, and many of yanfly's plugins write data to a file once on creation and it will break your older saves if things are changed in the editor and old saves are loaded. Now, I doubt state category data is actually saved onto the file, but im covering bases.
you cant, but in cases where you need to share it just pasting the text is good. of course, since it was just to make sure what i gave you was there, just showing it in the box is enough.


yanfly had the plugin set up the category data to be saved in uppercase. capitalizations shouldn't matter in the <Category: StatusDebuff> tags, but if you're trying to use category info through JS like in the state notetag i gave you, you need to use uppercase there. Exactly as ive written it should be good for how you said you needed it.


just a few things for confirmation. when you tried it, you've:
- saved the project after placing the notetag in the box?
- did the test on a newly created save file?
- had yanfly's state categories AND yanfly's buffs and states core plugins installed?

the third point is self explanatory, but the first two matter as well. notebox and plugin configs arent saved and reflected ingame until the project has been saved, and many of yanfly's plugins write data to a file once on creation and it will break your older saves if things are changed in the editor and old saves are loaded. Now, I doubt state category data is actually saved onto the file, but im covering bases.
Hi again! And thanks for your continued patience and whatnot, I gave it another go, following those added tips at the bottom (The first time around I actually also thought I didn't have the plugins!), but as it stands, I just cant wrap my head around whats wrong.

I'll keep fiddling around and see if I can solve it, but just in case this helps at all, here's what happens: The state gets applied, enemy has burn debuff with the category, they die, nothing happens. From what I understand in your reply, the states are set up correctly, so clearly its just something I gotta figure out (which i will do my best to).

In the meanwhile, I DID find a way to make the Death Nova thing from the start of this post work, kind of. Combining its effects with the Plague Touch thing from Yanfly's tips & tricks could prove useful, so I will try messing with that, however, my current attempts have yielded no results.

I also believe that I can use the Weapon Unleash plugin, attach a low health condition to an alternative attack skill that is an alternative to said Plague Touch and applies the targets debuffs to their allies. (I have succeeded in the debuffs being applied to the targets allies part, but so far the low health conditional has been the main difficulty)

Yammering aside, I will continue to see if I can get this to work, and solve whatever's preventing it while also working on those alternatives! Once more, because I feel like I've used up a bit of your time just to say "I couldn't do it" twice, thank you for your patience in advance, and sorry for my ineptitudes!
ah, found it. Its my mistake

I forgot that <Custom Remove Effect>s dont trigger on death by default. Turan has a patch for the buffs and states core plugin to make that the case here:

otherwise, ive just tested it and it works in my main project that uses the patch.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-buffs-states-core-state-categories-state-that-spreads-states-of-a-specific-category-to-all-allies-on-death.178763/