RMMV Enabling /Disabling a skill based on amount of Armor you have...

firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
390
Reaction score
50
First Language
English
Primarily Uses
RMMV
I want to make a specific skill be enabled when you have the required armor equipped. But I also want to make so that you have to have a certain number of them also.

Let's say you make a equipment type: Ammo

You need two Ammo to use a skill Double Tap... But the ammo has to be equipped and you need two of them to use it.

I looked at Yanfly's YEP_SkillCore and it looks like it can be done there, but I can't figure out how to go about making it work.

Here's the Note Tag I used:
JavaScript:
<Custom Requirement>
 var item = [8, 9, 10, 11];
 var ammo = $dataArmors[item];
 if ($gameActors.actor(1).hasArmor(ammo) >= 2) {
   value = true;
 } else {
   value = false;
 }
</Custom Requirement>
This code only disables the skill and nothing gets it to activate.

Help please?
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
557
Reaction score
232
First Language
english
Primarily Uses
RMMV
you could make the skill have an equip armor type requirement for ammo box
and use yanfly skill cost item to make the skills cost ammo (items) that could be altered based on what ammo box is equipped and state effects
 

firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
390
Reaction score
50
First Language
English
Primarily Uses
RMMV
@Tiamat-86 The problem with that is that I have four different ammo types, each with varying damage, and the skills utilize them all [One at a time obviously, You can switch them out in battle and everything]. YEP_SkillCostItem doesn't allow that kind of fine-tuning. If it allowed me to use an Equipment type instead of just the equipment then I would have no problems, but it doesn't. It requires you to give an ID and if you use multiple ID's then the skill will not work unless you have all the IDs... You don't even have to have them equipped, which I want to have happen. It basically makes it useless for multiple ammo items like I have.

That's why I thought the SkillCore option would be the best, but I have a very basic understanding of JS and so I have only been able to get this far...
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
557
Reaction score
232
First Language
english
Primarily Uses
RMMV
skill cost item does let you change the item cost.
<Replace Type x Cost: Type y>
if this notetag is on a piece of equipment "ie ammo box for different ammo type"
would could change the cost from normal rounds to incendiary rounds
 

firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
390
Reaction score
50
First Language
English
Primarily Uses
RMMV
@Tiamat-86 I'm confused now... I think I understand what your trying to say, but I don't see it working. It's like making an item in order to get more items. Or something like that?
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
557
Reaction score
232
First Language
english
Primarily Uses
RMMV
skill would have custom requirements notetag so it can only be used when have an ammo box equipped.
the skill will also have notetag <Item Cost: x Bullets>

having normal ammo box equipped lets you use these skills as long as you have some Bullets item
equip "hollow point ammo box" with notetag <Replace Bullets Cost: Hollow Points>
now all skills that cost "bullets" now cost "hollow points" instead

the 4 types of bullets are just basic items to keep track of how many you have.
meanwhile the ammo box equipped determines what type of bullets gets used.
the stats for the different bullets is the ammo box armor's stats

edit: similar concept has been done before for pistol/rifle/shotgun to all use the same skill but costing a different type of bullet.
 
Last edited:

firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
390
Reaction score
50
First Language
English
Primarily Uses
RMMV
skill would have custom requirements notetag so it can only be used when have an ammo box equipped.
the skill will also have notetag <Item Cost: x Bullets>

having normal ammo box equipped lets you use these skills as long as you have some Bullets item
equip "hollow point ammo box" with notetag <Replace Bullets Cost: Hollow Points>
now all skills that cost "bullets" now cost "hollow points" instead

the 4 types of bullets are just basic items to keep track of how many you have.
meanwhile the ammo box equipped determines what type of bullets gets used.
the stats for the different bullets is the ammo box armor's stats

edit: similar concept has been done before for pistol/rifle/shotgun to all use the same skill but costing a different type of bullet.
Yeah... sorry, I didn't understand any of that. Its just not clicking with me. Maybe, an example will help... or a link to the method thread you mentioned?
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
557
Reaction score
232
First Language
english
Primarily Uses
RMMV
the 1st and 2nd paragraph IS an example.
step 1: make a skill cost item
step 2: make equipment change the item cost to a different item
 
Last edited:

xDRAGOONx

Veteran
Veteran
Joined
Jan 22, 2019
Messages
223
Reaction score
174
First Language
English
Primarily Uses
RMMV
I'd say the part that is making this difficult is the wanting of the ammo itself being an equip. If you use the ammo just as a basic item, you can much easier set it as the cost for skills that use it. You could always make skills called, "Hollow Points" that represents the ammo and then just draws from the inventory items for cost. So, you'd set up your ammo box equip. Then your ammo skills require that the player has ammo box equipped. Then those ammo skills cost actual ammo, which is items. You could also use states to create "Load Hollow Point" skill that simulates loading a clip of hollow points. You can use the state to control which skills are available to the player depending on which ammo is loaded, or which state is currently active.
 

firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
390
Reaction score
50
First Language
English
Primarily Uses
RMMV
@Tiamat-86 and @xDRAGOONx What I'm not getting is the whole "Ammo Box" part. Let me see if I have this right... You have an item/armor "Ammo Box". You set the skill up so that it can only be used if that "Ammo box" is equipped. Then you set the skill cost to an amount of "Bullets" and now you set the "Ammo Box" to replace itself with "Bullets". Now the skill will be usable when the "Ammo Box" is equipped and you have the right number of "Bullets".

Is that right?

Now for the part that I'm confused about... All of it.
Basically, it's making an item to use an item. Plus, it doesn't replace the problem of multiple types of "Bullets" being used for the same skill. Additionally, I have no idea how to make a skill require that an armor/item is equipped. I can require a weapon, but not anything else from what I see.

-------------------

Let me try this:
I have four types of "Bullets" (Common, Unique, Rare, and Legendary). I can have them equipped in the "Ammunition" slot I created and they each have strengths that differ from the others. Each "Bullet" type replaces the attack to match their attack with a skill matching their name. I set up a common event in each skill to erase one "Bullet" when used.

That part is the part that works perfectly, now the tricky part:
I have a skill, "Double Tap". At the moment it doesn't require ammo, but I want to make so that you need at least 2 "Bullets" of any type to use it and that type has to be equipped. I could use the SkillCostItems plugin if I only wanted one type of "Bullet" to be usable in the skill (Like the "Attack" skill above), but I want the skill to utilize the strength of the other types of "Bullets" as well.

I just don't have a good way to disable the skill when one of the two requirements (Amount of "Bullets" is equipped) is not true.
No "Bullets"? Skill Disabled.
Not Equipped? Skill Disabled.
Both Equipped and 2 "Bullets"? Skill Enabled.

Like I said before... It would have made things a lot easier if Yanfly had added in EquipTypes into his SkillCostItems plugins, but he didn't and I doubt it ever will be added in the future.
 

xDRAGOONx

Veteran
Veteran
Joined
Jan 22, 2019
Messages
223
Reaction score
174
First Language
English
Primarily Uses
RMMV
I work late today but I will absolutely look into the plugins and see if I cant help figure out something that works.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
557
Reaction score
232
First Language
english
Primarily Uses
RMMV
no. ammo box is a piece of equipment.
bullets are a completely separate basic item with no stats to them at all.

think of the ammo box equipment as just being a clip.
an empty clip not going to do you any good, and having bullets with no clip just as useless.
you dont use the equipment slot to hold ur consumable ammo
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,113
Reaction score
1,524
First Language
EN
Primarily Uses
RMMZ
:kaohi:
  • Ammo items are armors 8, 9, 10, and 11.
  • To use this skill, the user must have at least 2 of these items equipped.
If that sounds correct, then try this notetag:
Code:
<Custom Requirement>
var ids = [8, 9, 10, 11];
value = ids.reduce(function(a, c) {
  var item = $dataArmors[c];
  return a + (user.hasArmor(item) ? 1 : 0);
}, 0) >= 2;
</Custom Requirement>
What this does is loop through the specified IDs: for each one that the user has equipped, it adds 1 to a running total. Then it says "if this total is >= 2, value is true [i.e. skill can be used] else it is false [cannot use]". (Hopefully it works, haven't tested it.) :kaophew:

I've done the loop using reduce, more info here in case you're interested:
 

firestalker

Veteran
Veteran
Joined
Nov 18, 2015
Messages
390
Reaction score
50
First Language
English
Primarily Uses
RMMV
no. ammo box is a piece of equipment.
bullets are a completely separate basic item with no stats to them at all.

think of the ammo box equipment as just being a clip.
an empty clip not going to do you any good, and having bullets with no clip just as useless.
you dont use the equipment slot to hold ur consumable ammo
But how does it handle multiple types of ammunition? Or do you mean that there are different types of clips and the SkillCostItems would replace it when you use it instead of the bullets?

EDIT: @caethyril thanks... I'll check it out when I get home. It looks like what I was looking for though. Thanks again

EDIT2: @caethyril okay... you're close [doesn't work, but looking at what you said it seems like you need 2 of each types of ammo in order for the skill to work], but what actually needs to happen is that you have one set of 2 ammo... You equip that ammo and the skill is usable. You use the skill and the ammo is expended, you can no longer use the skill. You still have one of the other types of ammo and so you equip one of them and the skill is usable again.

Example:
Ammunition Slot: Common Bullets [2 count in inventory (one in inventory and one equipped)]
Double Tap usable
Use DT
Ammunition Slot: Empty
DT not usable
Rare and Unique Bullets in inventory [2 each]
Equip Unique Bullets
Ammunition Slot: Unique Bullets [2 count in inventory (one in inventory and one equipped)]
DT usable again
Use DT
Power increased because Unique Bullets increases strength a bit compared to Common Bullets.
Ammunition Slot: Empty
Does that help a little better with what I'm trying to do? I think I should have done something like this earlier now that I think about it.
 
Last edited:

xDRAGOONx

Veteran
Veteran
Joined
Jan 22, 2019
Messages
223
Reaction score
174
First Language
English
Primarily Uses
RMMV
So yanfly's skill cost item plugin does support using armor as a skill cost. It does not say whether or not it will recognize a piece of armor that is equipped. I am guessing that it won't, to keep from creating a bug. It does mention that it will not recognize independent items for ammo usage. If youre using Item core and independent items, you could be running into an issue there, if your bullets are set as independent items, either through notetags or by default.

The method that I am envisioning utilizes 1 skill type(Load Ammo), 1 accessory(Ammo Box), 5 States(1 per ammo type), 10 skills( 5 to "load ammo" and activate the states that give the double tap skills and 5 different double tap skills that all require the different ammo types) and 5 normal items(the actual ammo) that will be used as the cost for the skills.

I am working on the system now but I have to head to bed and I work early tomorrow but I will continue tomorrow after work. I am probably more than half way done with the frame work so it should take me too long.

-UPDATE-

Here's my take

First create the basic items that will act as your ammo:
1603159902993.png

Notice the <Not Independent Item> notetag.

Next create the 5 states:
1603160099578.png

The notetag:
<Swap Gauge 2: Item 1235>

changes the character's MP gauge to reflect the amount of Ballistic Ammo currently in the party's inventory.

The notetag:
<Custom Apply Effect>
origin.removeState(270);
origin.removeState(271);
origin.removeState(272);
origin.removeState(273);
origin.refresh;
</Custom Apply Effect>

controls the states so that when one is activated, the others are removed. Notice how Ballistic removes states 270 - 273. Hollow Point state would remove states 270, 271, 273 and 274.

origin.refresh; refreshes the character after each state change to update and visual changes that may take place(state icons, gauge swapping and thing like that).

Lastly, each state will add the corresponding Double Tap skill to the users available skills pool. At this point the skills haven't been made yet, so let's do that next.

The Skills:
So the first 5 skills add the corresponding states:
1603160911728.png
Make sure under 'Traits' to add 'Add State' and add the corresponding states to each skill.

Notice the <Instant Cast> notetag. This allows the player to change ammo types without expending their turn.
The next 5 skills are the actual Double Tap skills that will be used to deal damage to the enemy.
1603161712307.png

<Item Cost: 2 Full Metal Rounds> sets the skills cost.

<Custom Show Eval>
if (user.isStateAffected(270)) {
visible = true;
} else {
visible = false;
}
</Custom Show Eval>
makes it so the skill only shows when the corresponding state is active. The number should be the ID of the corresponding state, ex. 270 for Full Metal, 217 for Armor Piercing and so on.

Also note that i set the Repeat field to 2, to make the skill hit twice to fully be a double strike style attack, meaning that each individual strike is dependent on its own hit chance.

Now make the 'Ammo Box' accessory:
1603163396742.png
For the traits, add your gun skill skill type to allow the equipping character access to the skill types.
Also add the 5 'Load Ammo' skills to give access to swapping clips when the ammo box is equipped.
Note, I didn't implement any equip control for the Ammo Box, since i am not sure which method you are using to control who can equip which gear, but if youre using yanfly's Equip Core and Equip requirements, you can use

<Equip Requirement>
class: Gunner
</Equip Requirement>


I know this probably isn't exactly what you are looking for but I feel like this system has plenty of room for modification and could potentially work as a starting point for someone looking to implement a similar system.


Also, try adding the <Not Indeoendent Item> notetag to your existing ammo armor items and see if that makes your system work. I have a feeling it might solve your problem.
 

Attachments

Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,017
Messages
1,018,356
Members
137,802
Latest member
rencarbali
Top