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

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

  • 10
    Posts
    8
    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

    • Confusion with making a trainer battle against an NPC you can name
      gameplay.PNG
      16.7 KB · Views: 8
    • Confusion with making a trainer battle against an NPC you can name
      PBS trainers.PNG
      15.3 KB · Views: 7
    • Confusion with making a trainer battle against an NPC you can name
      script editor.PNG
      27 KB · Views: 9
    • Confusion with making a trainer battle against an NPC you can name
      script.PNG
      8.8 KB · Views: 5

    Nickalooose

    --------------------
  • 1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    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.
     
  • 10
    Posts
    8
    Years
    • Seen Nov 26, 2015
    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!
     

    Savordez

    It's time to end fangames.
  • 115
    Posts
    10
    Years
    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