• 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] New Entry Hazard

  • 35
    Posts
    3
    Years
    • Seen Jun 1, 2022
    Can anybody help me make a new entry hazard for my game. I looked at the scripts and their looks like it would require a lot of changes. I was thinking about making it like stealth rocks but grass, called thorns.
     

    StCooler

    Mayst thou thy peace discover.
  • 9,304
    Posts
    4
    Years
    • Seen yesterday
    Can anybody help me make a new entry hazard for my game. I looked at the scripts and their looks like it would require a lot of changes. I was thinking about making it like stealth rocks but grass, called thorns.

    How much help do you need?
    You had it right. Adding a clone of Stealth Rock is pretty easy, you just have to copy the code for Stealth Rock (and make a new move to set your Thorns).

    I won't go into detail here, just ask if what I'm saying isn't enough for you. Also, I assume you are using v18.1 at least, or the Gen 8 project (it's better). It should also work for v17.2, but I cannot guarantee it.

    1. Go to the script PBEffects, and after the effects that "apply to a side" (with StickyWeb and ToxicSpikes), define the new constant:
      Code:
      Thorns = 23
      (It's 23 for me, but in the general case, it should be N+1, where N is the last number on the list).
    2. In the script PokeBattle_ActiveField, in the class PokeBattle_ActiveSide, in the function
      Code:
          def initialize
      at the end, write:
      Code:
            @effects[PBEffects::Thorns]      = false
    3. Then we define the move that will set the Thorns. Just copy the whole class PokeBattle_Move_105, paste it in a new script, and change the name to PokeBattle_Move_XXX with a new XXX that doesn't conflict with another move. Then change any occurrence of StealthRock with Thorns (change the text too).
    4. Now we have to adapt Defog. In the file Move_Effects_000-07F, in the class PokeBattle_Move_049 (the comment above should say that it's Defog), in the function:
      Code:
        def pbFailsAgainstTarget?(user,target)
      make it so that the function returns false if targetSide or targetOpposingSide has Thorns.

      And in the function:
      Code:
        def pbEffectAgainstTarget(user,target)
      copy the parts with StealthRock, and replace them with Thorns (and change the message).
    5. The next step is Rapid Spin. In the file Move_Effects_100-17F, in the class PokeBattle_Move_110 (the comment above should say that it's Rapid Spin), in the function:
      Code:
        def pbEffectAfterAllHits(user,target)
      copy the part with StealthRock and replace them with Thorns (and change the message).
    6. Final move, Court Change. In the file Move_Effects_100-17F, in the class PokeBattle_Move_17A (the comment above should say that it's Court Change), in the function:
      Code:
        def pbEffectGeneral(user)
      There are two changes to make; first, in the first "for" loop, duplicate the line that mentions StealthRock, and replace with Thorns.
      Then, the part that changes StealthRock sides, copy it and replace with Thorns.
    7. The final part, the damage. Go to the file Battle_Action_Switching, and in the function:
      Code:
        def pbOnActiveOne(battler)
      find the part that makes Stealth Rock work, copy it and replace StealthRock with Thorns, and replace the :ROCK type with :GRASS (and change the message).
    8. Bonus: if you have ZUD installed, you also have to change PokeBattle_Move_D012 (copy the part with StealthRock (and change the message)). Also, PokeBattle_Move_D010 mentions Stealth Rock, but this time, you don't have to worry about that.

    Spoiler:
     
    Last edited:
    Back
    Top