You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

DVD random trivia game

Alright, so this is very specific, but will hopefully be useful to others as well

I am creating a trivia game on a DVD

-each question is a menu item with the ability to select 1 of 4 answers (a,b,c,d)

-if the answer is wrong, it plays a 'Wrong' video track. I need this to loop back to the menu that played previous to it. (i.e., I'm on question 8, I get it wrong, it will play the 'wrong' video track then I need it to go back to question 8.)

-if the answer is correct, it plays a 'correct' video track, then has to move on to another question, one that hasn't played before. (so I get question 8 right, it plays the 'correct' video track, then needs to select another question that is not 8, or any other one I have already played)

If it is too much to make it a non-repetitive random play, then I'd be fine with a repetive random play.

Any help is greatly appreciated!

Posted on Aug 4, 2005 8:50 PM

Reply
18 replies

Sep 17, 2005 5:22 AM in response to flaws2004

The way I would do this, given the scripts from before is this:

First of all, add in the tracks to be incorrect answer responses... I am guessing that you want these to be contextual to the question, otherwise a single track for the incorrect answer would be OK (you simply point every incorrect button to the same clip). Set the end jumps for all of the tracks to be to select a question again (in the example, point them to the 'select_question' script). You can delete the 'Try_again' script now - it isn't needed if you want to simply go on to another question regardless of being right or wrong.

To keep track of the 15 questions (making sure none repeat), alter line 2 in the select_question script to be one more than the number of questions that you have got. Together with line 1 this counts how many times the script has run so currently on the 6th iteration you jump to the exit screen. You would change that value to be 16. You would also point the 'goto' command to whatever the last line in the script actually is... currently it is line 29.

Line 4 of the same script needs to have a modulus value of 16 as well, so that you get a possible 0-15 as values when you generate a random number.

You also need to extend the script to cover 15 questions, instead of just five. This is a case of copying the repeated sections enough times for each question. In the example project I have partitioned a GPRM (GPRM3, to be precise) into 16 bits and started naming each bit Q1, Q2, Q3 and so on. For each repeated section you would need to continue this pattern - rename the partitions to go up to Q15 (which leaves 1 bit unused) and make sure the repeated sections show the correct Q number.

You would add the new buttons to the menus, and create all 15 menus as you want them. Since you are not going to return to a question if you get it wrong, remove all prescripts from the menus. Currently these hold the values necessary to return to the last one played, so you can safely remove them.

However, you do need to extend the 'clear_all' script to cover every GPRM and partition and re-set them to zero if you are going to allow the viewer to have a new attempt to go through your quiz. Currently, the single button on the 'Finished' menu points to this script. If you don't clear the GPRMs then you cannot do the quiz a second time without stopping and re-starting your disc/player.

In all, you can achieve what you want with two scripts - 'select_question' and 'clear_all'.

One word of caution - the select_question script is already using 68 commands and you may run out of space in that when you repeat the sections over and over. If you do, set the last command in the script to point to a new script which you will create. Call it something like 'select questioncont' and simply carry on the script from there... so possibly you'll need three scripts. If you do use this splitting method then remember that line 2 of the 'select_question' script will need to read differently. You could simply set it to 'Jump Finished If (GPRM0>=16)' instead of having it go to the last line. You could also remove the last line if you do change line 2 since it is only used by line 2 in the script, but I'd leave it in as a catch all safety net.

This should be all you need to do to set this up, I think. If you do decide to keep a score then there will need to be another script or two (plus the possible scores as clips or graphics in tracks or menus - I would use a track), but it is all possible and could provide some useful feedback to your viewer. Good luck!

Dec 9, 2005 12:07 PM in response to Jeff PARENT

Jeff - so sorry to ahve missed this post right at the end of the thread. I hope by now you have found the answer, but if not, what you need to do is allocate three GPRMs to be partitioned in order to hold a value for each question asked. ALl you then do is give each partition a relevant name, and in the scripts, move a value of '1' into the appropriate partition according to the question number that is generated.

The entire thing can be expanded even further if you want. You could use a fourth partition to keep track of the bit slots in the other three. When a register has all 16 slots filled (i.e. all the questions linked to that register have been asked) you could assign a value to a partition in the fourth register to say that questions 1-16 (for example) are no longer necessary to produce. You could then re-use the original register, but use a different random number script which works with a number set outside of the 1 - 16 values.

In effect you are tracking sets of 16 questions at a time. When a set is complete, clear that register and assign it to be re-used, but don't generate questions within the original range of the register. You could then create a quiz with 16x16 questions... or 256 questions.

Again, you might allocate two registers to track the sets of 16... or even three to give even more possible question sets, but it gets progressively more intense to program. Keep in mind that there is a limit to the number of lines a script can have, but that you can have up to 10,000 scripts in a project (which should be enough... ;-))

DVD random trivia game

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.