• 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.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Cyndy, May, Hero (Conquest), or Wes - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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✓] Yes/No Scripts

Ace Trainer Slash

If you give me about two hours, I can make scripts
  • 236
    Posts
    6
    Years
    Hello :)

    I tried making my very first Yes/No script a few days ago, but there seems to be an error.
    The Script is in spoilers.
    The error is that whenever I click the 'No' option in-game, it wouldn't do anything, and if I clicked the A button, it would loop the Yes/No script for some reason. When I click the 'Yes' option in game however, it works as intended to.
    Any ideas on what I have made an error in via script?

    Spoiler:
     
    Last edited:
    You've used the 'if' statement for @no incorrectly. When you're checking for an exact number in a variable (in this case, 0x0 as that's what's returned when you say no) you need to have the if statement be 0x1 like this:

    Spoiler:


    This value is has the following meanings:

    Code:
    Lower Than (0x0)
    Equals (0x1)
    Greater Than (0x2)
    Lower than or Equal to (0x3)
    Greater than or Equal to (0x4)
    Not exactly equal to (0x5)

    You can also rewrite this script to make it shorter and less of a hassle. Since you're using a Yes/No msgbox you only need to make one check to find out the player's answer. Once you've branched the script off to @yes there's no need to check 0x800D again for @no as its a binary question. Here's what it should look like:

    Spoiler:
     
    Oh... Ok then!
    Thankyou for correcting my error, and the extra insights of making the script shorter. :)
    This will prove helpful to me in the future the next time I attempt Yes/No scripts! :D
     
    Back
    Top