Removing weapon, armor, accessory by ID numer taken from variables

Hi is there a way to remove weapon, accessory armour from Inventory by using the numer taken from variable?

Im trying something like this but its not working ... 
$game_party.gain_item($data_weapons[$game_variable<74>], -1)
 
$game_party::gain_item($data_weapons[$game_variables[1]], 1)


# or


$game_party::lose_item($data_weapons[$game_variables[1]], 1)
$game_party::gain_item($data_weapons[$game_variables[1]], 1)# or$game_party::lose_item($data_weapons[$game_variables[1]], 1)
That was really quick answer thank you!!

and If I want to equip this item by variable ID ? what kind of formula will be ? 
slot = 0item = $data_weapons[$game_variable[1]]$game_actors[1]::change_equip(slot, item)the slot determines which equipment slot to try put the equipment it - this of course needs to match the weapon/armor from the variable, so ou could do something like this instead...

item = $data_weapons[$game_variable[1]]slot = item::etype_id$game_actors[1]::change_equip(slot, item)That would automatically check the equipment type and put it in the correct slot. 🙂
Thanks! Yeah but Im getting the weapon ID of the character that was equiped to variable by this command
$game_actors[1].equips[0].id

so Im getting the ID of weapon and I just want to equip by the number it's not possible by any command ? when I got this ID stored in variable ? ?
(making custom EQ)
Ahhh, so you have a custom equipment system in place that is altering the id of the equipment item?  So for example, you could have 2 weapon id 1 (database id), but their internal id's are (for example) 61 and 62?? 

If you are getting the id of the weapon already equipped, why do you need to equip it? 
Ahhh, so you have a custom equipment system in place that is altering the id of the equipment item?  So for example, you could have 2 weapon id 1 (database id), but their internal id's are (for example) 61 and 62?? 
If you are getting the id of the weapon already equipped, why do you need to equip it? 

ah its because its custom menu with only four items max and when You are full (inventory) when You take off the weapon and you have no free room its will ask You if You want to drop that items which code I've got from you and... If You want to keep it then Its gonna go equip again... Its uses original Equip scene

If there is no such command Im gonna make common event call which will check by command branch if Variable is ID 1 then use Change Weapon, Rpg maker Option
why not just, not unequip the weapon until they have confirmed that they want to drop it, then, unequip it and remove the item from inventory, otherwise do nothing. 🙂
why not just, not unequip the weapon until they have confirmed that they want to drop it, then, unequip it and remove the item from inventory, otherwise do nothing. 🙂
It's not possible because Im using also a Equip Scene from Original Rpg maker so... when You remove there weapon it comes automaticaly to inventory and my custom inventory shows check the free space of "backpack" and if there is any it ask if You want to drop it or keep it 😛

hah I've foud somehting like this but I need to get ID from variable here:

$game_actors[id].change_equip_by_id(slot, equip) if $game_actors[id]
For that script call you could do this.. 

a = $game_actors[1] id = a::equips[0]::id a::change_equip_by_id(0, id) 🙂
a = $game_actors[1]
id = a::equips[#game_varibale[74]]::id  
a::change_equip_by_id(0, id)
 

where put here variable number XD?
 
What value does variable 74 hold? Didnt you say it was holding the value gained from '$game_actors[1].equips[0].id' ?

If it is, then its not required because you can get that same value from the second line in the snippet i posted above: 

a = $game_actors[1] id = a::equips[0]::id # < same as $game_actors[1].equips[0].id a::change_equip_by_id(0, id)Which means there is no need for any variable. 🙂
What value does variable 74 hold? Didnt you say it was holding the value gained from '$game_actors[1].equips[0].id' ?

If it is, then its not required because you can get that same value from the second line in the snippet i posted above: 

a = $game_actors[1] id = a::equips[0]::id # < same as $game_actors[1].equips[0].id a::change_equip_by_id(0, id)Which means there is no need for any variable. 🙂
Im using this Script in Variable Option by Script : $game_actors[1].equips[0].id i put this code there and so 74 variable got weapon ID 😀
Ok, I guess if you have your heart set on using the variable you could do this: 

$game_actors[id]::change_equip_by_id(0, $game_variables[74])How is that? 😛
Ok, I guess if you have your heart set on using the variable you could do this: 

$game_actors[id]::change_equip_by_id(0, $game_variables[74])How is that? 😛
working awesome thank You for all of Your help 🙂  

I finished with weapons setup... now armor.. and accessory xd and Im finished with scripts in my game xD
no worries ^_^

Original thread: https://forums.rpgmakerweb.com/threads/removing-weapon-armor-accessory-by-id-numer-taken-from-variables.42060/