Roleplay Inventory System

Hi all, me again!

So for my Roleplay system, I’ve introduced an inventory now as a list of items for each character. With regards to this, when they chop a tree they receive 1 log. Is there anyway to make it say 2 logs rather than a separate cell that says “log” or am I overthinking here? Basically I want to branch it out a bit so if you can create something with 4 logs but bubble needs to know when there is 4 and to take 4 sperate cells away?

image

I’ve attached a photo, basically when they click ‘Chop’, this is what happens and they get a log for doing it. I want to change it so if they chop a log, but already have one, it just adds it to the cell so instead of it being separate logs, it would be ‘2’ logs, or ‘3’ logs.

Just bumping this, can anyone help me?

Hi there, @jamesmeeds… I don’t know if I understand exactly what you are doing, but it sounds like you only need to create a new thing in the Inventory data type with Item = Log the first time the user chops a tree. Then, every time they chop a tree after that, you make changes to their log inventory thing (as opposed to creating a new thing), and you add 1 to its item quantity. If they do something that uses logs, you can check the log inventory thing to make sure they have enough logs, and you can subtract the appropriate number of logs from the item quantity. Any of that make sense and sound like it could work for you?

Hope this helps.

Best…
Mike

1 Like

I would create a new field on the user instead of a new thing type if all you are counting is a log.

Have a field on the user called ‘Log Inventory’ (or whatever) and have a workflow triggered every “click/chop” that edits that field to +1 to it. Then when every they are used, you have a workflow that is triggered however it is triggered to ‘-1’ or minus however many are needed. (you can minus more than one at a time.) :slight_smile:

I don’t recommend this, but you could do a calculation that sums up the total number of records in the database (with constraints matching that user) and show that as a count. That isn’t really sustainable if a lot of people are using the app.

Yup, that’s where I was going with it, @ben4. If there is only one log inventory thing in the database for each user and the item quantity is the total number of logs the user has, then there’s no need to sum anything. You simply search for a user’s log inventory thing, and you know exactly how many logs the user has by looking at the thing’s item quantity field.