How to put equipment in normal item inventory?

All party members are temporary and most use their own weapons, so this should only be an issue twice, I'll be able to dance around it, thanks for the concern!
I looked it up and it's a quick fix. Just replace 1 with $gameParty._targetActorId and it will equip the item to the actor you use it on. So below is the full code:
$gameActors.actor($gameParty._targetActorId).forceChangeEquip(0, $dataWeapons[$dataItems[$gameParty.lastItem().id].meta.weaponId]);
I looked it up and it's a quick fix. Just replace 1 with $gameParty._targetActorId and it will equip the item to the actor you use it on. So below is the full code:
$gameActors.actor($gameParty._targetActorId).forceChangeEquip(0, $dataWeapons[$dataItems[$gameParty.lastItem().id].meta.weaponId]);
Thank you! I was trying to use the previous code for armors by replacing instances of "weapon" with "armor" but it didn't work. Do I have to say body armor or something?
I already gave you the code for armor. Make a new common event EquipArmor with the following code.
For (body) armor:
$gameActors.actor($gameParty._targetActorId).forceChangeEquip(3, $dataArmors[$dataItems[$gameParty.lastItem().id].meta.armorId]);

In the Items notebox put
<armorId:x>
Where x is the id of the armor in the Armors database

and under Effects put
Common Event: EquipArmor


If you're using shields, hats or accessories you need to change the 3 to 1, 2, or 4 respectively
Oh I'm dumb XD
Thanks.
I updated the armor script. This will autodetect what type of armor you're trying to equip and put it in the right slot

var itemArmorId = $dataArmors[$dataItems[$gameParty.lastItem().id].meta.armorId];
$gameActors.actor($gameParty._targetActorId).forceChangeEquip(itemArmorId.etypeId-1, itemArmorId);

1690914619255.png
Thank you! I was originally not gonna use other armors but I think I will now.
Well, armor encompasses shields, body, hats and accessories so if you wanted any of those you can do it now all under the EquipArmor common event

Original thread: https://forums.rpgmakerweb.com/threads/how-to-put-equipment-in-normal-item-inventory.159814/