• 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.
  • 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!
  • Cyndy, May, Hero (Conquest), or Wes - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Activated switch only while battling

  • 47
    Posts
    11
    Years
    • Seen Apr 20, 2014
    Hi, I wonder if someone knows how to activate a switch when a battle starts and desactivate it when it finish. When I say battle i mean any kind of battle (wild or trainer).
    Actually, I just want to know in which part of the scripts I should activate and desactivate the switch so every time the battle starts it switches on and when the battle finishes, it switches off.

    Thanks all.
     
    The core method of PokeBattle_Battle is a good place to put a switch. Search for: "def pbStartBattleCore(canlose)". Turn the switch at the beginning of the method and turn it off before "return pbEndOfBattle(canlose)" (unless you want it to turn off after the victory scene which in that case, you will have to turn it off in pbEndOfBattle(canlose) ). Hope that helps.
     
    Back
    Top