• 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.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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!
  • 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.

Confusion with making a trainer battle against an NPC you can name

  • 10
    Posts
    9
    Years
    • Seen Nov 26, 2015
    Hey everyone,
    I don't know why I am having so much trouble creating the rival battle. I was able to set it up just fine when I made the Rival's name, but now I am allowing the player to type in the name. Every time I test the battle, the game asks me if I want to add this trainer, but I believe that I already did. I've tried messing around with the PBS trainer file, the script editor, and the event code, and I'm not sure which one(s) are causing the problem for me. I've included some screenshots of what my scripts look like. Any help would be greatly appreciated.
     

    Attachments

    • [PokeCommunity.com] Confusion with making a trainer battle against an NPC you can name
      gameplay.PNG
      16.7 KB · Views: 8
    • [PokeCommunity.com] Confusion with making a trainer battle against an NPC you can name
      PBS trainers.PNG
      15.3 KB · Views: 7
    • [PokeCommunity.com] Confusion with making a trainer battle against an NPC you can name
      script editor.PNG
      27 KB · Views: 9
    • [PokeCommunity.com] Confusion with making a trainer battle against an NPC you can name
      script.PNG
      8.8 KB · Views: 5
    change "rival1,12" in your conditional branch script to "rival1"...
    Code:
    pbTrainerBattle(PBTrainers::RIVAL,"rival1",_I("You win."),false,0,true)
    The strange thing with your request is, you're trying to make a standard trainer... It's pretty basic Essentials knowledge, especially if you want to make a Pokémon game... Check the Pokémon Essentials Wiki if you're confused with anything.
     
    Thanks Nickalooose,
    After I changed "rival1,12" to "rival1" the game allowed me to start the battle. But when the battle starts the game tells me "RIVAL rival1 wants to battle!" I need the game to pull the rival's player chosen name, which is why I thought I needed the ,12, so that it could pull the global variable. I did look at the Wiki when trying to do this and I didn't quite understand it.

    Long story short: How do I make the game pull the global variable containing the rival's player chosen name?

    Thanks in advance!
     
    By default, the rival's name is stored in Global Variable slot 12. Read the comment above the RIVALNAMES array (in your third image).
    For example, when you use
    Code:
    pbSet(12,pbEnterText("Rival's name?",1,7,"Gary"))
    the variable number 12 is set to whatever the player inputs.
     
    Back
    Top