I have two skills. One is a limited use skill that is firing a gun. The other is reloading the gun. The cost of reloading is based in gold (in-world the currency is indeed bullets), I'm not sure if that is the complication here. On top of that, I've replaced the stats so that defense is "Resourceful" and makes it cheaper to reload guns. Here's how I've built the reload skill (thanks to a lot of internet searching):
This all works, however I've encountered two problems I'm not sure how to fix, or if they can be fixed:
1. The display for the ammo cost does not update until I've entered combat. I think I have to use the skill as well. So it just says the cost is "0 ammo". Once I've used it in combat, it'll say "6 ammo", or "5 ammo" if I raise my defense stat.
2. I can't use the reload skill from the menu, only in combat. When I try, it just gives me an error sound like I'm out of "mana" or something.
As a bonus question, I was wondering if I could fix this (although not necessary):
3. I'm able to use the reload skill even at full ammo. I think this is just default RPM logic, though, since you can also do things like heal a full HP ally.
EDIT:
It turns out the cost eval was the culprit. I never liked that OR, but didn't think that would break the whole thing when I try to change the variable. Here's how it looks now:
Code:
<Skill 18 Limited Uses: +4>
<Custom Requirement>
user._goldCost = Math.ceil(6 * (1 - (a.def * 0.08)));
if ($gameParty.gold() > user._goldCost) {
value = true;
} else {
value = false;
}
</Custom Requirement>
<Custom Execution>
$gameParty.loseGold(user._goldCost);
</Custom Execution>
<Cost Display Eval>
user._goldCost = user._goldCost || 0;
var variableId = 4;
var value = user._goldCost;
$gameVariables.setValue(variableId, value);
</Cost Display Eval>
<Custom Cost Display>
\v[4] \G
</Custom Cost Display>
This all works, however I've encountered two problems I'm not sure how to fix, or if they can be fixed:
2. I can't use the reload skill from the menu, only in combat. When I try, it just gives me an error sound like I'm out of "mana" or something.
As a bonus question, I was wondering if I could fix this (although not necessary):
3. I'm able to use the reload skill even at full ammo. I think this is just default RPM logic, though, since you can also do things like heal a full HP ally.
EDIT:
It turns out the cost eval was the culprit. I never liked that OR, but didn't think that would break the whole thing when I try to change the variable. Here's how it looks now:
Code:
<Cost Display Eval>
user._goldCost = Math.ceil(6 * (1 - (a.def * 0.08)));
var variableId = 4;
var value = user._goldCost;
$gameVariables.setValue(variableId, value);
</Cost Display Eval>