• 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] About Flying Press

38
Posts
9
Years
  • Age 31
  • Seen Apr 20, 2024
Hi, I'm trying to use the move Flying Press in my game using the script that exists for it in essentials v17.2 found in PokeBattle_MoveEffects which is this:
Spoiler:
The problem is when I tested it I got these results:
Spoiler:

The issue here is the move only uses the fighting type. I searched a bit and found this thread so I tried to fix the problem by adding this script to PokeBattle_Move after Freeze Dry, using that thread:

Spoiler:
I'm not sure if that script is right but after testing I got these results:
Spoiler:

The move uses both types but it still doesn't work properly especially when it should be resisted, can someone help me fix this issue or give a script to this move? Because I was planning to edit this script to add more dual type moves to my game.
I'm new to scripting so I'm not that good at it but I can edit existing scripts most of the time.
Edit: here's the PBS line
624,FLYINGPRESS,Flying Press,144,100,FIGHTING,Physical,95,10,0,00,0,abf,"The user dives down onto the target from the sky. This move is Fighting- and Flying-type simultaneously."
 
Last edited:
38
Posts
9
Years
  • Age 31
  • Seen Apr 20, 2024
Sorry for bumping but this thread got approved a week after I made it and it didn't show up on top so many people didn't see it, hopefully someone can help.
 
1,403
Posts
10
Years
  • Seen Apr 18, 2024
I don't understand the purpose of this part of the code:
Code:
        if opponent.effects[PBEffects::Type3]>=0 &&
           opponent.effects[PBEffects::Type3]!=opponent.type1 &&
           opponent.effects[PBEffects::Type3]!=opponent.type2
          mult*=PBTypes.getEffectiveness(type2,opponent.effects[PBEffects::Type3])
        else
          mult*=2
        end
That looks like it will double the damage for no reason, which might explain the results you're getting? I haven't given it much thought, but my gut says you don't need those lines of code at all because you're already handling Type3 on the line above.
 
38
Posts
9
Years
  • Age 31
  • Seen Apr 20, 2024
I don't understand the purpose of this part of the code:
Code:
        if opponent.effects[PBEffects::Type3]>=0 &&
           opponent.effects[PBEffects::Type3]!=opponent.type1 &&
           opponent.effects[PBEffects::Type3]!=opponent.type2
          mult*=PBTypes.getEffectiveness(type2,opponent.effects[PBEffects::Type3])
        else
          mult*=2
        end
That looks like it will double the damage for no reason, which might explain the results you're getting? I haven't given it much thought, but my gut says you don't need those lines of code at all because you're already handling Type3 on the line above.

Thanks a lot it worked, as I said I don't know much about scripting yet I tired to copy and paste stuff while editing them a bit that's why I probably used those useless lines in this case, now it works perfectly thanks again.
 
1,403
Posts
10
Years
  • Seen Apr 18, 2024
Thanks a lot it worked, as I said I don't know much about scripting yet I tired to copy and paste stuff while editing them a bit that's why I probably used those useless lines in this case, now it works perfectly thanks again.

Glad to hear it works. The way I go about reading code is to try and turn each line/section into words, and then see if those words are how I would describe what I'm trying to do. (Or if you're writing new code you can work backwards—start with words and try to translate them into code).

That's why when I got to "else mult*=2 end" and translated it into "otherwise double the effectiveness" I had a suspicion that this wasn't correct.
 
Last edited:
Back
Top