Forum rules - please read before posting.

Choosing one inventory item at a time.

Hi Chris,

I am wondering if there is a way I can choose one item in an inventory at a time when I click on it. For example, if a 'trader' has 15 apples, 12 bananas and 3 oranges in a container, how can I make it so when I click on the container slot that has 15 apples, only one is selected to then drag and drop into my inventory? Currently, I can only select all 15 apples, unless I select 'place in separate slots' in the inventory menu, but then all the apples clog up my inventory. 

If it needs to be scripted, could you please point me in the right direction?

Kind Regards,
Tim

Comments

  • I'll look into it recreating this situation.  It's not currently possible IIRC, but it may be that such a feature can be added as an option.
  • Thanks a lot :-)
  • Yeah, this is pretty complex - it involves changes to not just Containers, but also the Crafting and general Inventory systems.  I agree that this should be a feature, however - I may send you a package to test.
  • Oh right. Sure, let me know, that would be great.
  • Hi Chris, were you still planning on sending me a package to test?
  • I did - back on the same day as your last post.  Is it not here?

    Without feedback, I went ahead with the feature as I saw it best implemented.  It's in the latest release via a new option for each inventory item.
  • Sorry I missed that. I was expecting an email alert. That link has expired.
    Any way to get the update without having to update whole project? 

    I imported it into my project after I saved a backup and then reassigned my managers. I'm now getting compiler errors with some custom scripts I had a programmer write for getting in/out of RCC vehicles, and trading pop-up messages, but aside from that I can't find the new option. Is it under the settings manager under inventory settings or inventory manager? 
  • It's in the Inventory Manager, underneath the "Can carry multiple" option.

    Check the "Upgrade notes" for all versions since the last you were using - they will tell you of any changes you need to be aware of that may affect your game / custom scripts.
  • Hi Chris,

    Are you able to tell me which scripts you modified for this so I can just replace those? When I updated AC it wiped all my tags/layers so I ditched that copy and reimported my backup.

    Btw when I release my game in about 3 months I'm happy to credit you as you've been very helpful.
  • Too many to make direct changes for, I'm afraid.

    AC should not update your tags and layers, however.  Try importing just the latest version's Scripts subfolder instead.
  • That's okay. If you remember off the top of your head could you please tell me if you have modified any of the following scripts to add this feature? It would help my programmer heaps so he doesn't have to check all code to re-implement changes.
    1. RuntimeInventory
    2. MenuInventoryBox
    3. Menu
    4. Container
    5. Kickstarter

    Thanks for the tip.

    I wasn't joking about credit btw. 'Special thanks: Chris Burton - Adventure Creator' okay? My project is an educational video game called Rocket Island.
  • 1. and 2. definitely.  Search the codebase for references to the CanSelectSingle() method.
  • Hey Chris,

    So my programmer and I have been working on this for a few weeks now, but we haven't been able to solve this issue without causing more problems. When I update AC or just the scripts folder, I am able to choose one item at a time from the inventory, but then I have lots of problems with player controls, actionlist settings and others. Would you pretty please be able to send me a package to update this feature to my game? I am happy to pay you for your time until we get it working.
  • edited May 2018
    Problems being what, exactly?  It's not clear if you're having trouble with AC itself, or as a result of changes made by your programmer.

    Does the feature work if you try it out in a fresh AC project, separate from your main?  The current update is itself a package that should add the feature - any "package" that includes it would just be the latest release.  If there's a bug with it's behaviour, however, I'll need to know more details.
  • Everything works fine before updating AC, so it must be changes to AC that clashes either with changes made by my programmer, or new clashes with other assets.

    My project is quite complex so recreating everything in a new project is very difficult. I think the simplest solution would be to import the bare minimum scripts needed to implement the CanSelectSingle feature and then worek on integrating them into my project.

    I've scoured through every script in the latest AC update searching for instances of CanSelectSingle. I found the following scripts include it: RuntimeInventory, MenuInventoryBox, InvItem, and PlayerCursor. My programmer has definitely adapted MenuInventoryBox and RuntimeInventory so I can have a canvas pop up when I buy/sell/can't afford, and so I can set different cost and sell prices for the same inventory item in different containers (shops). 

    If we can merge the CanSelectSingle feature in these four updated scripts, with the programmers changes, should the new CanSelectSingle feature work, or are there other scripts that need importing too?
  • Instead of transferring complete scripts, try the following:

    InvItem.cs:
    CanSelectSingle() method
    selectSingle variable

    RuntimeInventory.cs:
    TransferLocalToCrafting method
    TransferCraftingToLocal method

    InventoryManager.cs
    ItemsGUI method

    Then also transfer any mention of "CanSelectSingle".
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.