NeMV - Actor Equip Points

Nekoyoubi

Plugin & Utility Developer
Veteran
Joined
May 2, 2013
Messages
92
Reaction score
70
First Language
English
Primarily Uses
Plugin: NeMV - Actor Equip Points


Version: 1.0


Author: Nekoyoubi


Release: April 4th 2016


Download: https://raw.githubusercontent.com/nekoyoubi/NeMV/master/NeMV_X_ActorEquipPoints.js


Requires: NeMV - Tags & YEP - Equip Requirements


Introduction


This plugin provides a point-based equipment system with the help of NeMV - Tags & YEP - Equip Requirements. It allows you to build an equipment monitoring system, where when equipping and unequipping weapons and armor to your actors, you can track that equipment based on tags. This can be used to build a point-based equipment system, determine an encumbrance for your actors, or even grant or deny skills, quests, event interactions, etc. based on the points associated to an actor's tagged equipment.


Features

  • Yet another use for those ever-abstract tags
  • Flexible enough to support much more than it does out of the box
  • Assists in building entirely new functional mechanics
  • Has nifty plugin commands for easy access in your events



Example Use Cases


The introduction above should give you a couple of ideas, but in case you missed them here are a few of the examples mentioned:

  • Build a point-based equipment system (e.g. the initial request post)
  • Determine encumbrance for actors (e.g. actors may be adversely affected if wearing too much)
  • Enable/disable skills (e.g. wearing too many cursed items can remove some of your abilities)
  • Event interactions (e.g. people may respond differently to a man of the cloth)



How to Use

First, configure the respective equipment entries in the plugin's parameters as the default plugin parameters illustrate.


Next, tag your equipment with the appropriate tags...  



Weapon  >  Notebox  >  <tags: twohand, sword, demonic>
Armor > Notebox > <tags: shield, angelic, quest>


Now add an equipment limiting tag to your actors (if you are limiting them). You will set the initial maximum here, but this can be changed during the course of play via plugin commands and scripts.  



Format:  <MAX TYPE POINTS: AMOUNT>


Example:



Actor  >  Notebox  >  <Max Gear Points: 10> 




Plugin Commands
AEP comes equipped with plugin commands for adding, removing, and manually setting Equip Point tags. The format for these commands is as follows.  

Code:
AEP COMMAND TYPE TAG [ AMOUNT ]
 Examples:  

Code:
aep add gear buckler 2  
aep remove gear buckler  
aep set holy symbol 1  
aep add gear necklace  
In the examples above, the first adds a new Gear-type entry with the tag "buckler". The second removes the buckler from the Gear-type. This will not remove buckler from any other types that may be watching for it though. The third assumes that a Holy-type "symbol" tag is already setup, and sets sets its point value to 1 going forward. The fourth example creates a new Gear-type entry that defaults to a 0-point value.  



Script (external)


NeMV on GitHub  |  AEP on GitHub  |  AEP on MV Plugins  |  AEP on Stitch Gaming  |  >> Download AEP <<

FAQ


Q: Does this work with YEP - ______?


A: This plugin requires YEP - Equip Requirements for ensuring that your maximum points are respected. You may be able to get away with not using it if you don't want this for restriction, but I have tested that at all, so I can't be sure.Otherwise, I run an almost full YEP stack by default without issue. 


Q: Is this able to be used in commercial projects?


A: Absolutely! Wouldn't that be cool?!


Q: If I use this, do I need to say so anywhere?


A: If you can make use of my work on any level, then I would absolutely love to know about it, but I make no attribution requirements or the like. NeMV is licensed under the WTFPLv2.


Credits & Thanks

  • Yanflyfor letting me integrate with his plugins without shooting me on sight!
  • Cazziuz for requesting the plugin in the first place, and giving me another reason to show people what Tags can do.



Author's Notes


This plugin is the response to a plugin request from Cazziuz. While I'm confident that it will accommodate their needs, I also saw this as an opportunity to allow much more flexibility in how equipment points may be used. I hope you get more from it than you expect. Happy equipping!
 
Last edited by a moderator:

Nekoyoubi

Plugin & Utility Developer
Veteran
Joined
May 2, 2013
Messages
92
Reaction score
70
First Language
English
Primarily Uses
@dragon3025 So sorry for the delay, and thanks very much for putting that sample project together. It helped me immediately identify the issue. So essentially, I had an undeclared requirement (on accident) on YEP - Item Core. I've now updated the plugin to no longer forcibly use YEP - Item Core, but if you do use it, it will continue to function as intended. Please download the latest AEP from Github to resolve your issue.
 

dragon3025

Veteran
Veteran
Joined
Dec 11, 2012
Messages
66
Reaction score
6
First Language
English
Primarily Uses
@dragon3025 So sorry for the delay, and thanks very much for putting that sample project together. It helped me immediately identify the issue. So essentially, I had an undeclared requirement (on accident) on YEP - Item Core. I've now updated the plugin to no longer forcibly use YEP - Item Core, but if you do use it, it will continue to function as intended. Please download the latest AEP from Github to resolve your issue.
Thanks, the problem's gone now. I have another question now, how do I give Equip Points? I followed this post: 




and made sure I set all the notetags the same way, then I used the notetag you posted at the bottom of that page to show the equipment requirement. My player isn't equipped to anything that cost Gear Points, so I know the points aren't being used up. I can't equip the item that does cost Gear Points, and the equipment requirement window says "Current Gear Points: 0/2"
 

Nekoyoubi

Plugin & Utility Developer
Veteran
Joined
May 2, 2013
Messages
92
Reaction score
70
First Language
English
Primarily Uses
Thanks, the problem's gone now. I have another question now, how do I give Equip Points? I followed this post: 





and made sure I set all the notetags the same way, then I used the notetag you posted at the bottom of that page to show the equipment requirement. My player isn't equipped to anything that cost Gear Points, so I know the points aren't being used up. I can't equip the item that does cost Gear Points, and the equipment requirement window says "Current Gear Points: 0/2"


In my initial testing I had something similar, and I could have sworn that I had screwed something up. Turns out it was that I hadn't added the ability to equip that type of armor to that class/actor. Any chance that's your issue here?
 

dragon3025

Veteran
Veteran
Joined
Dec 11, 2012
Messages
66
Reaction score
6
First Language
English
Primarily Uses
In my initial testing I had something similar, and I could have sworn that I had screwed something up. Turns out it was that I hadn't added the ability to equip that type of armor to that class/actor. Any chance that's your issue here?
No, the armor is General Armor type for Body and the actor is allowed to equp General Armor. I can even set the armor in the actor's initial equips settings.
 

Nekoyoubi

Plugin & Utility Developer
Veteran
Joined
May 2, 2013
Messages
92
Reaction score
70
First Language
English
Primarily Uses
No, the armor is General Armor type for Body and the actor is allowed to equp General Armor. I can even set the armor in the actor's initial equips settings.


Is there any way that you can update your sample project download so I can crack it open and give it a look?
 

Nekoyoubi

Plugin & Utility Developer
Veteran
Joined
May 2, 2013
Messages
92
Reaction score
70
First Language
English
Primarily Uses


Thanks much. Oddly enough, when I increase the amount the actors can equip to 3, everything begins working as intended. I'll need to troubleshoot this a bit further to get to the bottom of it, but I will get it fixed up. Thanks again for bringing this to my attention.


EDIT: I've actually already found and fixed the culprit. Please get the latest from Github (1.0.2).
 
Last edited by a moderator:

dragon3025

Veteran
Veteran
Joined
Dec 11, 2012
Messages
66
Reaction score
6
First Language
English
Primarily Uses
Thanks much. Oddly enough, when I increase the amount the actors can equip to 3, everything begins working as intended. I'll need to troubleshoot this a bit further to get to the bottom of it, but I will get it fixed up. Thanks again for bringing this to my attention.


EDIT: I've actually already found and fixed the culprit. Please get the latest from Github (1.0.2).
Thanks, it's working great.
 

Nekoyoubi

Plugin & Utility Developer
Veteran
Joined
May 2, 2013
Messages
92
Reaction score
70
First Language
English
Primarily Uses
Thanks, it's working great.


Awesome! Thanks for all the feedback, sample projects, and patience. Glad it's working for you now. Let me know if there's anything else I can help with. Enjoy!
 

dragon3025

Veteran
Veteran
Joined
Dec 11, 2012
Messages
66
Reaction score
6
First Language
English
Primarily Uses
Awesome! Thanks for all the feedback, sample projects, and patience. Glad it's working for you now. Let me know if there's anything else I can help with. Enjoy!
Okay, I noticed a minor problem. After equipping the equipment, the equipment requirement window doesn't update the equip points until you move the cursor to another equipment.
 

Nekoyoubi

Plugin & Utility Developer
Veteran
Joined
May 2, 2013
Messages
92
Reaction score
70
First Language
English
Primarily Uses
I believe this is inherent to the YEP - Equip Requirements. If you have other restrictions specified and don't see the same, please let me know and I'll look into it and see if it's something I can rectify. It may be a core issue, or it may be the use of the custom requirement text; I'm not sure either way, really.
 

dragon3025

Veteran
Veteran
Joined
Dec 11, 2012
Messages
66
Reaction score
6
First Language
English
Primarily Uses
I believe this is inherent to the YEP - Equip Requirements. If you have other restrictions specified and don't see the same, please let me know and I'll look into it and see if it's something I can rectify. It may be a core issue, or it may be the use of the custom requirement text; I'm not sure either way, really.
Okay. I had a feeling that it has to do with YEP - Equip Requirements when I noticed it, but I wasn't sure.


EDIT: Okay, I added this to the end of YEP - Equip Requirements, and it fixed it:

Code:
Yanfly.EqReq.Scene_Equip_onItemOk = Yanfly.Equip.Scene_Equip_onItemOk
Scene_Equip.prototype.onItemOk = function() {
    var hpRate = this.actor().hp / Math.max(1, this.actor().mhp);
    var mpRate = this.actor().mp / Math.max(1, this.actor().mmp);
    Yanfly.Equip.Scene_Equip_onItemOk.call(this);
    var max = this.actor().isDead() ? 0 : 1;
    var hpAmount = Math.max(max, parseInt(this.actor().mhp * hpRate));
    this.actor().setHp(hpAmount);
    this.actor().setMp(parseInt(this.actor().mmp * mpRate));
    this._itemWindow.hide();
    this._statusWindow.refresh();
    this._requirementWindow.refresh();
};
 
Last edited by a moderator:

pulsusego

Villager
Member
Joined
Apr 8, 2019
Messages
16
Reaction score
13
First Language
English
Primarily Uses
RMMV
Hi! So hopefully it doesn't count as a 'necro' if a post is about a plugin that's still usable, and if it is I apologize; I tried first to post on the author's own site but the comment system there seems to be having trouble submitting correctly, and keeps failing and telling me to refresh and try again, over and over again...

So anyway, here's what I had tried to write over on the site about this plugin:

Hello! I know you made this plugin over two years ago, and the forum post hasn't been active in just as long, but I've found your plugin to be exactly what I needed for my project! That said, I've run into a complete brick wall/roadblock with using it. While using the 10 Equipment Tag slots in the plugin's parameters in the plugin manager, everything works fine. However, I cannot *for the life of me* get the CSV input to work, even when simply using your exact examples as the inputs. I have a fairly lengthy list of categories I need to use, definitely more than 10, but I've spent.. I don't know, six hours? (With interruptions here and there, so not *really* quite that long, if it makes it seem any less sad lol) trying to make this work... I just can't. I'm exhausted from doing every little thing I can think of, and even reading through the code to try to either spot a bug/typo/whatever or realize some god-knows-what issue that I'm doing wrong.

I have everything filled out identically to the example, I've tried using commas with all three example entries, just one single entry without the comma (gear halberd 5), I've tried typing in manually, copy/pasting, doing everything I can think of, and I'm just at such a complete and utter loss. If you could help me out, or maybe take a look at the plugin to see if something's not working right, I would appreciate it so much more than you know. I brainstormed and searched for hours to find a solution to how to work out this mechanic in my game, and your plugin was like a godsend once I found it and worked out how I could make use of it.. Anyway, like I said, if you could shoot me a reply and help me figure this out I would be seriously grateful. I'm going to go finally pass out now that I've staid up far too late trying to figure this out lol. Have a nice night! (Or day, or whatever it is wherever you are~!)
 

pulsusego

Villager
Member
Joined
Apr 8, 2019
Messages
16
Reaction score
13
First Language
English
Primarily Uses
RMMV
After another couple hours of trying to either figure out how to get this to work, or how to simply accomplish what I needed to do a different way with a different plugin, I actually went back to the .js file and figured it out! FINALLY! lol

So, it turns out it was the tiniest little issue. Literally a single character in the .js file. In case anybody in the future tries to use this plugin and has the same issue I had (CSV not working), here's the solution:

Find this in the .js file (open it with Notepad++ or whatever other text editor):
Code:
 * @param Equipment Tags CSV
 * @desc CSV array of strings for more equipment tags counters.
 * Example: gear halberd 5, piety holysymbol 2, cursed voodoodoll 3
 * @default
Now, delete the 's' in Tags in the @param line.
Afterwards, the section should look like this:
Code:
 * @param Equipment Tag CSV
 * @desc CSV array of strings for more equipment tags counters.
 * Example: gear halberd 5, piety holysymbol 2, cursed voodoodoll 3
 * @default
Man, that was a stupidly exhausting effort to fix such a simple little tiny typo/error in the plugin's code. Hopefully somebody out there, at some point, sees this and finds it useful so that the lost hours feel a little less wasted lol. Have a nice day, hopfullyfutureperson.

*Edit: Note that when you change the file, anything you had in the CSV line in your plugin parameters (in the RMMV program itself, not the .js file) will be deleted, so if whatever you have there was time-consuming to type in you're going to want to copy/paste it somewhere else before you edit the file, so you can paste it back in when you reload your project after editing the .js file.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I'm back to the bugs.
100 bugs in my coding,
take one down,
fix it up,
132 bugs in my coding.
On the plus side, if all this rioting sparks another Covid outbreak... I will have a whole lot of time to work on my game. Not exactly how I wanted to get that time, but hey I'm a glass is half full... of RM kind of guy. :LZSwink:
A video once in a while won't hurt.
Have a craving for a Nesquik milkshake. No idea why. Haven't had one since I was a kid. lol. I remember them kinda tasting nice, but also leaving a lot of nasty powder at the bottom of the cup.

Forum statistics

Threads
98,068
Messages
949,008
Members
129,341
Latest member
Shinkukae
Top