- Joined
- May 5, 2012
- Messages
- 5
- Reaction score
- 1
- First Language
- English
- Primarily Uses
So currently, I am using a plug-in known as NeMV State Resources (which, by the way, is licensed under http://www.wtfpl.net/ so modifying it is fine on the legal side... just thought I'd mention that) for my game in order to create extra skill resources. While the plug-in works mostly fine, I have encountered one problematic issue in that if you place a cost on a skill which calls for multiple State Resources, any beyond the first will be pushed onto the next adjoining skill. To demonstrate, here's a screenshot.
As you can see I've added a skill which costs both a "Body Action" resource and a "Mind Action" resource. The problem is that, instead of following YEP Skill Core's multi-cost padding rules, the secondary State Resource cost for this skill has been pushed way across the screen. I've tested it and any additional normal skill costs (MP or TP for example) properly follow the padding rule and fit onto the skill block just fine.
This is the block of code which draws skill costs (found it thanks to the comments on the code, I'm not proficient in Javascript myself unfortunately, I do know a little HTML but that's it xD):
For the time being I've just straight deleted this code block to avoid having this plug-in draw the skill costs entirely, instead moving to keeping the action costs in the skill's description. The problem is that I don't just use this system for Action Points, but also other casting resources which would be useful to have expressed within the skill menu. So while this is not an absolutely essential request and I wouldn't have anyone prioritize this above anyone else's more important request, if anyone could help me out and rewrite this code block so skill costs are displayed properly, I'd appreciate it a TON. Thank you!
PS: Forgot to include a link to the original plug-in, my bad, here you go - http://stitchgaming.com/2016/04/nemv-state-resources/
As you can see I've added a skill which costs both a "Body Action" resource and a "Mind Action" resource. The problem is that, instead of following YEP Skill Core's multi-cost padding rules, the secondary State Resource cost for this skill has been pushed way across the screen. I've tested it and any additional normal skill costs (MP or TP for example) properly follow the padding rule and fit onto the skill block just fine.
This is the block of code which draws skill costs (found it thanks to the comments on the code, I'm not proficient in Javascript myself unfortunately, I do know a little HTML but that's it xD):
Code:
// SKILL COST DRAWING ---------------------------------------------------------
NeMV.SR.Window_SkillList_drawSkillCost = Window_SkillList.prototype.drawSkillCost;
Window_SkillList.prototype.drawSkillCost = function(skill, wx, wy, width) {
var dw = NeMV.SR.Window_SkillList_drawSkillCost.call(this, skill, wx, wy, width);
dw = this.drawSRCost(skill, wx, wy, dw);
return dw;
};
Window_SkillList.prototype.drawSRCost = function(skill, wx, wy, dw) {
for (var sr = 0; sr < this._actor.stateResources.length; sr++) {
var srid = this._actor.stateResources[sr][0];
var sricon = $dataStates[srid].iconIndex;
var srtext = this._actor.stateResources[sr][3];
if (this._actor.skillSRCost(skill, srid) > 0) {
if (sricon > 0) {
var iw = wx + dw - Window_Base._iconWidth;
this.drawIcon(sricon, iw, wy + 2);
dw -= Window_Base._iconWidth + 2;
}
var fmt = Yanfly.Param.SCCHpFormat;
var text = fmt.format(Yanfly.Util.toGroup(this._actor.skillSRCost(skill, srid)), srtext);
this.contents.fontSize = Yanfly.Param.SCCHpFontSize;
this.drawText(text, wx, wy, dw, 'right');
var returnWidth = dw - this.textWidth(text) - Yanfly.Param.SCCCostPadding;
this.resetFontSettings();
dw += returnWidth;
}
}
return dw;
};
For the time being I've just straight deleted this code block to avoid having this plug-in draw the skill costs entirely, instead moving to keeping the action costs in the skill's description. The problem is that I don't just use this system for Action Points, but also other casting resources which would be useful to have expressed within the skill menu. So while this is not an absolutely essential request and I wouldn't have anyone prioritize this above anyone else's more important request, if anyone could help me out and rewrite this code block so skill costs are displayed properly, I'd appreciate it a TON. Thank you!
PS: Forgot to include a link to the original plug-in, my bad, here you go - http://stitchgaming.com/2016/04/nemv-state-resources/
Last edited:

