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

Implementing Inverse Battles?

14
Posts
11
Years
    • Seen May 19, 2015
    Has anyone determined how to do Inverse Battles? I figure you would just turn on a switch, then check for that switch in a script, but I do not know what all to affect in scripts.
     
    32
    Posts
    13
    Years
    • Seen Jan 13, 2016
    Have you searched for tutorials in the pokemon eesntials wiki?
     

    Nickalooose

    --------------------
    1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    Inverse battles seem a waste of time, even the makers of XY couldn't be bothered to make a full range of battles about it...

    Search: effectiveness=0

    It will only return 1 result, so don't come back with "I don't know what you mean!", "I couldn't find it!", "There's no such thing... But I did find wally!"... Change the section directly below it:
    Code:
          if opponent.damagestate.typemod<4
            effectiveness=1   # "Not very effective"
          elsif opponent.damagestate.typemod>4
            effectiveness=2   # "Super effective"
          end
    To this:
    Code:
          if opponent.damagestate.typemod<4
            if $game_switches[[COLOR="Red"]x[/COLOR]]
              effectiveness=2
            else
              effectiveness=1   # "Not very effective"
            end
          elsif opponent.damagestate.typemod>4
            if $game_switches[[COLOR="red"]x[/COLOR]]
              effectiveness=1
            else
              effectiveness=2   # "Super effective"
            end
          end
    Change the "x" to a switch number of your choice.
    I'm pretty sure that's all you need to do and I'm sure you can work out the rest.
     
    14
    Posts
    11
    Years
    • Seen May 19, 2015
    Hm. That only seems to work partially. It makes the opposite "sound" when damage is done, but that is it. It does the same damage based on effectiveness.
     

    Nickalooose

    --------------------
    1,309
    Posts
    16
    Years
    • Seen Dec 28, 2023
    It's not meant to do what you said, there's more to it than what I put... You can work it out through those lines though...

    typemod
    effectiveness


    ...are what you need to focus on, however, a simple search on typemod results in a fair few results and I was not going to go through every one of them to insert switch x... I'm sure you can look at it now and work it out for yourself.
     
    14
    Posts
    11
    Years
    • Seen May 19, 2015
    Yeah, I found typemod when I was searching around, but I couldn't get them to all work together. I guess I'll have to tinker some more.

    Thanks!

    EDIT:

    I found out a much simpler fix:

    Code:
        if $game_switches[[COLOR="Red"]x[/COLOR]]
          inmod1=mod1
          inmod2=mod2
          mod1=3 if inmod1<2
          mod1=1 if inmod1>2
          mod2=3 if inmod2<2
          mod2=1 if inmod2>2
        end

    Placing that after lines 202 203 in PokeBattle_Move:
    Code:
        mod1=PBTypes.getEffectiveness(atype,otype1)
        mod2=(otype1==otype2) ? 2 : PBTypes.getEffectiveness(atype,otype2)

    Switches everything nicely.
     
    Last edited:
    Back
    Top