So I'm trying to make a skill that deals damage based on a variable (blood amount) * whatever number. Easy right? Here's the catch, the skill needs to also increase the variable based on the amount of health the enemy lost (not the current or max health) in other words, suck the blood out and make the skill even stronger, the separate variable is displayed with Yan fly's menu variables. Pretty much what I need is a way to get the damage and health reduction values and modify a variable based on those values. Anyone know how to do that? (no java experience, but I can still understand it at a beginner level)
I'm trying to make a damage dealt variable, need help
RPG Maker MV SupportWhat you are looking for in terms of the engine is called the result. In the base code, the result contains the values for the damage dealt, and the other results of an action.
The Yanfly plugins generally provide notetags that target various steps of the action sequence, so I'd imagine that the action result would be available during one or more of the steps that the notetags target.
My suggestion to you would be to edit your post or do a follow-up post that outlines, numerically and step-by-step, what you want to happen. For example:
Note that the example above is not my interpretation of what you are asking for. It's a blueprint for you to describe what you want in more detail.
The Yanfly plugins generally provide notetags that target various steps of the action sequence, so I'd imagine that the action result would be available during one or more of the steps that the notetags target.
My suggestion to you would be to edit your post or do a follow-up post that outlines, numerically and step-by-step, what you want to happen. For example:
- Dark Knight uses Dark Sword (skill id 20) on the enemy
- Dark Sword deals 100 damage to the enemy
- Because Dark Sword dealt 100 damage, variable id 20 is increased by 50 (50% of Dark Sword's damage)
- Dark Sword deals bonus damage equal to variable id 20, so the next Dark Sword will deal 50 more damage
Note that the example above is not my interpretation of what you are asking for. It's a blueprint for you to describe what you want in more detail.
I'll look into Result note tags, thank you very much!
RPG Maker uses JavaScript, not Java - they're two different programming languages.
You can use Yanfly's Skill Core, give the skill the notetag:
Code:
<Pre-Damage Eval
$gameVariables.setValue(X, $gameVariables.value(X)+value);
</Pre-Damage Eval>
That will add the damage done to the variable.
Thank you, I'll try this
Original thread: https://forums.rpgmakerweb.com/threads/im-trying-to-make-a-damage-dealt-variable-need-help.159780/