• 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.

Another quick Scripting question

Rayd12smitty

Shadow Maker
645
Posts
12
Years
    • Seen Feb 21, 2016
    Sorry for another stupid question I am still new to this.

    When coding, what do I use to make a choice/options box. Like in an event when you use "Show Choices"? Also, how do I call a common event from a script.

    Thanks
     
    189
    Posts
    14
    Years
    • Seen Nov 23, 2023
    Look up textbox commands in the wiki, I believe there is something like /ch that spawns a dialog box for those.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen yesterday
    As jim42 said, if you're evening, then you can either use the standard choices event command or /ch for more than 4 options.

    If you're scripting, then you can probably use this:

    Code:
    command=Kernel.pbMessage(_INTL("Make your choice."),[_INTL("Option 1"),_INTL("Option 2"),_INTL("Option 3")],[COLOR=Red]0[/COLOR])
    Choosing Option 1 returns the number 0, Option 2 returns the number 1, etc.

    The red number is the "choice if cancelled" value (default 0 which means can't cancel). -1 means it will return -1 if cancelled, 1 means it will return 0 ("Option 1"), 2 means it will return 1 ("Option 2"), etc.

    There are a couple more parameters for Kernel.pbMessage, which are in order: text skin for the message box, and default command (0=Option 1, 1=Option 2, etc.).
     

    Rayd12smitty

    Shadow Maker
    645
    Posts
    12
    Years
    • Seen Feb 21, 2016
    Thanks Maruno thats what I was looking for. And how do I change where the choice box shows up? I want it on the left instead of right.
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen yesterday
    If you want nearly every single choice box in the game to be on the left rather than the right, then go to PokemonMessages line 914 and change the red part to something obvious:

    Code:
    pbPositionNearMsgWindow(cmdwindow,msgwindow,:[COLOR=Red]right[/COLOR])
    This doesn't apply to some screens, i.e. the ones that have their own def pbShowCommands like the Bag and the party screen. It's up to you to decide whether it's worth it. I couldn't list which choice boxes would be affected, because there are several ways of calling the scripts which the above change would affect.

    Otherwise, there's no way to change its position.
     

    Rayd12smitty

    Shadow Maker
    645
    Posts
    12
    Years
    • Seen Feb 21, 2016
    If you want nearly every single choice box in the game to be on the left rather than the right, then go to PokemonMessages line 914 and change the red part to something obvious:

    Code:
    pbPositionNearMsgWindow(cmdwindow,msgwindow,:[COLOR=Red]right[/COLOR])
    This doesn't apply to some screens, i.e. the ones that have their own def pbShowCommands like the Bag and the party screen. It's up to you to decide whether it's worth it. I couldn't list which choice boxes would be affected, because there are several ways of calling the scripts which the above change would affect.

    Otherwise, there's no way to change its position.

    Oh if theres no way to change just this one i can work around it. Thanks again
     
    Back
    Top