• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • 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] Adding a chance for (X) to happen in Pokemon Essentials v19.1

ChaosandCalamity

The Harbinger
  • 29
    Posts
    4
    Years
    Over the past couple of days I've been playing with the script in essentials, nothing too much though mainly moves really, and I was wondering how to add a chance for something to happen. e.i Pokemon Ability-(Weather Report) has a Chance for a random weather effect to happen. Sunny Day, Rain, Storm, Air lock, harsh sunlight, and Hail for an example are weather types to be summoned randomly by Weather Report.

    Also just asking is there ways to add your own weathers without destroying pokemon essentials?



    As mentioned above I am working with ~Pokemon Essentials v19.1~
     
    Add this code above main
    Code:
    BattleHandlers::AbilityOnSwitchIn.add(:WEATHERREPORT,
      proc { |ability,battler,battle|
        options = [:Sandstorm, :Hail] # Put your effects here
        pbBattleWeatherAbility(options[rand(options.size)], battler, battle)
      }
    )

    To add a custom weather effect, I suggest you to find a similar effect with Ctrl+Shift+F (like StrongWinds, a simple one) and copy. This requires some script knowledge however.
     
    Back
    Top