Additional Bank Functionalities

Then I’m doubly lost… If you’re only telling it to transfer one, it should only transfer one.
image
image

Honestly… I kinda like it the way it is right now :sweat_smile: - in other words, we deposit everything we got from the game itself, and we only withdraw what we need. It just makes sense that you’ll want to throw in everything you have, and only take out a specific quantity

It’s actually how I’d interpreted your request in the first place, but I was able to make it transfer one at a time both ways.

Somehow… I can’t get it to work that way though

Here’s the HandleDoubleClick() method from mine (as far as I can see, this simply handles Player Inventory before falling back to other inventory

        private void HandleDoubleClick()
        {          
            InventoryItem item = inventory.GetItemInSlot(index);
            int number = inventory.GetNumberInSlot(index);
            if (item == null || number<1 ) return; //Nothing to do
            if (inventory.gameObject.CompareTag("Player"))
            {
                var otherInventoryUI =
                    FindObjectsOfType<InventoryUI>().FirstOrDefault(ui => ui.IsOtherInventory); //will return the other Inventory or null
                //Check to see if it's not null (should never happen), if it's Active, and if the otherInventory's inventory is valid.
                if (otherInventoryUI != null && otherInventoryUI.gameObject.activeSelf && otherInventoryUI.SelectedInventory!=null)
                {
                    Inventory otherInventory = otherInventoryUI.SelectedInventory;
                    TransferToOtherInventory(otherInventory, item, 1);
                }
                else if(item is EquipableItem equipableItem && inventory.TryGetComponent(out Equipment equipment))
                {
                    EquipItem(equipableItem, equipment, number);
                }
            }
            else //if(!inventory.gameObject.CompareTag("Player") means we're the other inventory.
            {
                TransferToOtherInventory(Inventory.GetPlayerInventory(), item, 1);
            }
        }

OK Please don’t kill me, but that didn’t work either… Something else is off in my code. I’m not sure what it is, or if Unity is just playing with me right now

Uhh Brian… I fixed it. Apparently the same number ‘1’ must be the last input for the ‘TransferToOtherInventory()’ function in both ‘TryHandleRightClick()’ function calls as well. Whenever you’re ready, we can have a look at the Quest bug next :slight_smile:

I’ve actually been working on the quest bug… Or trying to between the cat (I want food! I want out! I want In! I want to sit on your keyboard!) and the bank transfer issue.

I low-key envy you for having a cat tbh. I always wanted one, but my sister is horrified of them… and I temporarily live under her roof :stuck_out_tongue_winking_eye: (and our neighbors have some big dogs tbh)

Well, whenever you move out, be sure to get an owner, er… I mean cat.

Probably not anytime soon. 7.5 years of living in pure isolation, in a whole different country, really made me want to bond with my family terribly again (I’m done with that life for now though)… Might try to talk them into getting us a cat though

By all means, it’s midnight here for me so it’s best that I go get some rest as well, let’s continue the Quest issue in the morning (i.e: tonight for you :slight_smile: )

Privacy & Terms