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

[Scripting Question] Retrieving Internal Trainer name from Trainer Number

  • 115
    Posts
    15
    Years
    • Seen Sep 4, 2023
    Hello Guys!

    I'm having trouble writing a code that returns a trainer's internal name.
    More specifically, I'm generating a trainer randomly from a list and I want to get his trainer type.
    I'm trying something like this:
    Code:
    #trainers is an array containing many trainer types
    trainer = trainers[rand(trainers.length)]
    #here I get the name of the Trainer type generated
    type = PBTrainers.getName(trainer[0])
    #However this is the displayed trainer's name, as displayed in a battle for instance.
    I wanted to generate the internal name, something like
    Code:
    PBTrainers::NURSE
    The code I use however gives me the name "Nurse" in type instead.
    How do I get the internal name?
    Thanks!
     
    Last edited:
    Back
    Top