I am using SMRD Walk Character Battlers in my latest project, and I am running into a problem. I am hoping to change (at will) which walk battler is used for Actor 1 (can't change actors due to conflicts with other plugins), but since this plugin is set up through notetags, it has proven difficult to do.
I am trying to dive into the Javascript to figure out how I can change this manually, but tbh I'm still pretty much a noob lol. But so far, here is what I got:
It seems that once the database is loaded, the plugin sets up which actor is supposed to use which sprite based off of this code.
This looks like it sets up something called battler._wcb_battler. Then, it looks like this is referenced in battle here.
So, in theory, I think that if I could figure out a way to change battler._wcb_battler for Actor 1 through a script call or something else (rather than note tags), I could change the actor image as well. But that is pretty much where my ability stops and I don't know exactly how to go about that lol.
Could anybody help me figure out what a script call would look like if I were to do it? Or am I completely off in figuring out how I would make that work lol? Maybe I would have to write any changes into the plugin itself?
Sorry if this is all super noobish or doesn't make any sense lol.
EDIT: I realize now this might have fit better in the Javascript/Plugin Support category. My apologies if I did that wrong, and please feel free to move it there if it is appropriate.
I am trying to dive into the Javascript to figure out how I can change this manually, but tbh I'm still pretty much a noob lol. But so far, here is what I got:
It seems that once the database is loaded, the plugin sets up which actor is supposed to use which sprite based off of this code.
JavaScript:
_.loadNotetags = function(data, isActor) {
const tag1 = /<Walk\s*Battler\s*:\s*(.*)\s*>/im;
const tag2 = /<Walk\s*Battler\s*Index\s*:\s*(.*)\s*>/im;
const tag3 = /<Walk\s*Battler\s*Scale\s*:\s*(.*)\s*>/im;
const tag4 = /<Walk\s*Battler\s*Sleep:\s*(.*)\s*>/im;
const tag5 = /<Walk\s*Battler\s*Sleep\s*Index:\s*(.*)\s*>/im;
const tag6 = /<Walk\s*Battler\s*Death\s*Type\s*:\s*(.*)\s*>/im;
const tagA = /<Walk\s*Battler\s*Victory\s*Motion\s*:\s*(.*)\s*>/im;
const tagE = /<Walk\s*Battler\s*Weapon\s*ID\s*:\s*(.*)\s*>/im;
for(let i = 1; i < data.length; i++) {
const battler = data[i];
if(battler) {
if(battler.note.match(tag1)) {
battler._wcb_battler = String(RegExp.$1);
ImageManager.loadCharacter(battler._wcb_battler);
}
if(battler.note.match(tag2)) {
battler._wcb_battlerIndex = parseInt(RegExp.$1);
}
if(battler.note.match(tag3)) {
battler._wcb_battlerScale = parseFloat(RegExp.$1);
}
if(battler.note.match(tag4)) {
battler._wcb_battlerSleep = String(RegExp.$1);
ImageManager.loadCharacter(battler._wcb_battlerSleep);
}
if(battler.note.match(tag5)) {
battler._wcb_battlerSleepIndex = parseInt(RegExp.$1);
}
if(battler.note.match(tag6)) {
battler._wcb_battlerDeath = String(RegExp.$1).toLowerCase();
}
if(isActor) {
if(battler.note.match(tagA)) {
battler._wcb_victoryMotion = String(RegExp.$1).toLowerCase();
}
} else {
if(battler.note.match(tagE)) {
battler._wcb_battlerWeapon = parseInt(RegExp.$1);
}
}
}
}
};
This looks like it sets up something called battler._wcb_battler. Then, it looks like this is referenced in battle here.
Code:
Game_Battler.prototype.isWalkBattler = function() {
const battler = (this.isEnemy()) ? this.enemy() : this.actor();
return !!(battler._wcb_battler);
};
So, in theory, I think that if I could figure out a way to change battler._wcb_battler for Actor 1 through a script call or something else (rather than note tags), I could change the actor image as well. But that is pretty much where my ability stops and I don't know exactly how to go about that lol.
Could anybody help me figure out what a script call would look like if I were to do it? Or am I completely off in figuring out how I would make that work lol? Maybe I would have to write any changes into the plugin itself?
Sorry if this is all super noobish or doesn't make any sense lol.
EDIT: I realize now this might have fit better in the Javascript/Plugin Support category. My apologies if I did that wrong, and please feel free to move it there if it is appropriate.