I am attempting to make a weapon skill that uses a steps taken variable in the damage formula. I would like to put a maximum limit on it and for it to reset to 0 when you either unequip the weapon or use the skill. An example of the skill I am trying to make is the Traveler skill from Final Fantasy XII. I've been trying to use common events, but I'm quite stumped for some reason. If anyone has an answer I would appreciate the help.
Help with Steps Taken Skill
RPG Maker MV Supportmake the skill call a common event, that common event will reset the variable to zero!
You can also create one that checks whether the weapon is equipped or not, if not, the variable becomes zero
You can also create one that checks whether the weapon is equipped or not, if not, the variable becomes zero
Code:
$gameParty.steps()
This will get the total number of steps taken by the party. You don't need to use common events, variables, or any of that nonsense. A basic damage formula that counts steps could be something like:
Code:
$gameParty.steps() * 0.05 - b.def
You'll probably want to count the number of steps in a typical playthrough though to make sure it isn't too strong or too weak, etc.
Edit: Since reading comprehension fails me, here's the FFXII version (I think!) as a damage formula:
Code:
c = $gameParty._travelerSkill || 0; $gameParty._travelerSkill = $gameParty.steps(); c = ($gameParty._travelerSkill - c) % 999; c
It'll reset to 0 each time used (so if you've taken 25 steps since using it last, it'll deal 25 damage. If used immediately after, it'll deal 0 and will continue to do so until you leave combat and take more steps. It'll roll over upon reaching 999 as well, but you can change that to any number you want.
Reset upon unequip weapon is trickier and will probably require a plugin that lets you run a snippet of code, ideally on equip rather than unequip (assuming the item is the only source of the skill) so that it's reset to 0 when freshly equipped. To reset it via script call:
Code:
$gameParty._travelerSkill = $gameParty.steps();
This works perfectly! Thank you. I can live without the unequip reset and so this is all I need. Thank you again!
Original thread: https://forums.rpgmakerweb.com/threads/help-with-steps-taken-skill.115437/