• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • 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