• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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

130
Posts
11
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.
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    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?
     

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • 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.
     
    130
    Posts
    11
    Years
    • Seen Dec 9, 2020
    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