- Joined
- Oct 13, 2013
- Messages
- 25
- Reaction score
- 9
- First Language
- English
- Primarily Uses
- RMMV
This is gonna be a bit complex: so, i'm working on getting a system together dealing with params and their pluses separately. That part has succeeded. i've even managed to redraw the positions of said params and the pluses to look the way i wish (almost). now, the issue involves the xparams.
I've figured out how to add extra stat falsies, which is all that's necessary in the grand scheme. the numbers for those will be variables. the problem is two-fold. i need to be able to get this to show different variables based on which character is being displayed, and i need a piece of code that will allow me to add to the xparams through script. the code i have so far...
my thought involved using $gameVariables.value(actorId + 17) to have it pick the variable i need, 17 is not important. and i have tried this numerous ways, and all of them fail. eg., $gameActors.actorId, this._actor.id, this._actorId, this._actor(actorId), etc., and none of them have worked. a few tell me id or actorId is undefined, or some throw no error, but won't show the variable it should be referencing, or any of those near that variable, that i have set with distinct numbers for troubleshooting. this is problem one.
problem 2 is much more drastic, i think. i'm at least reasonably certain this can be done, since someone had a code snippet in a forum as an answer in vxace. a way to make it so you can add, through script, such as
$gameActors.actor(actorId).addXParam(0, 5);
by adding a number of functions. i THOUGHT i found them all and i tried this:
this did not succeed.
I could really use these two things, is anyone willing to help?
I've figured out how to add extra stat falsies, which is all that's necessary in the grand scheme. the numbers for those will be variables. the problem is two-fold. i need to be able to get this to show different variables based on which character is being displayed, and i need a piece of code that will allow me to add to the xparams through script. the code i have so far...
Code:
Window_Status.prototype.drawParameters = function(x, y) {
var lineHeight = this.lineHeight();
for (var i = 0; i < 6; i++) {
var paramId = i + 2;
var y2 = y + lineHeight * i;
this.changeTextColor(this.systemColor());
this.drawText(TextManager.param(paramId), x, y2, 160);
this.resetTextColor();
//THIS LINE WAS A SUCCESS v
this.drawText(this._actor.param(paramId)-this._actor.paramPlus(paramId) + " ("+this._actor.paramPlus(paramId)+")", x + 130, y2, 60, 'right');
}
this.changeTextColor(this.systemColor());
this.drawText("Hit", x + 190, y, 160);
this.drawText("Dodge", x + 190, y + 36, 160);
this.drawText("Magic", x + 190, y + 72, 160);
this.drawText("Hacking", x + 190, y + 108, 160);
this.drawText("Negotiate", x + 190, y + 144, 160);
this.resetTextColor();
//THESE LINES v
this.drawText(this._actor.xparam(0) + " (0)", x + 330, y, 60, 'right');
this.drawText(this._actor.xparam(1) + " (0)", x + 330, y + 36, 60, 'right');
//THIS LINE v
this.drawText($gameVariables.value(17) + " (0)", x + 330, y + 72, 'right');
this.drawText(); //when just above is figured, these will matter
this.drawText();
};
my thought involved using $gameVariables.value(actorId + 17) to have it pick the variable i need, 17 is not important. and i have tried this numerous ways, and all of them fail. eg., $gameActors.actorId, this._actor.id, this._actorId, this._actor(actorId), etc., and none of them have worked. a few tell me id or actorId is undefined, or some throw no error, but won't show the variable it should be referencing, or any of those near that variable, that i have set with distinct numbers for troubleshooting. this is problem one.
problem 2 is much more drastic, i think. i'm at least reasonably certain this can be done, since someone had a code snippet in a forum as an answer in vxace. a way to make it so you can add, through script, such as
$gameActors.actor(actorId).addXParam(0, 5);
by adding a number of functions. i THOUGHT i found them all and i tried this:
Code:
Game_BattlerBase.prototype.xparam = function(xparamId) {
return this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId) + this.xparamPlus(xparamId);
};
Game_BattlerBase.prototype.xparamPlus = function(xparamId) {
return this._xparamPlus[xparamId];
};
Game_BattlerBase.prototype.addXParam = function(xparamId, value) {
this._xparamPlus[xparamId] += value * 0.1;
this.refresh();
};
this did not succeed.
I could really use these two things, is anyone willing to help?


