• 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] Calling and Comparing Pokemon Attributes

  • 4
    Posts
    4
    Years
    • Seen Jun 30, 2019
    Hey Pokeforums, I've recently started working on my first fan game and I'm a little lost.
    I'm completely new to scripting and been just learning as I go but I've come up against a roadblock which I haven't found the answer to anywhere by just searching around.

    What I want to do is have PokeRaces in a town that players can enter and gamble on.

    What I'm not sure how to do is to call and compare specific stats of Pokemon.

    Like I want to call and compare the Speed and HP stats of a Party member the player selects vs a NPCmon I generate for it to face. Again I am very new to scripting wondering if it's something simple I'm missing.
     
  • 1,682
    Posts
    8
    Years
    • Seen yesterday
    Well, I'm going to assume you already know how to get a pokemon object in a variable (or just check the wiki so helpful: https://essentialsdocs.fandom.com/wiki/Editing_a_Pokémon)
    The calculated speed stat is in pkmn.speed while the Hp is in pkmn.totalhp and pkmn.hp (if you wanted to do something involving reduced performance with less health or something, idk.)
    pkmn.attack and pkmn.spatk are the calculated Attack stats while pkmn.defense and pkmn.spdef are the calculated Defense stats. I know you didn't ask, but there you go nonetheless.

    You can also open up the script editor to see what variables you have available to you for certain classes. Most all the pokemon stuff is in PokeBattle_Pokemon and every one has a neat little description for it.
     
  • 4
    Posts
    4
    Years
    • Seen Jun 30, 2019
    Thank you for your time and this helped me understand the storage of the Pokemon a little more.
    I'm still stuck on how to express something like

    If: pkmn1.speed > pkmn2.speed
    Then: You win!

    Can you use the RPGMaker Conditional branches to handle the "pkmn" variables or would that expression have to be all in script?

    Basically not sure how to compare them against each other once I have them. Very new to this.
     
    Back
    Top