Storing Questions for a Quiz Game

MadDoctor5813

  • Posts: 2
I'm trying to make a quiz game, and I have the questions ready and made. But, is there a way to read external files from Stencyl? I have the questions already organized in an xml file. How would I go about reading this file? If you can think of a better way to organize my questions, then please share it, as my current solution is kind of clunky.

Tuo

  • *
  • Posts: 2469
There's probably a way to do it directly with coding, but my workaround is to put thing all into one text and then use a separater to show Stencyl where to break it up (use one of the text to list conversions in the text part of the Numbers & Text palette). I did that idea in my "Demo - Word Search" on StencylForge, using spaces to show the different words to search for.
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)

gruffman

  • *
  • Posts: 564
Could you store the questions and answers in an array list? I'm not sure what the maximum characters they can take per field though.
Now available for all Android Devices - Happy Face Concentration
My Games To Date
Find A Face / Hero Of Oda / Snakes And Ladders
Hungry Monkey available at fgl.com for Sponsorship
My site - Gruffgames.com

gplar

  • Posts: 1115
Put your questions, answers and correct indicator in a list, one question on each line. No limit as far as I know.
Like this:
Who wrote Hamlet?#Ibsen#Shakespeare#Doyle#2
Using a separator you wouldn´t use in the actual text.

Then pick randomly from your list and use the split text blocks (see shot) to make one question, three (or more, but consistently) alternative answers to choose from and a correct choice.

If you have themes make separate lists or make a system in your main list.

To get them into the list, make a txt file in any editor, one question per line (edit your xml) and import into the list.

AlwaysPoetry

  • Posts: 4
This is very useful for a quiz game I'm trying to remake in Stencyl that I had already made in xcode/swift.  Like the OP, I already have all my questions set and ready to go.  I am new to Stencyl and the problem I'm running into is that all the quiz tutorials seem to want me to make one scene for each question - but I have far too many questions to consider this (seven levels with three categories in each level, so I'd be making 21 game attribute lists in all).   Might anyone know where I can find a how-to or demo for having one scene for multiple questions?  Even if I need to make one scene for each attribute list, that would be OK, I suppose, but I would prefer to have a menu the user could navigate to choose their level and then their category so I could use that input to select the correct game attribute list from which to pull random questions.  Any help on this would be much appreciated!