• 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] How to make a move that copies the user's typing?

Scraps The Man

Crystal Collector
33
Posts
3
Years
    • Seen Nov 26, 2023
    Hey I am wondering if there is an easy way to code a move that uses the typing of the user (as the user has different forms for all types).

    If you know anything and can help, that would be great!
     
    143
    Posts
    4
    Years
    • Seen Mar 26, 2024
    This piece of code changes the type of a move to the user's first type. Simply insert it into the class of your move. :)
    Code:
    def pbBaseType(user)
      ret = user.pbTypes[0]
      return ret
    end
     

    Scraps The Man

    Crystal Collector
    33
    Posts
    3
    Years
    • Seen Nov 26, 2023
    This piece of code changes the type of a move to the user's first type. Simply insert it into the class of your move. :)
    Code:
    def pbBaseType(user)
      ret = user.pbTypes[0]
      return ret
    end

    Thanks for the heads up. Sadly I am a bit too stupid and new to this to know where exactly to put the code and not break anything. If you have any idea on what to do there that would be appreciated. If you need ANY context I can totally provide it (like the move name I plan to use or the monster that may use it), other than that thanks again!
     
    143
    Posts
    4
    Years
    • Seen Mar 26, 2024
    Hey again, don't worry I'm happy to help. :)
    When you create a move in your PBS File "moves.txt" there is a lot to be defined. What every value exactly does is explained here(https://essentialsdocs.fandom.com/wiki/Defining_a_move).
    Code:
    757,SPECIATION,Speciation,[COLOR="Red"]195[/COLOR],0,NORMAL,Status,0,40,0,10,0,de,"The user changes its ability to a random ability."
    Right now the"195" is important for what you want to achieve. It's called the move's "function code" and it directly corresponds to the same number in the "Move_Effects_..." script sections. Note that this value is hexadecimal, meaning the numbers used arent [0,1,2,3,4,5,6,7,8,9] but instead [0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F]. In this script section each part of the code looks something like this:
    Spoiler:

    Also here a two version of your move(Don't forget to change the function codes to one's that fit your move):
    Spoiler:
     
    Last edited:

    Scraps The Man

    Crystal Collector
    33
    Posts
    3
    Years
    • Seen Nov 26, 2023
    Thanks so much! I seriously would have had so many troubles if you didn't swoop in and save me from hours of tedious move creations! <3
     
    Back
    Top