Hi everyone, I'm back with another question lol.
My idea is when a character has nothing equipped in a slot, the help window shows text describing that slot, ie. "Main Hand", "Off Hand", "Head", "Body", "Accessory". Once an item is equipped, the help text shows that item's description as it normally does.
I'll share what I've got so far and I know it's wrong and that I'm missing some js concepts. With that, help would be appreciated. I think right now when I look at it I get a bit overwhelmed and have a hard time keeping track of what I'm doing. I'm sure this could be done much more streamlined using arrays, but piecing that all together is a bit out of my reach.
I thought using the actor ID would be the way to cycle through the current party members, but index might be better? So below is what I've got in between thoughts. Definitely a WIP.
Again, thanks for any and all help!
EDIT: I got some helpful assistance yesterday which makes me think that something like this might be the way to get started. I'm working on it still.
So far that writes the helpEquipSlots according to their index in the help window regardless if there's something equipped or not.
My idea is when a character has nothing equipped in a slot, the help window shows text describing that slot, ie. "Main Hand", "Off Hand", "Head", "Body", "Accessory". Once an item is equipped, the help text shows that item's description as it normally does.
I'll share what I've got so far and I know it's wrong and that I'm missing some js concepts. With that, help would be appreciated. I think right now when I look at it I get a bit overwhelmed and have a hard time keeping track of what I'm doing. I'm sure this could be done much more streamlined using arrays, but piecing that all together is a bit out of my reach.
I thought using the actor ID would be the way to cycle through the current party members, but index might be better? So below is what I've got in between thoughts. Definitely a WIP.
Again, thanks for any and all help!
Code:
Scene_Equip.prototype.update = function (index) {
Scene_MenuBase.prototype.update.call(this);
const actorIndex = this._actor.index();
for (let i = 0; i < actorIndex; i++) {
const actor_id = $gameParty.battleMembers()[i].actorId();
const noItem0 = $gameParty.battleMembers()[i].equips()[0] == null;
const noItem1 = $gameParty.battleMembers()[i].equips()[1] == null;
const noItem2 = $gameParty.battleMembers()[i].equips()[2] == null;
const noItem3 = $gameParty.battleMembers()[i].equips()[3] == null;
const noItem4 = $gameParty.battleMembers()[i].equips()[4] == null;
if (this._slotWindow) {
if (this._slotWindow.active) {
if (this._slotWindow._index == 0 && noItem0) {
this._helpWindow.setText('Main hand');
} else if (this._slotWindow._index == 1 && noItem1) {
this._helpWindow.setText('right hand');
} else if (this._slotWindow._index == 2 && noItem2) {
this._helpWindow.setText('your hand');
} else if (this._slotWindow._index == 3 && noItem3) {
this._helpWindow.setText('my hand');
} else if (this._slotWindow._index == 4 && noItem4) {
this._helpWindow.setText('their hand');
}
}
}
}
};
EDIT: I got some helpful assistance yesterday which makes me think that something like this might be the way to get started. I'm working on it still.
Code:
Scene_Equip.prototype.update = function (index) {
Scene_MenuBase.prototype.update.call(this);
const item = this._actor.equips()[index];
const helpEquipSlots = ['Main hand.', 'Off hand.', 'Head', 'Body.', 'Accessory.'];
if (!item) {
this._helpWindow.setText(helpEquipSlots[this._slotWindow._index]);
}
};
So far that writes the helpEquipSlots according to their index in the help window regardless if there's something equipped or not.