Table setup- noob needs help

dacaamdacaam Member Posts: 12
edited May 2012 in Working with GS (Mac)
First time user question.

My game needs an extensive database of questions (possibly hundreds) to be fed randomly to the player, and each question can only every be viewed once (otherwise it would skew the player next time they see it). The game would then keep track of responses on a per player basis and load the score next time they play the game. Ideally, the questions will fall into several categories- domestic policy, jobs, defense... it's an election themed game- and I'd like to track the answers categorically as well as in aggregate.

My idea was to
1, create a table of possible questions with a unique number and categories for each question (so I can continue to add to the list without effecting what has happened before)
2. have the engine look to see if the question has been used previously then flag it so it's removed from play permanently.
3. log the answer with the category so it can be tracked and displayed as a graph later

I have some ideas of how to do this, but there is probably a right way and a wrong way to go about it.
Can anyone advise me how to best set this sort of table up?

Many thanks!

Mark

Best Answer

  • MotherHooseMotherHoose Posts: 2,456
    Accepted Answer
    @dacaam …you can start now …

    as the questions are categories … add a table for each category
    then selecting a random question will be more efficient …
    row# … serves as question#
    columns for display would be: … question … answerRed … answerBlue … answerIndependent
    you can track questionsUsed with a gameAttribute … text type … adding qx#s to it
    you can then randomize questions and not display those that are in that textAttribute
    and you can save/load the content of that gameAttribute

    difficult to verify an answer with keyboardInput
    … as that is caseSensitive/pluralSensitive and requires correct spelling
    think checkBoxes would be less frustrating

    for graph … easy if just tracking with category
    each answer would add 1 to the correct categoryRed or Blue or Independent
    then graphs would just be as a meter for the number in that category
    to graph answer for each and every question would require numerous attributes

    ==
    start with 3 questions/tables … see how things work
    once functionality is perfect … expanding is easy!

    ==
    I am eagerly awaiting writeable tables!
    though tables just store values for attributes …
    writing/storing new values will be phenomenal!
    … even if the runTime tables are not save/load capable …

    image MH

Answers

  • dacaamdacaam Member Posts: 12
    Thanks for that.
    I'm a little nervous waiting, since it's timed to the election. Waiting might mean I miss my window, you know?
    Any idea when that feature will become available?
  • dacaamdacaam Member Posts: 12
    Mysterious... I like it.

    So, what is a writeable table? A table that can update based on in game actions?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Mysterious... I like it.

    So, what is a writeable table? A table that can update based on in game actions?
    Yes. A readable table (currently implemented) allows for a spreadsheet of data that can be read from the table during the game. A writeable table means that you can also change the values during the game, thereby allowing saving of multiple attributes quickly and easily.

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

  • dacaamdacaam Member Posts: 12
    Thanks.

    Does the engine care what format the spreadsheet takes- what information goes where- or is that definable within the engine? (please forgive me if this is a dumb question, but I'm new at this :-)

    Thanks a lot for your help, everyone.

    M
  • dacaamdacaam Member Posts: 12
    Thank you, everyone!
    So, now that writeable tables have arrived (sounds awesome!) how does this change the table setup for my purposes? It seems as if, as tshirtbooth mentioned, it will make things a whole lot easier.

    As a noob, I would think I can set a column value as a boolean, and then use the "Change Table Value" attribute to True once the quote has been used.

    How would I then track the player's answers- with a different table that sums the value of their answer and displays the sum when asked?

    BTW, if anyone wants to take this on I'm willing to compensate you and then make the setup available to the community.

    Thanks again.
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    @dacaam -

    Tshirtbooth has a great video for going through a list randomly and making sure you cannot get the same question. It should get you started.

    Here you go: http://gshelper.com/cycle-through-a-list-at-random-with-out-repeats-gamesalad-tutorials-video/
  • dacaamdacaam Member Posts: 12
    Thanks- that looks great.

    So, NOW the question is "how do you select text from 2 columns in the same random row and display the text from both?" In this case it would be a category like energy policy and the text for the policy itself? If you are calling for a random row, and like in the tutorial for a specific column, how can you also call text from the same row but a different column? You can't use a separate action because that will randomize the row and that might give a different answer (like foreign policy)... right?
    Can't figure that out...

    Thanks to you all, you've been really helpful to me!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited June 2012
    When you get the value of the random row, just lookup the columns you need associated with that row. For example, tableCellValue(CategoriesTable,game.RandomRow,"PolicyName"). If you are randomizing the row when you lookup the first cell value, you need to instead do a Change Attribute game.RandomRow to random(1,tableRowCount(CategoriesTable)) and then use game.RandomRow in each of the tableCellValue lookup expressions.

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

  • dacaamdacaam Member Posts: 12
    I think I get that...I think :-)
    I'll give it a go and thanks again to all.
Sign In or Register to comment.