Changing Color of Rustling Grass

updawg734

Whats up, dawg?
Member
#1
I have tried a few different things and can't seem to figure out how to change the color of rustling grass for the orange/red grass I am using. So far I have defined RedGrass as the 17th terrain tag, and appropriately identified the right grass tiles as terrain tag 17.

I have added the animation I want through the animation editor and added it as the 8th animation, then added it to the Settings of the script section under the section for field animations.

The red grass works as regular grass (wild encounters happen, etc.), but for some reason the animation is still green grass rustles.

I'm assuming my issue is somewhere in the PField_Field section...here is what the script section looks like:
Code:
# Show grass rustle animation, and auto-move the player over waterfalls and ice
Events.onStepTakenFieldMovement+=proc {|sender,e|
  event = e[0] # Get the event affected by field movement
  if $scene.is_a?(Scene_Map)
    currentTag = pbGetTerrainTag(event)
    if PBTerrain.isJustGrass?(pbGetTerrainTag(event,true))  # Won't show if under bridge
      $scene.spriteset.addUserAnimation(GRASS_ANIMATION_ID,event.x,event.y,true,1)
    elsif PBTerrain.isRedGrass?(pbGetTerrainTag(event,true)) # Plays red grass rustle
      $scene.spriteset.addUserAnimation(RED_ANIMATION_ID,event.x,event.y,true,1)
    elsif event==$game_player
      if currentTag==PBTerrain::WaterfallCrest
        # Descend waterfall, but only if this event is the player
        Kernel.pbDescendWaterfall(event)
      elsif PBTerrain.isIce?(currentTag) && !$PokemonGlobal.sliding
        Kernel.pbSlideOnIce(event)
      end
    end
  end
}
Wondering if anyone sees a glaring error with what I've done...appreciate any help!
 

Maruno

Pokémon Essentials dev
Essentials Developer
Posts
244
#2
You're asking whether the tile is "red grass" after asking whether it's "just grass" (which I presume includes red grass). Since red grass counts as "just grass", it's showing the regular grass rustle animation.
 

updawg734

Whats up, dawg?
Member
#3
You're asking whether the tile is "red grass" after asking whether it's "just grass" (which I presume includes red grass). Since red grass counts as "just grass", it's showing the regular grass rustle animation.
Yes, I included RedGrass as a type of "Grass" and "JustGrass" under PBTerrain.
I tried flipping them around, so that the code now reads...
Code:
# Show grass rustle animation, and auto-move the player over waterfalls and ice
Events.onStepTakenFieldMovement+=proc {|sender,e|
  event = e[0] # Get the event affected by field movement
  if $scene.is_a?(Scene_Map)
    currentTag = pbGetTerrainTag(event)
    if PBTerrain.isRedGrass?(pbGetTerrainTag(event,true)) # Plays red grass rustle
      $scene.spriteset.addUserAnimation(RED_ANIMATION_ID,event.x,event.y,true,1)
    elsif PBTerrain.isJustGrass?(pbGetTerrainTag(event,true))  # Won't show if under bridge
      $scene.spriteset.addUserAnimation(GRASS_ANIMATION_ID,event.x,event.y,true,1)
    elsif event==$game_player
      if currentTag==PBTerrain::WaterfallCrest
        # Descend waterfall, but only if this event is the player
        Kernel.pbDescendWaterfall(event)
      elsif PBTerrain.isIce?(currentTag) && !$PokemonGlobal.sliding
        Kernel.pbSlideOnIce(event)
      end
    end
  end
}
...but I am still getting the green grass rustle for some reason.
 
Top