• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Script] Multiple Choice Test

  • 129
    Posts
    12
    Years
    • Seen Dec 9, 2020
    Is it possible to insert a multiple choice test in Emerald in order to receive an item depending on the answers given?
    (eg. the test in Dragon's Den to obtain Dratini)

    My goal is to script a multiple choice test in order to give the player a Firestone/thunderstone/leafstone depending on the score realized with the answers.
     
    I think so? Just have a variable that you update differently based on the answers that are chosen, and at the end check if its value is the right number, and if so, give the item?
     
    You would be looking to use the 'multichoice' scripting command. In Emerald it displays a message with multiple answers that you can choose between with the number of the answer chosen stored in variable 0x800D which can then be compared. It would look something like this:

    Code:
    ...
    multichoice 0x0 0x0 0x2 0x1 // Put's multichoice 0x2 in the top left corner of the screen, the B button cannot be used to exit
    copyvar 0x8000 0x800D // Moving the player's answer from variable 0x800D to 0x8000 as 0x800D will be overwritten automatically by later commands
    compare 0x8000 0x0 // Checking if the value in 0x8000 is 0x0
    if 0x1 goto @ThunderStone // If it is, they chose the first answer and get a Thunder Stone
    compare 0x8000 0x1 // Checking if the value in 0x8000 is 0x1
    if 0x1 goto @FireStone // If it is, they chose the second answer and get a Fire Stone
    compare 0x8000 0x2 // Checking if the value in 0x8000 is 0x2
    if 0x1 goto @LeafStone // If it is, they chose the third answer and get a Leaf Stone
    ...

    This is a very basic write up of how the multichoice system works but I'd suggest reading diegoisawesome's XSE tutorial to properly learn its functions. In addition, if you're using Emerald's binaries rather than the decomps, you can use LSA's multichoice box editor to change the number of available answers/ total boxes.
     
    You would be looking to use the 'multichoice' scripting command. In Emerald it displays a message with multiple answers that you can choose between with the number of the answer chosen stored in variable 0x800D which can then be compared. It would look something like this:

    Code:
    ...
    multichoice 0x0 0x0 0x2 0x1 // Put's multichoice 0x2 in the top left corner of the screen, the B button cannot be used to exit
    copyvar 0x8000 0x800D // Moving the player's answer from variable 0x800D to 0x8000 as 0x800D will be overwritten automatically by later commands
    compare 0x8000 0x0 // Checking if the value in 0x8000 is 0x0
    if 0x1 goto @ThunderStone // If it is, they chose the first answer and get a Thunder Stone
    compare 0x8000 0x1 // Checking if the value in 0x8000 is 0x1
    if 0x1 goto @FireStone // If it is, they chose the second answer and get a Fire Stone
    compare 0x8000 0x2 // Checking if the value in 0x8000 is 0x2
    if 0x1 goto @LeafStone // If it is, they chose the third answer and get a Leaf Stone
    ...

    This is a very basic write up of how the multichoice system works but I'd suggest reading diegoisawesome's XSE tutorial to properly learn its functions. In addition, if you're using Emerald's binaries rather than the decomps, you can use LSA's multichoice box editor to change the number of available answers/ total boxes.

    Thank you very much!
     
    Back
    Top