• 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!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our 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.

Creating a New Terrain Tag for different-coloured tall grass

  • 55
    Posts
    11
    Years
    • Seen Jul 8, 2023
    I have a blue colored grass and I want to change the grass rustle animation to a blue color. I have the animation done already but I can't figure out how to implement it. All I want to do is make a terrain tag that is exactly the same as the grass terrain tag except with my new animation. How would I go about doing this?

    Forgot to mention, I am using Essentials 15.1.
     
    Last edited:
    Okay, so basically we'll just have to copy how grass works. So let's see.
    Where it's first defined is in PBTerrain, you'll see the module PBTerrain
    Code:
    module PBTerrain
      Ledge           = 1
      Grass           = 2
      Sand            = 3
      Rock            = 4
      DeepWater       = 5
      StillWater      = 6
      Water           = 7
      Waterfall       = 8
      WaterfallCrest  = 9
      TallGrass       = 10
      UnderwaterGrass = 11
      Ice             = 12
      Neutral         = 13
      SootGrass       = 14
      Bridge          = 15
      [COLOR="Red"]BlueGrass     = 16[/COLOR]
    end
    Add the red code above, this is how we'll define out new terrain type.
    Below that you'll see two more methods involving grass, add the red parts
    Code:
    def pbIsGrassTag?(tag)
      return tag==PBTerrain::Grass ||
             tag==PBTerrain::TallGrass ||
             tag==PBTerrain::UnderwaterGrass [COLOR="red"]||
             tag==PBTerrain::BlueGrass[/COLOR]
    end
    
    def pbIsJustGrassTag?(tag)
      return tag==PBTerrain::Grass[COLOR="red"] || tag==PBTerrain::BlueGrass[/COLOR]
    end
    These methods are used elsewhere, but you want your bluegrass to function as grass in almost all aspects.

    Now we're going to look in PField_Field. Find this proc (around line 1412 unedited) and add the red part
    Code:
    Events.onStepTakenFieldMovement+=proc{|sender,e|
      event=e[0] # Get the event affected by field movement
      currentTag=pbGetTerrainTag(event)
      if pbGetTerrainTag(event,true)==PBTerrain::Grass  # Won't show if under bridge
        $scene.spriteset.addUserAnimation(GRASS_ANIMATION_ID,event.x,event.y,true)
      [COLOR="red"]elsif pbGetTerrain(event,true)==PBTerrain::BlueGrass 
    $scene.spriteset.addUserAnimation(BLUE_GRASS_ANIMATION_ID,event.x,event.y,true)[/COLOR]
      elsif event==$game_player && currentTag==PBTerrain::WaterfallCrest
        # Descend waterfall, but only if this event is the player
        Kernel.pbDescendWaterfall(event)
      elsif event==$game_player && currentTag==PBTerrain::Ice && !$PokemonGlobal.sliding
        Kernel.pbSlideOnIce(event)
      end
    }

    Not that
    Code:
    BLUE_GRASS_ANIMATION_ID
    above is not defined, because I don't know what id your animation has, you'll have to look at that and replace it here.
    I'm like 90% sure this is all you have to do.
    Obviously make sure to edit the terrain tag for your tileset in the editor, otherwise you won't be able to.
     
    The encounters work fine but the animation doesn't play and the grass has a reflection like water.
     
    The puddle, that's it. Didn't think it would effect a new terrain tag. Why does it have the reflection though?
     
    Back
    Top