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

[Scripting Question] Switch-Based Wild Double Battles

14
Posts
4
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.
     
    658
    Posts
    7
    Years
  • 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')
     
    14
    Posts
    4
    Years
    • Seen Jun 22, 2022
    Thank you so much! I definitely should have caught that earlier, it's working perfectly now!
     
    Back
    Top