Forum rules - please read before posting.

Limit Inventory slots

Hi,

Can I limit the available slots in the inventory to a concrete number (i.e: 4 slots), so the player can't pick more items than choosen number?

Thanks

Carlos

Comments

  • Not in an explicit setting, but you could use parameters (again) to do this:

    Create a Global Variable integer called "Number of items carried".  Whenever you pick up an item, you'll want this number to go up (and down when items are dropped).  And if the integer's value = 4, we can tell AC to not pick the item up.

    Next create two ActionList assets: "AddInventory" and "DropInventory".  Assets are better when using parameters, since we can call them from any scene.

    In AddInventory, we'll want to do the following (again, check the parameters tutorial for more):
    -Variable: Check (check if "Number of items carried" is less than 4 - if not, stop running)
    -Inventory: Add or remove (Set to "Add", and parameter set to the Inventory item)
    -Variable: Set (increase "Number of items carried" by 1

    In DropInventory:
    -Inventory: Add or remove (Set to "Remove", and parameter set to the Inventory item
    -Variable: Set (decrease "Number of items carried" by 1

    Finally, use these ActionLists in place of the usual "Inventory: Add or remove" Actions in your scene.  You can call them by using the "Engine: Run ActionList" Action, at which point you can set which Inventory item is sent as a parameter.
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.