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

Trainer with different teams of pokemon

13
Posts
5
Years
    • Seen Jul 23, 2020
    Hello
    i would like to give Brock 3 different teams so every time you battle him its maybe an other team.
    I used this script from an other thread
    class Brockrndteam

    def initialize

    random=rand(3)

    if random == 0
    pbTrainerBattle(PBTrainers::LEADER_Brock,"Brock",_I("...."),false,0,false,0)
    elsif random == 1
    pbTrainerBattle(PBTrainers::LEADER_Brock,"Brock",_I("...."),false,1,false,0)
    elsif random == 2
    pbTrainerBattle(PBTrainers::LEADER_Brock,"Brock",_I("...."),false,2,false,0)
    end
    end
    end

    Random teams working great so far, but after the battle the event beginns from the beginning.
    But actually should it give the first badge.
    So what did i wrong?
     

    SpartaLazor

    Doofus Lunarius
    184
    Posts
    8
    Years
  • I think the error might be within the event, not the code. Make sure it's not set to Autorun, or if it is make sure there's a switch/self-switch that turns it off.

    I could probably help a bit better if you posted some pictures of the event.
     
    13
    Posts
    5
    Years
    • Seen Jul 23, 2020
    Here is a Screenshot from the event
     

    Attachments

    • Brocksevent.png
      Brocksevent.png
      33.4 KB · Views: 20

    SpartaLazor

    Doofus Lunarius
    184
    Posts
    8
    Years
  • Honestly, I don't see anything that would cause an issue with that event off the top of my head. Though Conditional branches typically have an "else" field as a part of them. Sometimes they disappear. You can just insert a new one and move over all of the information into that one to fix that. I don't think it should have anything to do with the code, but you can try it with a normal battle code to see if that changes anything.

    The issue might lie within the second event page, if we can get a picture of that.
     
    13
    Posts
    5
    Years
    • Seen Jul 23, 2020
    I tested it with one code from the random pool and it works perfect.
    Here is a screenshoot from the second page.
    I will test the conditional branch with else again and post the result.

    Edit: found the problem the event musst set after the branch end.
    Thanks for the help anyway!
     

    Attachments

    • Eventpage2.png
      Eventpage2.png
      20.7 KB · Views: 17
    Last edited:
    Back
    Top