[RMMZ] SKILL COST ISSUES

Posts

Pages: 1
Hello, I kind of need help with a particular variant of skill cost writing.
See, I've got an archer type of character, who uses arrows (or crossbow bolts, rather) as ammunition for his attacks. Using the plug-ins from VisuStella (used the Sample Game basis), I got as far as to actually implement the system.

Now for my actual problem: As any half-baked archer, my character is supposed to have a skill where he rains bolts on the enemies. Rather than just using a fixed skill cost, though, I wanna be fancy with this one, and make the cost depend on enemy amount. This is where the problem comes in, because I'm fairly certain I need to do this using actual JavaScript, and I have no idea what to do with any of it. So far, I've only used the notetags to write the code for it so as to not break anything by accident (which would at least only require me to delete and replace the damaged file and re-do what I've done to get my system to work). Does anyone know what I need to do for this?

For reference, this is the bogus I wrote up for this:

author=My stupid ass
<JS Bolt Cost>
const user = this;
const skill = arguments[0];
const cost = arguments[1];
const enemies = arguments[2]
const item = $dataItems[7];

// Return Boolean
if (user.isActor() && enemies.isEnemy() && cost = enemies && enemies > 0) {
    return $gameParty.numItems(item) >= cost;
} else {
    return true;
</JS Bolt Cost>
Marrend
Guardian of the Description Thread
21781
Wrapped your quote in a code-tag for you. Square-brackets, and data inside them, were not being displayed properly.
It's expecting an actual value (assigned to cost), not a boolean.
Pages: 1