Inventory and tables

I would like to create an app that keeps track of items you have at home. For example, I would have
Lamp- 2
Bed- 3
Table - 1

So I want to give the player all the items and then they input how many they have for easy recall. I also want to group the objects (kitchen stuff, bathroom stuff, etc.).

Is there a way to do this using tables? Finally, I would like to import this data from a list I complied, is there a way to do that too?

Thank you,

Chris

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Both are possible. You can create a table with column labels named after your items and then pre-populate or populate the cells with values when the app is running:

    Change Table Value
    Table: tableName
    Row: game.itemType
    Column: 1

    Where game.itemType is the name of the item, such as "Lamp" (with quotes in the expression editor).

    Keyboard input is tricky because you can't convert text to numbers. You'd have to have counter arrows (less/more) to allow the player to change the count for each item.

    And you can import tables from csv files. You just can't import/export the column labels. Those have to be added manually in GameSalad.

    You can certainly group items, but you'll have to decide how to do that. For example, you might do Change Attribute game.KitchenStuffCount to tableCellValue(tableName,"Lamp",1)+tableCellValue(tableName,"Bed",1)+tableCellValue(tableName,"Table",1).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • mrchris317mrchris317 Member Posts: 78
    This was helpful, but still above my head. Thank you for letting me know the possibilities though:) Also could I have an input next to the number.

    For example, I click kitchen, then all kitchen items come up.

    Microwave would be first on the list.

    Next to microwave there would be an input box and I can click it and enter 4, 10, 100 etc.

    I know you said I can do up and down arrows, but can the person input the number themselves?

    Thank you for your help:)

    Chris
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited December 2012
    You can do pretty much anything you can think of with GameSalad. How is another question. First, figure out how to do it in English. For example, instead of thinking "I click kitchen, then all kitchen items come up," phrase it more specifically as "I click an image of a kitchen and the counts (or images?) related to the kitchen appear on the screen next to the actor with the image of a kitchen. If I click a different category image, those items disappear and different items appear." Then, once you have that idea better defined, you can decide if you want to use transparency to hide actors or if you want to change their position so that they are onscreen/offscreen. If you need help once you have the specific idea, post more details here.

    How would the person input the number themselves? The Keyboard Input behavior allows for storing a text attribute. Since you can't convert text to integer, there is no way to do that. You could create a custom keyboard where each letter or number is an actor and when you press 3, you increase the number of lamps or whatever by 3. Of course, if they then press 7, you have to convert the 3 to 30 and add 7 to it. If they then press 4, you have to convert the 3 to 300, the 7 to 70, and add 4 to it. Make sense? You'd also want a button to clear the number back to 0 in case they make a mistake.

    To get you started, here's a demo of your initial question:

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • mrchris317mrchris317 Member Posts: 78
    tatiang thanks again for your helpful input. I will look into this. Thanks for the demo as well:)
Sign In or Register to comment.