• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • 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.

Password to trigger pokemon battle?

  • 9
    Posts
    9
    Years
    Hi! Sorry if this post is a bit scatterbrained, but I've never really participated in a forum before. Anyways, I'm trying to make an event where you write a certain message on a shrine to trigger a wild Shaymin battle. So far I have it to work up to where you can enter a message, but it doesn't trigger anything. I don't really have much experience in RPG Maker XP so I apologize if the answer is really easy.

    This is what I would like to do the message input: youtu.be/sByOsZ6myFU?t=31s (sorry for bad quality, I couldn't find another video for it)

    I'm pretty sure that the Conditional Branch is the part the part that is not working, but I'm not sure how to say "if message === "pure"". Thanks in advance.

    Code:

    @>Text: A small wooden monument has multiple messages scrawled on it.
    @>Text: Write something?
    @Show Choices: Yes,No
    : When[Yes]
    @>Script: message=pbEnterText(_INTL("What will you write?")0,7,_INTL(""))
    @>Conditional Branch: Script: message== "pure"
    @>Change Battle BGM: '(file w/ long name which I'm not going to bother putting here)'
    @>Wait: 10 frame(s)
    @>Screen Flash: (255,255,255,255), @5
    @>Wait: 5 frame(s)
    @>Play SE: '492Cry_1', 100, 100
    @>Script: pbWildBattle(PBSpecies::SHAYMIN,20)
    @>Control Switches: [0059: Shaymin battle] = ON
    @>
    : Else
    @>
    : Branch End
    @>
    : When [No]
    @>
    : Branch End
    @>
     
    My game has a starter selection where if you tell the Professor certain passwords, he'll add starters to your options. There are in-game hints to what those passwords are.

    Here's how the main page for the Professor event looks.
    [PokeCommunity.com] Password to trigger pokemon battle?


    What your issue likely is, is that you have defined a variable "message", but then use it on two different uses of the Script command. Between those two commands, it wipes all local variables - including "message", so when the Conditional Branch command checks to see if message=="pure", message is empty. Hence, you need to store the message as a GLOBAL variable.
     
    Back
    Top