[Solved~!] Passive Leech Health Skill

● ARCHIVED · READ-ONLY
Started by DragonRose35 22 posts Page 1 of 2 View original ↗
  1. *copies & pastes information*

    Another skill is something called "Soul Eater" and what I hope to do for this one that I have no idea how to accomplish, is for the user to heal 50% of their health on kill of an enemy. But in truth, I would like to figure out how to make this a passive ability, rather than a spell attack of sorts. Does this make sense?

    Any and all help would be appreciated~! This skill is actually something I hope to implement within the game as it is rather unique to the character itself~

    ~ Dragon
  2. When you specifically want this to happen at the end of a kill, you will need the Buffs & States Core that Yanfly has and add the following to the Knockout state (let's say your actor is #2):

    <Custom Apply Effect>
    if (origin.isActor(){
    if (origin.actorId() === 2){
    origin.gainHp(user.mhp * 0.5);
    }
    }
    </Custom Apply Effect>

    To rough this out, apply is when the state is given to the target (in this case, the Knockout state, default at #1 in Database). It then checks if the battler giving the state is an actor and if that's true, checks if the actor's ID is 2 (the number order in your actor list). If this is also true, it then heals the state giver by half the user's maximum HP (this is the battler with the state).
  3. So would I add that to the notebox of the Knockout state then? Or to the formula? And... I would just change the number 2 to the correct actor number and it would work?

    ~ Dragon
  4. You just add that to the state's note box, and you would change to the actorId number of the actor you want it for.

    It should work after that unless I missed something.
  5. upload_2018-10-16_13-31-13.png

    Like this?

    ~ Dragon
  6. Yes, that's right so far, but there is one line I forgot about; you said this is a passive skill, so we have to add a check for that:

    <Custom Apply Effect>
    if (origin.isActor()}{
    if (origin.actorId() === 8){
    if (origin.skills().contains($dataSkills[5])){
    origin.gainHp(user.mhp * 0.5);
    }
    }
    }
    </Custom Apply Effect>

    The third line does a check that the actor previously checked for has skill #5 learned (change this number to what your skill is on).
  7. It might work without the skill being listed as a skill, but if it doesn't, I'll try that method too~

    ~ Dragon
  8. So... an update on this...

    It did not work. And I'm not entirely certain what I might be doing wrong.

    ~ Dragon
  9. DragonRose35 said:
    So... an update on this...

    It did not work. And I'm not entirely certain what I might be doing wrong.

    ~ Dragon

    Did you check it actually healed? Meaning your actor was not on full HP at the time of kill.

    Also, adding the following line will help:
    origin.startDamagePopup();

    which will display the resulting heal; thus you should get

    <Custom Apply Effect>
    if (origin.isActor()}{
    if (origin.actorId() === 8){
    if (origin.skills().contains($dataSkills[12])){
    origin.gainHp(user.mhp * 0.5);
    origin.startDamagePopup();
    }
    }
    }
    </Custom Apply Effect>

    assuming your skill is #12.
  10. My character was not at full health. Which is the only reason I said it wasn't working.

    But I will try the new code tomorrow. Thank you~

    ~ Dragon
  11. Okay, so... it still isn't working. But to be sure I'm not doing anything wrong with the information I have been given, I'm gonna post what my database looks like for both this skill and the Knockout state.

    Knockout Skill:
    upload_2018-10-17_11-6-49.png

    (The text in the notebox: )

    State #1 will be automatically added when HP reaches 0.

    <Custom Apply Effect>
    if (origin.isActor(){
    if (origin.actorId() === 8){
    if (origin.skills().contains($dataSkills[22])){
    origin.gainHp(user.mhp * 0.5);
    origin.startDamagePopup();
    }
    }
    }
    </Custom Apply Effect>

    And Soul Eater skill:
    upload_2018-10-17_11-7-32.png

    Is it anything with what I am doing with this skill or state the problem? Please let me know...

    I can also provide battle proof of the skill not working if it is needed. No health is gained after the enemy is KO'd.

    ~ Dragon
  12. Can you display the actor ID number and the skill being inside the class' learn skill window?
  13. Like... this?

    upload_2018-10-17_12-5-54.png

    upload_2018-10-17_12-5-36.png

    I'm almost certain I have all the variables right... but I still don't know why it's not working...

    ~ Dragon
  14. Is this actor doing the finishing blow?
  15. Yes. When I test the skill, I have the actor in a party on his own. I let him get damaged a little, attacking the enemy- two Bats- and when he kills them, no health is gained from their death.

    Let me provide an image of this proof to further detail what I mean...

    How the passive skill shows in his skill menu:
    upload_2018-10-17_18-11-54.png

    Character Health:
    upload_2018-10-17_18-13-9.png

    After Kill:
    upload_2018-10-17_18-13-33.png

    See?

    ~ Dragon
  16. And your Buffs & States Core plugin is ON? Sounds like the plugin is not reading the notetag.
  17. upload_2018-10-17_19-14-40.png

    ~ Dragon
  18. What might help is ordering your plugins according to Yanfly's website, which in your case is:

    Battle Engine Core > Buffs & States Core > Damage Core >Target Core > Selection Control > Skill Core

    The only one you seem to need to move is the damage core.
  19. Still nothing...

    upload_2018-10-17_22-16-57.png

    If nothing else works, I may have to give up.

    ~ Dragon
  20. I have just noticed your isActor check is missing a right bracket ); you need to add it (granted, it was an error on my part):

    <Custom Apply Effect>
    if (origin.isActor()){
    if (origin.actorId() === 8){
    if (origin.skills().contains($dataSkills[22])){
    origin.gainHp(user.mhp * 0.5);
    origin.startDamagePopup();
    }
    }
    }
    </Custom Apply Effect>