Question regarding Localstorage/Webstorage/Dictionary

0 favourites
  • 8 posts
  • Hello everyone, I'm working on a quiz game, you can check out some of my tweets regarding it (twitter.com/donrifgames). It will have at least 900 questions (I handle questions by XML, but I have to duplicate the same layout 900 times!....maybe i'm doing it wrong, can I keep one layout and change informations on it everytime?)

    So that causes some slowness, I have found some framerate issues on iOS: the localstorage is too slow, the app works fine but it takes time to retrieve saved data. On Android, the asynchronous problem seems to work better than on iOS, though i have not fully tested it on Android.

    I have seen a post by sqiddster where he suggests to save variables/arrays in a dictionary and load the dictionary on startup with the localstorage plugin. I didn't seem to understand how exactly.

    Your help will be much appreciated!

  • If you are creating 900 layouts for 900 questions you are definitely doing something wrong. You should work on the 1 layout solution.

    Storing 900 values in localstorage shouldn't run out of the space limit.

  • If you are creating 900 layouts for 900 questions you are definitely doing something wrong. You should work on the 1 layout solution.

    Storing 900 values in localstorage shouldn't run out of the space limit.

    That's exactly why I thought, but I want to move between questions and it doesn't seem to work when I make "Restart layout" and I change values according to the XML. Any tips?

  • Well not much anyone can do without a glimpse of your code. You should provide a .capx file. I'm not saying that I'll definitely have time to look into it, but you increase the chance of getting help by providing a code example with the problem.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Well not much anyone can do without a glimpse of your code. You should provide a .capx file. I'm not saying that I'll definitely have time to look into it, but you increase the chance of getting help by providing a code example with the problem.

    Alright, thanks, my code is a bit too long and complicated, i'll try to do a simplified capx for the example.

  • simple example:

    sample_questions.xml

    QuizXML.capx

  • simple example:

    sample_questions.xml

    QuizXML.capx

    Thanks very much korbaach, I managed to do it simply by changing a variable according to the XML.

    The red underlined variable is the key: I created a layout named "1" and I add 1 to the variable level_number to pass to the next question.

    The "q" node in the XML is what controls which question you are in.

  • Concerning the WkWebview, I can't load images from XML using "Load image from URL" on iOS, i read this post by Ashley (https://www.scirra.com/blog/ashley/25/h ... -wkwebview) but I can't quite understand if there's a solution to it or not. Anyone can help me ?

    Edit: nevermind amigos, i found the solution: loading-files-not-working-with-wkwebview_p1072160?

    I had the 233 C2 version too, it was corrected since then! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)