[Solved~!] Passive Leech Health Skill

Status
Not open for further replies.

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
*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
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
86
Reaction score
10
First Language
English
Primarily Uses
RMMV
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).
 

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
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
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
86
Reaction score
10
First Language
English
Primarily Uses
RMMV
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.
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
86
Reaction score
10
First Language
English
Primarily Uses
RMMV
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).
 
Last edited:

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
It might work without the skill being listed as a skill, but if it doesn't, I'll try that method too~

~ Dragon
 

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
So... an update on this...

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

~ Dragon
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
86
Reaction score
10
First Language
English
Primarily Uses
RMMV
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.
 
Last edited:

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
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
 

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
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
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
86
Reaction score
10
First Language
English
Primarily Uses
RMMV
Can you display the actor ID number and the skill being inside the class' learn skill window?
 

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
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
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
86
Reaction score
10
First Language
English
Primarily Uses
RMMV
Is this actor doing the finishing blow?
 

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
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
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
86
Reaction score
10
First Language
English
Primarily Uses
RMMV
And your Buffs & States Core plugin is ON? Sounds like the plugin is not reading the notetag.
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
86
Reaction score
10
First Language
English
Primarily Uses
RMMV
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.
 

DragonRose35

Scaleything
Veteran
Joined
May 31, 2017
Messages
49
Reaction score
0
First Language
English
Primarily Uses
RMMV
Still nothing...

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

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

~ Dragon
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
86
Reaction score
10
First Language
English
Primarily Uses
RMMV
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>
 
Last edited:
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

40 card deck size, the plugin seems more sluggish.
Village theme I composed for a commission!
Stream will be live shortly with some Haunting Ground! Feel free to drop by!
welp, the stock market went down by 7% because of corona today. Time to buy stocks?
Man, being able to edit my game WHILE testplaying it is like the most convenient thing EVER. Thank you, MV...it even makes up for the OGG thing. Well, almost.

Forum statistics

Threads
94,560
Messages
921,894
Members
124,423
Latest member
Detulovnoc
Top