Hello, I am almost done with my script that reorganizes eTypes upon class change as well as equips the previously worn items after the fact.
One problem I noticed is that if an actor can equip say, javelin in slot 3 eType 10, and then I change classes to a job that cannot equip javelin in slot 3 due to their eType being changed to type 9, the changeEquip function will attempt to equip the javelin anyways, and since the eType is not compatible, the javelin will be removed from inventory and seemingly sent to the void.
I want to fix this with a conditional check to instead replace the item to be equipped with a 0 or a best fit option instead. Pretty much all of this is handled, except for the conditional check to see if the new class can equip the previous item.
I can likely do this by checking this.actor().currentClass().id; and using this for the conditional, but I was wondering if there might be an easier way to go about this. I had thought isEquipChangeOk might work for this, but it seems it only checks to see if there is an equip slot available, rather than comparing it with an eType for compatibility.
Is there a way to modify this.actor().isEquipChangeOk(2) to do so? Or perhaps another function that can do this instead?
Maybe something like this?
this.actor().isEquipChangeOk(2).$dataWeapons[$gameVariables.value(83)]
One problem I noticed is that if an actor can equip say, javelin in slot 3 eType 10, and then I change classes to a job that cannot equip javelin in slot 3 due to their eType being changed to type 9, the changeEquip function will attempt to equip the javelin anyways, and since the eType is not compatible, the javelin will be removed from inventory and seemingly sent to the void.
I want to fix this with a conditional check to instead replace the item to be equipped with a 0 or a best fit option instead. Pretty much all of this is handled, except for the conditional check to see if the new class can equip the previous item.
I can likely do this by checking this.actor().currentClass().id; and using this for the conditional, but I was wondering if there might be an easier way to go about this. I had thought isEquipChangeOk might work for this, but it seems it only checks to see if there is an equip slot available, rather than comparing it with an eType for compatibility.
Is there a way to modify this.actor().isEquipChangeOk(2) to do so? Or perhaps another function that can do this instead?
Maybe something like this?
this.actor().isEquipChangeOk(2).$dataWeapons[$gameVariables.value(83)]
JavaScript:
if (
$gameVariables.value(83) !== 0 && this.actor().isEquipChangeOk(2))
{
this.actor().changeEquip(2, $dataWeapons[$gameVariables.value(83)]);
};