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

Last sent out PkMn message for different trainer IDs?

1,224
Posts
10
Years
  • If you look at your trainertypes.txt, you'll see that the multiple instances of the rival are actually different trainers. RIVAL1 and RIVAL2. So you'd use the same method you would for a different trainer.

    If you're legitmately wanting multiple for the same trainer, something like this would probably work

    Code:
     if isConst?(@opponent.trainertype,PBTrainers,:RIVAL1)
                pbBGMPlay("LastPkMnChampion",100,100)
               msg=rand(2)
              if msg==1
                pbDisplayPaused(_INTL("Message1!"))
             else
               pbDisplayPaused(_INTL("Message1!"))
              end
    end
     

    39Gamer

    39Games
    55
    Posts
    10
    Years
  • well the good news is that it didnt crash/break my game
    but the bad news is that it doesnt display the second message, only the first
     
    1,224
    Posts
    10
    Years
  • well the good news is that it didnt crash/break my game
    but the bad news is that it doesnt display the second message, only the first

    Try this
    Code:
    if pbIsOpposing?(index)
          @scene.pbTrainerSendOut(index,pokemon)
            # Last Pokemon script; credits to venom12 and HelioAU
          if pbPokemonCount(@party2)==1
            # Define any trainers that you want to activate this script below
            if isConst?(@opponent.trainertype,PBTrainers,:Leader_Brock) || if isConst?(@opponent.trainertype,PBTrainers,:RIVAL1)
              @scene.pbShowOpponent(0)
              # For each defined trainer, add the BELOW section for them
              if isConst?(@opponent.trainertype,PBTrainers,:Leader_Brock)
                pbBGMPlay("LastPkMnGym",100,100)
                pbDisplayPaused(_INTL("Ah ha ha! It itches! It itches!"))
              end 
              if isConst?(@opponent.trainertype,PBTrainers,:RIVAL1)
                pbBGMPlay("LastPkMnChampion",100,100)
              if rand(5)>2
                pbDisplayPaused(_INTL("Message1!"))
             else
               pbDisplayPaused(_INTL("Message2!"))
             end
             end
              # For each defined trainer, add the ABOVE section for them
              @scene.pbHideOpponent
            end
            end
          end

    I even tested it, it works. Just replace the if with whatever your condition is.
     
    1,224
    Posts
    10
    Years
  • Is it possible to have this for multiple trainers? I tried this and I get a syntax error..

    It is entirely possible, seeing as the code I posted above is using more than one trainer. Post the code in which you're getting the syntax error if you want help.
     

    39Gamer

    39Games
    55
    Posts
    10
    Years
  • Sorry I didn't mean that.. God I'm so stupid -.-
    I meant having more than two messages? I tried this and I get said syntax error
     
    1,224
    Posts
    10
    Years
  • Sorry I didn't mean that.. God I'm so stupid -.-
    I meant having more than two messages? I tried this and I get said syntax error

    What does your script read? Should be something like this

    Code:
    if rand(5)>3
                pbDisplayPaused(_INTL("Message1!"))
             elsif rand(5)>1
               pbDisplayPaused(_INTL("Message2!"))
             else
                pbDisplayPaused(_INTL("Message3!"))
             end
     
    Back
    Top