MV [RMMV] [YEP] Yanfly Limited Skills Help

So I am trying to make a pseudo reload system in RMMV through the use of Yanfly's limited skill, and Item Costs plugins but I'm at a wall.

Right now my current idea is having a specific gun to add specific skills that pertain to it's ammo count.

Ex. Generic Pistol only holds 6 ammo = 6 uses of a skill "Single Fire"
Class can learn a skill "Double Tap" = uses 2 ammo = 3 uses

I have been trying to get it to interact where when I use "Single Fire" it reduces the skill use of "Double Tap" by 1, and vice-versa using "Double Tap" reduces skill use of "Single Fire" by 2.

Ex. If Double Tap is used, it should become 2/3 uses, and Single Fire should become 4/6

My reload mechanic I added using <Global Limited Use: +/-> works as a separate skill, however when trying to use
Single Fire

<Item Cost: 1 9mm>

<Skill 0013 Uses: -1>

<Limit Uses: 6>

and

Double Tap

<Item Cost: 2 9mm>

<Skill 0011 Limited Uses: -2>

<Limit Uses: 3>

Neither of their skill uses go down.

Any help would be appreciated. TIA
I haven't looked at the logic of your notetags super hard, but right off the bat there are problems because you're using leading zeros.

I know they're written that way in the MV database, but if you look at any examples in the plugin documentation, there are none there - putting zeros in front makes JavaScript interpret it as an octal value.

So write just the regular number - 11 or 13 - and see if it works. If not, we'll look at the combination of notetags and what they're supposed to do.
I haven't looked at the logic of your notetags super hard, but right off the bat there are problems because you're using leading zeros.

I know they're written that way in the MV database, but if you look at any examples in the plugin documentation, there are none there - putting zeros in front makes JavaScript interpret it as an octal value.

So write just the regular number - 11 or 13 - and see if it works. If not, we'll look at the combination of notetags and what they're supposed to do.
Thanks for the reply!
Unfortunately I tried using without the leading zeroes, and name oriented note tags.

As for the other note tags they appear to be fully functional,

<Item Cost: x y> - for consuming ammunition in inventory

and

<Limit Uses: x> - for setting max params of the skill until Action reload is used to refresh it

not home currently but if needed I can send screenshots later.
Okay, so you have a few problems going on.

Single Fire

<Item Cost: 1 9mm>

<Skill 13 Uses: -1>
I can't find this notetag in the documentation. There is no "Skill x Uses".

Double Tap

<Item Cost: 2 9mm>

<Skill 11 Limited Uses: -2>
You appear to be using this incorrectly. The documentation says:
1694787731736.png


Since you are presumably not double tapping at yourself, changing the uses on the target is not what you're trying to do.

You need to go through the plugin to find the actual code for what you want to do.

Edit: I still think the interaction between the skill uses and the item cost is a bit weird. It seems strange to both say "I'm emulating your magazine capacity, but also pulling individual cartridges out of your inventory." I think it would make more sense to have the skill have their limited uses and then the Reload skill can only be used if you have a sufficient number of 9mm.

But anyway.

To alter a different skill when you use one, use the Skill Core Notetag:
Code:
<After Eval>
user.paySkillLimitedUseCost(11, 2); // Spends two uses of skill 11
</After Eval>
Okay, so you have a few problems going on.


I can't find this notetag in the documentation. There is no "Skill x Uses".


You appear to be using this incorrectly. The documentation says:
View attachment 276613

Since you are presumably not double tapping at yourself, changing the uses on the target is not what you're trying to do.

You need to go through the plugin to find the actual code for what you want to do.

Edit: I still think the interaction between the skill uses and the item cost is a bit weird. It seems strange to both say "I'm emulating your magazine capacity, but also pulling individual cartridges out of your inventory." I think it would make more sense to have the skill have their limited uses and then the Reload skill can only be used if you have a sufficient number of 9mm.

But anyway.

To alter a different skill when you use one, use the Skill Core Notetag:
Code:
<After Eval>
user.paySkillLimitedUseCost(11, 2); // Spends two uses of skill 11
</After Eval>
Thanks again! Ah yeah that does make sense, I was considering a cartridge variation but didn’t consider how much tedium would be added to the player since I wanted bullets to be a craftable option, and it seemed like an extra step to have a way for a cartridge to be another item to be made loaded with ammo.

Either way for the skill limitation I was thinking it wouldn’t make sense for a skill to be available if there was not sufficient ammo in the magazine for a specific skill, ie, =/ use “Double Tap” if there’s only one bullet left in the magazine, but now thinking more about the logic, if I had the skill usage limitation of “Double Tap” to go down by 1 every time “Single Shot” is used, there would be an error since if I used “Single Shot” twice, it would mean I SHOULD have two uses left of “Double Tap” but I would only have 1

I’m drawing blanks on how I would be able to have it only pull an independent # value for a magazine itself instead of having to find a roundabout way of doing it.

I’ll mess around with it more though, thank you!
Thanks again! Ah yeah that does make sense, I was considering a cartridge variation but didn’t consider how much tedium would be added to the player since I wanted bullets to be a craftable option, and it seemed like an extra step to have a way for a cartridge to be another item to be made loaded with ammo.
Just to clarify - "cartridge" is the item that is loaded into a magazine or clip. People commonly refer to it as "bullet," but actually the bullet is only the small part at the end of the cartridge that actually leaves the firearm's barrel.

So when you refer to "a 9mm round," that's a cartridge. And if you're crafting, you'd just be crafting cartridges, unless you want to get ridiculously in-depth with making a separate bullet and casing then crafting them together.

I’m drawing blanks on how I would be able to have it only pull an independent # value for a magazine itself instead of having to find a roundabout way of doing it.
You could do away with the limited skill uses and just use items.

Have two different items - "9mm" and "loaded 9mm." Your Reload skill removes X number of 9mm from the inventory and adds that number of loaded ammo. Then both of these firing skills use item costs of the loaded version.

Then it all just works.
I like that idea! I’ll take a crack at it.

So when you refer to "a 9mm round," that's a cartridge. And if you're crafting, you'd just be crafting cartridges, unless you want to get ridiculously in-depth with making a separate bullet and casing then crafting them together.
Yeeeah this was gonna be my intended route, something along the lines of armor piercing rounds etc. while also incorporating an elemental infusion mechanic with mana. I’m still really new so it’s a long shot lol.

I also wanted to get into the attachment plugins since it just makes sense, but then I was considering how each individual gun has their own properties and capacities. So adding a higher capacity attachment to correlate to the reload command, on top of figuring out how to overlay a UI element to let the player know how many “loaded” ammo is left.

Original thread: https://forums.rpgmakerweb.com/threads/rmmv-yep-yanfly-limited-skills-help.161201/