• 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!
  • Dawn, Gloria, Juliana, or Summer - 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.

[Scripting Question] Switch-Based Wild Double Battles

  • 13
    Posts
    5
    Years
    • Seen Jun 22, 2022
    I'm using 17.2.
    I want players to be able to choose whether the game will focus on single or double battles, so I tinkered with the script and found what I thought was a solution, but it's causing problems. I'll openly admit I'm not very experienced with scripting (of any kind), so bear with me.

    I named switch 66 DoubleBattle. In PField_Field, I changed line 381 to
    if !$PokemonTemp.forceSingleBattle && ($PokemonGlobal.partner || ($Trainer.ablePokemonCount>1 && $game_switches[66]=true) ||
    I thought that this would check to see if Switch 66 was on, and if so, make wild battles double. Instead, whenever I encounter a wild Pokemon, it turns Switch 66 on and runs a double battle. I don't want it to turn the switch on, I just want it to check if it is on.
    Thanks for your help.
     
    Code:
    ($Trainer.ablePokemonCount>1 && $game_switches[66]=true)

    It should be:
    Code:
    $game_switches[66][B]==[/B]true
    #notice I used 2 '=' instead of one.

    Single '=' is used to set the value of something
    Code:
    Eg: Name='Dragonite'

    Double '=' is used to compare 2 values
    Code:
    Eg: if (name=='dragonite')
     
    Thank you so much! I definitely should have caught that earlier, it's working perfectly now!
     
    Back
    Top