• 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] Getting move data from a TM

Franzo

Developing something...
95
Posts
16
Years
  • Age 28
  • ???
  • Seen Nov 6, 2023
So as far as I know with Essentials you can get the move name of a TM like this.
Code:
machine=$ItemData[PBItems::TM01][9]
movename=PBMoves.getName(machine)
How would I go about getting other move data (type, category, power) for a TM?
 

Telemetius

Tele*
267
Posts
9
Years
Digging a bit in the code I found this, maybe it can help you:
Code:
def initialize(battle,move)
    @id = move.id
    @battle = battle
    @name = PBMoves.getName(id)   # Get the move's name
    # Get data on the move
    [COLOR="Blue"]movedata = PBMoveData.new(id)[/COLOR]
    [COLOR="Red"]@function   = movedata.function
    @basedamage = movedata.basedamage
    @type       = movedata.type
    @accuracy   = movedata.accuracy
    @addlEffect = movedata.addlEffect
    @target     = movedata.target
    @priority   = movedata.priority
    @flags      = movedata.flags
    @category   = movedata.category
    @thismove   = move
    @pp         = move.pp[/COLOR]   # Can be changed with Mimic/Transform
    @powerboost = false   # For Aerilate, Pixilate, Refrigerate
  end
 

Franzo

Developing something...
95
Posts
16
Years
  • Age 28
  • ???
  • Seen Nov 6, 2023
Yeah, I saw that code but I'm not sure how I'd get the moves ID number.
 

Telemetius

Tele*
267
Posts
9
Years
If using:

Code:
machine=$ItemData[PBItems::TM01][9]
movename=PBMoves.getName(machine)

you get the TM's name, you can also try for example:

Code:
machine=$ItemData[PBItems::TM01][9]
movedata = PBMoveData.new(machine)
type       = movedata.type

If you add
Code:
p type
it prints 17 which I assume is the type of the move Hone Claws "Dark".

If you open your pbs file "tm" you can see how hone claws is the first TM.
 
Last edited:
Back
Top