• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking 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.

Cool Player Titles

Swdfm

Game and Resource Developer
  • 275
    Posts
    6
    Years
    • he/him
    • UK
    • Seen Apr 30, 2025
    #Allows you to give players titles, such as Sir, Madam etc.

    Code:
    #===============================================================================
    #                                Cool Player Titles
    #                                     by Swdfm
    #===============================================================================
    #
    #                 To use, call $Trainer.title
    #                 Recommended for use in Trainer Cards etc.
    #
    #===============================================================================
    #===============================================================================
    #
    #          - PLAYERTITLES is a constant used for the variable to store all the 
    #            unlocked titles.
    #          - The array from pbPlayerTitle is where you are to put your title
    #             names.
    #          - Use pbUnlockTitle(NUMBER) to unlock titles. NUMBER is the index of
    #             the title from the array just mentioned. Begins with 0.
    #          - pbLockTitle(NUMBER) locks the title.
    #          - pbStripTitle(NUMBER) makes the title blank.
    #          - Call pbChooseTitle to pick a title from a list of unlocked titles.
    #             add an argument to give a message while selecting.
    #             eg. pbChooseTitle("Pick a cool title!")
    #             Ensure at least one title is unlocked before calling this.
    #          - Call pbCheckTitle(NUMBER) to check if a certain title has been
    #             unlocked.
    #          
    #===============================================================================
    #
    #            Thanks for using, and please credit Swdfm if used in your game.
    #
    #===============================================================================
    
    
            PLAYERTITLES = 19 #Change this number to an empty global variable.
    
    
      def pbPlayerTitle
        #Change these to titles you want for your own game.
        array=[
        (_INTL("Trainer")),     (_INTL("Sir")),       (_INTL("Lord")),
        (_INTL("Count")),       (_INTL("Duke")),      (_INTL("Master")),
        (_INTL("Priest")),      (_INTL("Ninja")),     (_INTL("Student")),
        (_INTL("Warrior")),     (_INTL("Fighter")),   (_INTL("Champion"))
        ]
        
        if $Trainer.isFemale?
          array[1]=(_INTL("Madam"))
          array[2]=(_INTL("Lady"))
          array[3]=(_INTL("Countess"))
          array[4]=(_INTL("Duchess"))
          array[6]=(_INTL("Priestess"))
        end
        
        return array
      end
    
      def pbInitTitles
        #Makes all the titles into an array full of falses.
        if pbGet(PLAYERTITLES)==0
          $game_variables[PLAYERTITLES]=[[]]
          for i in 0...pbPlayerTitle.length
            $game_variables[PLAYERTITLES][i]=false
          end
        end
      end
    
      def pbListTitles
        #Returns an array of your unlocked titles.
        pbInitTitles
        array=[]
        unlock=$game_variables[PLAYERTITLES]
        for i in 0...unlock.length
          if unlock[i]==true
            array.push(pbPlayerTitle[i])
          end
        end
        return array
      end
    
      def pbChooseTitle(message=nil)
        #Gives a list of available titles that you can select from and pick a title.
        array=pbListTitles
        if array != nil
          command=Kernel.pbShowCommands(message,array,-1) if message==nil
          command=Kernel.pbMessage(message,array) if message != nil
          if command != -1
            name=array[command]
            if name==$Trainer.title
              Kernel.pbMessage(_INTL("You already have this title!"))
              return true
            end
            $Trainer.title=name
            Kernel.pbMessage(_INTL("Your title has been changed to {1}!",name))
            return true
          end
        end
        return false
      end
    
      def pbStripTitle
        #Obviously, removes your title without locking it.
        $Trainer.title=""
      end
    
      def pbUnlockTitle(num)
        #Unlocks a title
        pbInitTitles
        if !pbCheckTitle(num)
          $game_variables[PLAYERTITLES][num]=true
          name=pbPlayerTitle[num]
          Kernel.pbMessage(_INTL("You can now get the title of {1}!",name))  
        end
      end
    
      def pbLockTitle(num)
        #Locks a title
        pbInitTitles
        $game_variables[PLAYERTITLES][num]=false
      end
      
      def pbCheckTitle(num)
        #Checks you have a certain title.
        pbInitTitles
        return true if $game_variables[PLAYERTITLES][num]
        return false
      end
      
    class PokeBattle_Trainer
      attr_accessor(:title)
    end
     
    I liked it, I'll use it as a way to rank the player, I edited a bit for that, but, You could add in Script how to force a Title. I already have, but it's something useful.
    If something is misspelled it is Google Translate.
     
    Last edited:
    In what way could I use this title in game? like does it show up anywhere? im not well versed in scripts to know if i could.
     
    Back
    Top