So I was just using Yanfly's enhanced TP and wanted to create a mode where when damage is taken that damage is divided by 5 and then that amount is added to your character as TP. I'm just not really understanding these equations... is this using the same sorts of things as the damage formulas or is it different? Is there somewhere I could go to see what all these different little codes stand for?
MV YEP Enhanced TP equation help and understanding
Javascript/Plugin Supporttry
These are for damage formulas so not everything may be immediately relevant, but javascript is used everywhere in the game
forums.rpgmakerweb.com
Code:
Math.floor(value/5)
These are for damage formulas so not everything may be immediately relevant, but javascript is used everywhere in the game
Damage Formulas 101
Please note: A discussion has already been started about different things you can do with these formulas so please direct those comments and question to the appropriate thread. https://forums.rpgmakerweb.com/index.php?threads/rmmv-damage-formula-ideas-and-help.47099/ A link to the list of...
forums.rpgmakerweb.com
It works! I just wish I understood how lol I have no clue what "Math.floor" does or how it automatically knows "value" is the damage the character sustains but it does work. As much as I love making games I just can't seem to wrap my head very well around the code aspect. I've tried many times and I've made some progress but not as much as I'd hoped lol
if you want to understand the code of the game, first you'll need to know javascript basics. youll go nowhere fast without that. once you have that, youll be able to read and understand the code in the game's core/plugin files and know what exactly everything does without relying on the plugin help section saying it.
yanfly set up the plugin so that you can use that value variable for easy access since youre meant to adjust the formula however youd like. The default one should have been something like
as said in the thread i linked, Math.floor() takes a number and rounds it down to the nearest integer if its not already one.
It "knows" the damage being dealt because its hooked into the process that gives battlers tp based on damage dealt. that process already has that information available and is a part of the base engine.
yanfly set up the plugin so that you can use that value variable for easy access since youre meant to adjust the formula however youd like. The default one should have been something like
value/target.mhp/2*target.tcr*100. Im not sure if it was or wasnt explained in the parameter window, the plugin help section, or in yanfly's video for it, but the parameter defaults do show it in use.Original thread: https://forums.rpgmakerweb.com/threads/yep-enhanced-tp-equation-help-and-understanding.179329/