I wanted to create a quiz-map in the upcoming future, since there aren't any on the Battlenet.
Now what I wanted to know is, how I can create a System with different rounds and different questions for each round,
So the two things I don't really get is:
1. How can I generate a question with its own answers?
2. How can I show up a random question from my question-list?
Of course I have to use a lot of variables, but it would be great if I could get some tips on some triggers or events how to do this system.
The question at index 0 would correspond to the answer at index 0.
Have a function to initialize all your questions and answers, depending on how many there are.
Random number generation
If you have 25 questions, Cap the random number generator to only generate random numbers up to <25.
Then just print out the question at the index. The answer would of course have the exact same index in the answer array.
Create a trigger that detects when someone types a string then compare it with the answer, if is correct, then use the random number generator to spawn the next question.
Making sure questions don't repeat
Flag all the questions that have been asked with true. Whenever random number generation is done, check if the flag is true, if it is, generate another random number until you get one that isn't.
There may be another more efficient way to do this, though I can't really think of one right now.
@FuzzYD: Thanks you helped me a lot, but I wanted to create dialogs with buttons on it, so I don't know if strings would be helpful since they are for a quiz based on chatting.
SouLCarveRR's post is more in my direction of quiz, I want one with dialogs and buttons, but its hard to create random buttons.
EDIT:
Is there a way to start a random trigger?
Example: Trigger1, Trigger2, Trigger3 <-One of those three triggers should start!
If you're looking to use dialogs. Just have one label dialog control item displaying the question.
Have as many dialog control label items as you need to represent the answers (This is if you're thinking multiple choice)
Are the answers intended to be multiple choice? Or filled in?
Just re-set the dialog label text with your question string at the random index whenever you generate a new random number. Do the same for the answers.
Hope that made sense.. Its gettin late here so I don't have the energy to type out the details.
Thats what I meant!
I'm going use multiple choice, so changing the dialog label would be the best idea thanks.
Creating random numbers is the key for random questions/answers so thanks for help I think I can do it now.
-h34dl4g
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi,
I wanted to create a quiz-map in the upcoming future, since there aren't any on the Battlenet.
Now what I wanted to know is, how I can create a System with different rounds and different questions for each round,
So the two things I don't really get is:
1. How can I generate a question with its own answers?
2. How can I show up a random question from my question-list?
Of course I have to use a lot of variables, but it would be great if I could get some tips on some triggers or events how to do this system.
-h34dl4g
@h34dl4g: Go
Variables
3 Arrays string[100] question; string[100] answers; boolean[100] flagged;
The question at index 0 would correspond to the answer at index 0.
Random number generation
Making sure questions don't repeat
Flag all the questions that have been asked with true. Whenever random number generation is done, check if the flag is true, if it is, generate another random number until you get one that isn't.
for button clicking detection you would use
and use player groups to determine if all the players have ansewered yet or not
@FuzzYD: Thanks you helped me a lot, but I wanted to create dialogs with buttons on it, so I don't know if strings would be helpful since they are for a quiz based on chatting.
SouLCarveRR's post is more in my direction of quiz, I want one with dialogs and buttons, but its hard to create random buttons.
EDIT:
Is there a way to start a random trigger?
Example: Trigger1, Trigger2, Trigger3 <-One of those three triggers should start!
-h34dl4g
@h34dl4g: Go
Oh whoops, sorry misunderstood.
Are the answers intended to be multiple choice? Or filled in?
Just re-set the dialog label text with your question string at the random index whenever you generate a new random number. Do the same for the answers.
Hope that made sense.. Its gettin late here so I don't have the energy to type out the details.
Thats what I meant!
I'm going use multiple choice, so changing the dialog label would be the best idea thanks.
Creating random numbers is the key for random questions/answers so thanks for help I think I can do it now.
-h34dl4g