Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs

How to set inventory limit?

A topic by Garry Francis created Sep 05, 2019 Views: 79 Replies: 8
Viewing posts 1 to 4
Submitted

Sorry for all the questions, but...

I've found that there is a test for inventory_item_limit(), but how do I set the limit in the first place? I want to screw down the limit to a more realistic maximum, maybe 5 items. I'm sure I saw this somewhere in the user interface, but my Ctrl+Space hinting and code completion doesn't seem to work properly.

Submitted

It's under settings...

settings {
   inventory_items_limit_var                                    = 10
   inventory_weight_limit_var                                   = 10
   inventory_worn_items_limit_var                               = 10
}

Submitted

I'm not understanding where I put that .-.

should be inside settings right?

Submitted

Correct, except that you can't use an integer. You have to use a reference to an integer variable as described in my post a little further down in this thread.

Host (1 edit) (+1)

I added a full code snippet to the cookbook.

It may be confusing because the game has a settings section, but each theme has a settings section too. I think your problem is that you are looking in the theme settings, not the game settings. Sorry about that.

I've updated the document, which should prevent this sort of confusion for the future:

https://adventuron.io/docs/tut/#_limiting_items_in_the_inventory_the_amount_of_items_you_can_hold_in_your_hands

Submitted(+1)

Good point. I didn't notice that. That's why you're the expert and I'm the newbie.

Host

I'm the obfuscated syntax designer so I better know my way around or we are all doomed ;-)

Submitted

Brilliant. Thanks for that.

Submitted(+2)

I couldn't get that to work. I had to use:

integers {
   max_carried : integer_const "5";
}

settings {
   inventory_items_limit_var = max_carried
}