|
Post by aokisea on Apr 13, 2023 7:15:10 GMT
Hi I just want to know what is the code to modify the items in the inventory. Like change the quantity/amount available or just completely drop or delete the item through code.
|
|
|
Post by Invector on Apr 13, 2023 11:54:46 GMT
Take a look at the Inventory Examples demo scene, there are example triggers that add/destroy/drop/equip/unequip items
|
|
|
Post by zerored on Apr 14, 2023 1:29:46 GMT
Hi I just want to know what is the code to modify the items in the inventory. Like change the quantity/amount available or just completely drop or delete the item through code. Para agregar item al inventario tienes el script (V Add Item By ID) Puedes agregar item, elegir la cantidad, seleccionar si quieres que se equipe. Para remover un item tienes (V Remove Item) Puedes remover, desequipar o soltar un item. Por ID o nombre del Item. El problema es que no te permite elegir la cantidad que quieres eliminar. Eh modificado el código para seleccionar la cantidad pero no se si se permite compartirlo. Pero puedes hacer una copia de (V Remove Item) Debajo de public int itemID; crea una variable, ( public int cantidad; ) Busca itemManager.DestroyItem(item, 1) itemManager.DropItem(item, 1); y cambia 1 por el valor cantidad itemManager.DestroyItem(item, cantidad); itemManager.DropItem(item, cantidad); Ahora puedes elegir la cantidad a eliminar o Soltar.
|
|
|
Post by Strider on Sept 23, 2023 23:08:00 GMT
Take a look at the Inventory Examples demo scene, there are example triggers that add/destroy/drop/equip/unequip items i'm trying to acces it too, i've looked at the scene and it does have interesting examples all using the remove current item, it does work but requires the item to be equiped in a slot from the inventory to work, but if i use the "vremoveitem" script that allows the choose a specific item from the item list by id, it just does nothing. is there something wrong with that script? thanks
|
|