It's "target.setHp(0)", not "setHP". Syntax errors are very common so we have to be very careful 🙂
Ahh I really need to find a good tutorial to help me learn all this stuff... I can't tell if im not writing it proper or just a capital letter lol.
Hi!! I think it is not that hard if you use some yanfly scripts, if you are willing to use them, I can help you in developing the skill you need. I just need some clarification:
You want the skill to (Option1) make massive damage to target if the target is below 20% maxHp or (Option2) insta kill the target IF the target is below 20% maxHp AND is "marked to dead" state?
I use a ton of Yanfly plugins. So yes im relying heavily on scripts just so I can learn the maker.
Actually I wanted to learn how to do both options. Im making different skills for a type of assassin skill set:
Skill 1- 2x damage (the multiplier is not really relevant but lets say 2x) if target is below 20% (with the exception of a few enemies)
Skill 2- Instant kill on enemies who have under 20% maxHP, otherwise normal damage.
Skill 3- Instant kill on enemies who have under 20% maxHP and have the "marked for death" state applied, otherwise normal damage.
Oh... Woops =)
@Icenick:
The condition was meant to be used like this:
<After Eval>
if (b.result().isHit()) {
if (target.isStateAffected(16)) { target.addState(1); }
}
</After Eval>
as this block is executed regardless whether the skill missed, was dodged or even could not be applied at all
(e.g. target was already dead).
Though as long as your code does nothing, I'd not recommend making it any more complex before you figured out why. If that is still the case, the easiest way to start that I could think of would be replacing it with some nonsense that is bound to create an error and check the console if the Skill Core actually dumps a message
(or if your block gets ignored completely).
As for that, I have never used the console either, but according to
this thread you can press F8 to bring it up if you are running the game in the stand-alone client.
🙂
This is my code and it does not work:
<After Eval>
if (b.result().isHit()) {
if (target.isStateAffected(16)) { target.addState(1); }
}
</After Eval>
<formula effect>
if (b.isStateAffected(15)) b.addState(16)
</formula effect>
<formula effect>
if (b.isStateAffected(14)) b.addState(15)
</formula effect>
<formula effect>
b.addState(14)
</formula effect>
What happens is the skill applies state 14, then if you use the skill again it checks for 14 if target has 14 it removes 14 and adds 15, so on till the 3rd time state 16 is applied (Marked for Death). At this point I want the next application of this skill to check if 16 is applied and kill the target if the HP is lower then 20% maxHP.
Currently with this formula it does not even KO when state 16 is applied.
Im the following plugins in additon to Yanfly:
1) Overriding states
http://himeworks.com/2015/11/overriding-states/ this just allows me to not have state 14-15-16 all on the target but takes the highest priority which is 16.
2) Formula Effects
http://himeworks.com/2016/02/formula-effects-mv/ this just allows you to add the formula in notetag rather then formula bar. Much easier to sort and test through.
Edit: Alternatively, you should be able to use
$gameVariables.setValue(10, $dataSkills[11].customAfterEval);
in an event script command to set variable 10 to skill#11's "after eval" code. If the variable matches your code but nothing happens when using your skill, there might be something wrong with your code or some other plugin sabotages the Skill Cores execution of it.
I dont know what this means :S. What I did was create an event where I press enter to trigger $gameVariables.setValue(10, $dataSkills[11].customAfterEval); then start battle processing. It did not work.
Okay so I turned off Yanfly Battle core and your script worked, not the $gameVariables.setValue(10, $dataSkills[11].customAfterEval); . The
<After Eval>
if (b.result().isHit()) {
if (target.isStateAffected(16)) { target.addState(1); }
}
</After Eval>
However it instantly kills target because of my script where if state 15 then apply 16.
I found the solution which was simply using:
<Pre-Damage Eval>
if (b.result().isHit()) {
if (target.isStateAffected(16)) { target.addState(1); }
}
</Pre-Damage Eval>
This works exactly how I intended it, before damage it checks if it has state if it does apply the effects. However I still need to find a way to have it check if target maxHP is less then 20% and if it has the state.
Also I need to find out how to get this working with YEP Battle Core... Kind of need that plugin lol