Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[RELEASED] Trivia Quiz Game Template

Discussion in 'Assets and Asset Store' started by puppeteer, Sep 25, 2015.

  1. mindfulmx

    mindfulmx

    Joined:
    Mar 21, 2017
    Posts:
    40
    Hello, Im using the blocking levels script and it blocks the levels but dont unblock when I have the ponts required..
    do I need to change the CS_GameHighScore value in the script? or what could be the problem?
    Thanks in advance for your help!
     
    puppeteer likes this.
  2. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    The format for a highscore in a scene is name of the scene + the word "HighScore", so in the video example we set it to "CS_GameHighScore" which is the name of the high score value in the single player scene because the scene name is "SC_Game" and the added text is "HighScore".



    What is the name of your scene which you want to get the high score from?
     
    mindfulmx likes this.
  3. mindfulmx

    mindfulmx

    Joined:
    Mar 21, 2017
    Posts:
    40
    Yes its working!
    Thanks!
     
    puppeteer likes this.
  4. guyjud

    guyjud

    Joined:
    Feb 17, 2018
    Posts:
    1
    I am considering purchasing your template, but could not find any info in the discussion thread whether setting up push notification is possible for a quiz app that is built using your template. Thank you
     
    puppeteer likes this.
  5. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I haven't tried push notifications on my template, but I saw some users that have that integrated into some of my templates. In general it should work depending on the plugin you use for it.

    One of the free solutions I found on the unity store uses the OneSignal plugin which should support cross platform push notifications:
    https://assetstore.unity.com/packages/tools/integration/easy-mobile-lite-78737
     
  6. djoleeeee

    djoleeeee

    Joined:
    Nov 12, 2016
    Posts:
    24
    There are multiple problems with Leaderboard...

    1. all game modes scores goes to same place... (solved it by adding scene name as custom text and filter by it later)
    2. if two players enter same name, only one (better) score will be shown... (solved it by adding random number to name and trim it later)
    3. there are only 8 (hardcoded) places on list (solved it by instantiating 50 elements and later fill it with data)

    I have now 2 problems...

    How to instantiate exact number of elements? I want to change this:


    Code (CSharp):
    1. for (index = 0; index < 50; index++) {
    2.                 GameObject go = Instantiate(defaultPlayer, Vector3.zero, Quaternion.identity) as GameObject;
    3.                 go.transform.SetParent(leaderboardPlayers, false);
    4.                 go.GetComponent<RectTransform>().localScale = new Vector3(1, 1, 1);
    5.                 go.GetComponent<Text>().text = "Loading...";
    6.                 go.transform.FindChild("ScoreText").GetComponent<Text>().text = "";
    7. }
    with this:

    Code (CSharp):
    1. foreach (dreamloLeaderBoard.Score currentScore in scoreList) {
    2.                 GameObject go = Instantiate(defaultPlayer, Vector3.zero, Quaternion.identity) as GameObject;
    3.                 go.transform.SetParent(leaderboardPlayers, false);
    4.                 go.GetComponent<RectTransform>().localScale = new Vector3(1, 1, 1);
    5.                 go.GetComponent<Text>().text = "Loading...";
    6.                 go.transform.FindChild("ScoreText").GetComponent<Text>().text = "";
    7. }
    But it not working...

    Also, can you please make tutorial how to add button on start page who will trigger prefab with high score list? I can't do that without sanding score... :/
     
    puppeteer likes this.
  7. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    About the button that displays high scores, you can call on the dreamlo object directly with LoadScores(). Here's a function that would work in the leaderboard screen of a scene:

    Code (CSharp):
    1.         /// <summary>
    2.         /// Shows the current leaderboard without adding a score to it
    3.         /// </summary>
    4.         public void ShowLeaderboard()
    5.         {
    6.             // Show the score to the dreamlo leaderboard
    7.             dreamloLeaderboard.LoadScores();
    8.  
    9.             // Show the leaderboard object
    10.             leaderboard.SetActive(true);
    11.  
    12.             // Show the leaderboard results
    13.             showLeaderboard = true;
    14.  
    15.             // Show the leaderboard object
    16.             GameObject.Find("Base/Leaderboard").SetActive(true);
    17.         }
    18.  
    About showing X number of players in the leaderboard, you don't need to change the code, just add more players in the list of players you have in the leaderboard ( in the UI in the scene ). Right now you have 8 so it shows the first 8 players and stops. You can duplicate for example 50 players and then increase the size of the scroller so you can scroll through all of them, and the leaderboard will fill them up to the number of players available.

    Here's a vid showing both points:
     
  8. djoleeeee

    djoleeeee

    Joined:
    Nov 12, 2016
    Posts:
    24
  9. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Update 1.99 for TQG has been submitted, should be online in a few days.

    Update 1.99 (26.02.2018)

    - Bug fix: During a game session only the first Dynamic XML quiz is loaded. When trying to load a different quiz it doesn't update the questions.
    - Bug fix: When using Dynamic XML in category grid, the category unlock state is not updated correctly.
    - Bug: Question Limit is always 0 when using Dynamic XML component.
    - Fix missing button links from dreamlo package.
    - Upgraded Music script to allow cross-fading music clips.
     
  10. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I had a couple of questions regarding the DreamLo scoreboards video tutorial. On some of the packages the button link that sends scores is empty, so it needs to be assigned from the scene again ( this doesn't appear in the video ).

    Here's how it should look in your game:
    TQGScore.png

    The SendScore button should target the leaderboard object and call the function TryToSendScore.
     
  11. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Update 1.99 for TQG is live at the store, check it out! It has a few fixes mainly in the XML features.
    https://www.assetstore.unity3d.com/#!/content/45521?aid=1011lGiL

    Update 1.99 (26.02.2018)

    - Bug fix: During a game session only the first Dynamic XML quiz is loaded. When trying to load a different quiz it doesn't update the questions.
    - Bug fix: When using Dynamic XML in category grid, the category unlock state is not updated correctly.
    - Bug: Question Limit is always 0 when using Dynamic XML component.
    - Fix missing button links from dreamlo package.
    - Upgraded Music script to allow cross-fading music clips.

    From now on my focus is on 2.0. I've been researching features and UI for a while now and will post some mockups for you guys to see.
     
    mindfulmx and hopeful like this.
  12. DjUpgrade

    DjUpgrade

    Joined:
    Mar 11, 2018
    Posts:
    1
    Hi Puppeteer, Great Work on this template! I really like this design and am about to purchase. Just wanted to ask first if there is any multiplayer support between multiple devices? (like a buzzer style trivia game played between multiple devices on a local or online network) if not, would it be possible for me to add that feature somehow through editing?
    Thank you.
     
    puppeteer likes this.
  13. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    This package only has single player ( and local hotseat multiplayer ) game modes, but I'm testing options for online/lan play for version 2.0, maybe head to head or a kahoot style connection players can make to compete with each other. But there is nothing solid in that direction yet.

    One of the plugins I was looking at, that I could possibly make an integration guide for is this:
    https://assetstore.unity.com/packages/tools/input-management/easy-wifi-controller-31991

    It allows multiple mobile devices to connect as controllers for a game, so I imagine using this to let players connect and choose answers for a quiz.
     
    odincode likes this.
  14. mindfulmx

    mindfulmx

    Joined:
    Mar 21, 2017
    Posts:
    40
    Hello, how easy/hard will be to change the "extra life" video form unity ads to admob (or other)??
    Thanks in advance for your answer!
     
    puppeteer likes this.
  15. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    In UnityAds at the point where we get a reward ( after watching the ad successfully ) a function is called which can be anything in the scene from any object. In our case we call the ExtraLife function from the GameController. So based on the same logic there should be a similar function call for AdMob that we can use to target the ExtraLife function in the GameController, though I never tried such a thing ( I don't use AdMob ).
     
    mindfulmx likes this.
  16. Realidade

    Realidade

    Joined:
    Mar 9, 2016
    Posts:
    24
    When I change the questions in the inspector nothing happens. What's the problem? Do I always have to change in xml? How to assign an xml?

    Some work change in the inspector. Others do not, GameMath example.
     
    Last edited: Mar 24, 2018
  17. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    You have several options for changing questions in a quiz. You can do it directly in the editor, or import questions from an XML file into the editor, or link a dynamic XML file that reads the questions when the game is running.

    Can you show me your gamecontroller and what happens when you try to change the questions? Do they just not change? Or do they change and then not save?
     
  18. Realidade

    Realidade

    Joined:
    Mar 9, 2016
    Posts:
    24
    I will ask a more complete question and I will post with pictures.

    Thanks in advance for the quick reply !!!
     
    puppeteer likes this.
  19. voceradio

    voceradio

    Joined:
    Nov 6, 2017
    Posts:
    5
    Hi Puppeteer, i've buyed your fabulous software!
    I have 3 problem/question:

    1) I've made a sound quiz with some talking voice. I ear the music to max volume but the sound of the voice (linked to the questions) at half volume. If i put one audio file of my voice in Music component: my voice sound loud as the music. Both the volume of Sound and Music are set to max (1).

    2) I've make a new folder of 3 category as you show in your pretty video. I can't find where set the possibility to lock or unlock the category. Also, i can't find where to set the amount of point that can unlock one category. Your "TQG Lock Level Button" won't go with Category.

    3) In Quiz Sound, when all the question end, i can ear another audio file of the next question. If i loose the game (and appear the RED screen) i can't ear the audio issue of the next question. How can i solve? I would like that the game finish with the WINNER GREEN SCREEN without ear another audio question.

    My configuration is Windows 10 Professional 64bit, Unity 2017.3.of3 (a9f86dcd79df)

    Many Thanks for your work and for your help!
    Paolo :)
     
    Last edited: Mar 30, 2018
    puppeteer likes this.
  20. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi,

    I answered your question through mail, but I want to post it here too for the benefit of all.

    1) Take a look at your SoundSource object in the scene, it is probably set to Spatial Blend 3D which makes all sounds very low. Set it to 2D instead.

    TQGSpatialBlend.png

    2) The TQG Lock Level component is used for locking entire scene ( like in the main menu ), and you can set in it the high score needed to unlock a level (scene). The category grid is locked differently, you need to win in a category you are playing in order to unlock the next one. Open the CS_GameCategoryGrid scene and select the CanvasCategoryGrid object from the scene. Here you have all the categories of this scene or game mode.

    TQGCategoryGrid.png

    Here's a video about adding a category grid to a scene:


    3) I'm not sure about this one, I'll take a look and see what is happening there.
     
  21. voceradio

    voceradio

    Joined:
    Nov 6, 2017
    Posts:
    5
    Thank you very much. I've solved the sound volume problem. :)

    I've still the sound problem to the end of a audio quiz. The same problem is on your default sound quiz.

    I've seen your linked video for create a category grid and i've done easily.
    But when i try to make unlocked only the first category (as i show to you in my attachment picture) the other category won't unlock at the end of the completed first one. How can i unlot the 2-3-4 etc category? I understand that don't unlock with bonus point but every time that the previous category is unlocked.

    Many Thanks!
    Paolo
     

    Attached Files:

  22. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    It should unlock when you reach the Victory screen of the current category. Which version of the package do you have? I want to test it out to see if there is a problem.
     
  23. voceradio

    voceradio

    Joined:
    Nov 6, 2017
    Posts:
    5
    Hi, i've buyed It 5 days ago and i have the last version. The 1.99 i think.
    I've created a new group of category (as showed in your video tutorial) but the category locked won't unlock at the winning screen.

    Thanks
     
  24. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I'm testing the unlocking on Unity 4 and 5. Take a look at this video:



    Does it behave the same on your side?
     
  25. TalhaDX

    TalhaDX

    Joined:
    Feb 2, 2013
    Posts:
    94
    Ki
    Kindly update me once the bug is fixed and live. Great work btw. :)
     
  26. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    From my test on Unity 4 and 5 it's all working correctly as it shows in the video ( next category is unlocked after winning the current category ), still waiting for other users to report their findings too.
     
  27. voceradio

    voceradio

    Joined:
    Nov 6, 2017
    Posts:
    5
    Hi, sorry for my late and Thanks for your reply.
    I've seen your video but when i've made some new category and put in a folder (as you show in other video) the new category won't unlock. I'll make another one time your tutorial video from beginning and i'll say you soon a replay.

    Do you have some news about the audio that play another question on the Winner green screen? This issue appear also with your template sound. I've seen that if i put 10 question and choose to show only 5 question this issue appear. In fact, under the Winner green screen i see the next question with relative sound. If i put 5 question and decide to show 5 question this issue don't appear.

    Thanks! :)
     
    puppeteer likes this.
  28. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Yes, about the final question sound playing before showing the victory screen, here's how you can prevent this. In the TQGGameController script just update this line of code:

    Code (CSharp):
    1. if ( questionLimitCount < questionLimit )    PlayQuestionSound();
    Like the screenshot below
    TQGQuestionLimitSound.png
     
  29. voceradio

    voceradio

    Joined:
    Nov 6, 2017
    Posts:
    5
    Beautiful! It work! Many Thanks! :)
     
    puppeteer likes this.
  30. TalhaDX

    TalhaDX

    Joined:
    Feb 2, 2013
    Posts:
    94
    Just purchased the asset. Great Work.

    Please guide me on how can i achieve this:

    Already done:
    I have added a difficulty level PlayerPref in first menu option. User can toggle to "Basic or Advance".
    And i also added another tag in XML file saying <difficulty> which holds the value for each question whether it is Basic or Advance.

    Question:
    In every game Mode (currently I testing on TrueFalse scene) I want questions to be loaded every time from related XML. And only questions with selected difficulty level should be loaded.

    I guess I have found the code but i am having trouble loading questions every time from the file.
    Please guide me on this.
     
    puppeteer likes this.
  31. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    From a design point of view I believe you can get the desired "Easy" and "Hard" modes by using the main menu to load two different sub-menus, and then in each one you can have the relevant game modes for your project.

    For loading questions at runtime you can use the TQGDynamicXML component which can load a quiz from either an online or a local location, like this:

     
  32. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    I got a question from a customer regarding how Categories are saved in the local PlayerPrefs records. The way it works is based on the value of Category Name in the component, like this screenshot below:

    TQGCategoryName.png

    The format for the actual PlayerPrefs record can be found in the TGQGameController script here:

    CategortUnlock.png
     
  33. nztaku

    nztaku

    Joined:
    Apr 19, 2018
    Posts:
    1
    Hi there. I want to buy this template. I have one question, When I make a game, can I upload the game to Apple store or any other online game?
     
    puppeteer likes this.
  34. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Hi,

    Yes, you can upload the game to any online store.
    The template is meant to be used like that, and you can have your own quizzes inside and different graphics, etc
     
  35. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Was asked how to increase the delay in time when showing an answer, and right before showing the next question. It's not exposed in the component but you can do it in the code here (Open TQGGameController.cs):

    TQGDelayAfterAnswer.png
     
  36. HitsuFZ

    HitsuFZ

    Joined:
    Aug 17, 2015
    Posts:
    2
    puppeteer likes this.
  37. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Try to toggle off the Show Correct Answer field in your gamecontroller. This will avoid showing the answer which will not give the player a chance to quickly click on other buttons before they disappear.

    TQGShowCorrectAnswer.png
     
  38. HitsuFZ

    HitsuFZ

    Joined:
    Aug 17, 2015
    Posts:
    2
    Hello.
    Thank you very much. The error is fixed.:)
     
    puppeteer likes this.
  39. sales_unity764

    sales_unity764

    Joined:
    Mar 9, 2018
    Posts:
    8
    First off amazing template. Secondly I'm new to Unity and C programming. Where in the template is the scoring system to allow levels to open up. Also is there away to put a timer on the life so it doesn't reset every time like most games out where they get a heart every so often.
     
    puppeteer likes this.
  40. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Thanks,
    For the level lock/unlock you can take a look at this video:


    I'm also pasting this from the package documentation about level locking:

    Locking levels
    Since version 1.90 a simple component allows you to lock levels based on a PlayerPrefs record value of your choice. In order to lock a level button, first make sure it is a Button and that it has the TQGLoadLevel component attached to it. Then drag a TQGLockLevelButton component to this button. This is how it looks:
    TQGLockingLevels.png

    In the case above we put a lock on the HotSeat mode button, and checked the highscore from the single player mode. If the high score is higher than 1000, then the HotSeat level gets unlocked, and if not then a custom message appears.

    I'm not sure about your other question, how do you want lives to behave?
     
  41. sales_unity764

    sales_unity764

    Joined:
    Mar 9, 2018
    Posts:
    8
    Quick question on the closeup guess the picture game is the actual picture supposed to pop up after answer. Just with the demo scenes included the only the description of picture and a blue box pops up not the whole picture after an answer.
     
    puppeteer likes this.
  42. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    It should look like that:

    ezgif.com-optimize(2).gif
    Which version of the project are you using? I want to test it out on m side.
     
  43. sales_unity764

    sales_unity764

    Joined:
    Mar 9, 2018
    Posts:
    8
    I'm Using Unity.3.1f1 and 1.99 of your software. Thanks
     
  44. sales_unity764

    sales_unity764

    Joined:
    Mar 9, 2018
    Posts:
    8
    Here is what my screen look like.
     

    Attached Files:

  45. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    Import the attached package to your project, it has some modified code that should solve this issue. Try it and tell me how it goes.
     

    Attached Files:

  46. sales_unity764

    sales_unity764

    Joined:
    Mar 9, 2018
    Posts:
    8
    Man you are awesome works great now. Thank you so much
     
  47. julien-b

    julien-b

    Joined:
    May 8, 2015
    Posts:
    31
    Hi,
    Where can we find a demo on iOS/Android ?
     
    puppeteer likes this.
  48. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
  49. Minoterrae

    Minoterrae

    Joined:
    Jan 4, 2018
    Posts:
    6
    Can this template be used with the free version of Unity or does it require the Pro version?
     
    puppeteer likes this.
  50. puppeteer

    puppeteer

    Joined:
    Sep 15, 2010
    Posts:
    1,282
    It works with the free version of Unity, also with older versions starting from Unity 4, Unity 5+, up to Unity 2017 and 2018.