WheatTon

Villager
Member
Joined
Nov 14, 2017
Messages
14
Reaction score
2
First Language
English
Primarily Uses
RMMV
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.
 

Dreyliam

Villager
Member
Joined
Feb 7, 2019
Messages
17
Reaction score
6
First Language
portuguese
Primarily Uses
RMMV
make 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
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,838
Reaction score
1,766
First Language
English
Primarily Uses
RMMV
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();
 
Last edited:

WheatTon

Villager
Member
Joined
Nov 14, 2017
Messages
14
Reaction score
2
First Language
English
Primarily Uses
RMMV
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!
 

Latest Threads

Latest Profile Posts

"I didn't know X song was about that!" Uh... why? Do you not listen to the lyrics? I mean, I guess that makes sense. We live in a world where nobody listens, but everyone wants to be heard.
Coding class: Python
Game dev work: Javascript
Result: AHHH!!! Writing program for an assignment and having it crash and burn because I used Javascript syntax or format. Or having my game die on me because of a python call :yswt:
Can we make it so whenever a banned user tries to use their account whilst banned, the forum should redirect to this
Anyone doing anything for NaNoWriMo this year?
Listening to, "Draum" by Eldrim. If you haven't heard it before, do so. Absolutely lovely, and utterly haunting.

Forum statistics

Threads
115,835
Messages
1,093,312
Members
151,025
Latest member
Mynastrus
Top