The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Animation Color Change

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old February 24th, 2021 (11:49 PM). Edited February 25th, 2021 by Bdemp99.
Bdemp99's Avatar
Bdemp99 Bdemp99 is offline
 
Join Date: Feb 2021
Posts: 1
First post on the forums 😃

I'll do my best to explain exactly what I'm aiming to accomplish ~

I have multiple tilesets which are copies, but in different hues/colors. I would like to make the rustling grass animation for each colored tileset have its own respected color. In my current case, purple grass and purple rustling grass animation.

I have read a few threads on how to edit PField and PBTerrain scripts to register a new terrain tag and implement an elsif statement for my exception of the purple grass from normal. I cannot get the grass animation to change color - it stays green (default). A member said to remove the animationID placeholder and to input my actual animation ID for the purple grass animation, would that be 8?

Edit- I am using Essentials v18.1

I'll post some code, please point out if anything is obviously wrong ~

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
  Puddle          = 16
  PurpleGrass     = 17
Code:
def self.isGrass?(tag)
    return tag==PBTerrain::Grass ||
           tag==PBTerrain::TallGrass ||
           tag==PBTerrain::UnderwaterGrass ||
           tag==PBTerrain::SootGrass ||
           tag==PBTerrain::PurpleGrass
  end

  def self.isJustGrass?(tag)   # The Poké Radar only works in these tiles
    return tag==PBTerrain::Grass || 
           tag==PBTerrain::PurpleGrass ||
           tag==PBTerrain::SootGrass
PField_Field
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 pbGetTerrainTag(event,true)==PBTerrain::PurpleGrass
$scene.spriteset.addUserAnimation(PURPLE_GRASS_ANIMATION_ID,event.x,event.y,true,8)
    elsif event==$game_player
      if currentTag==PBTerrain::WaterfallCrest
        # Descend waterfall, but only if this event is the player
        pbDescendWaterfall(event)
      elsif PBTerrain.isIce?(currentTag) && !$PokemonGlobal.sliding
        pbSlideOnIce(event)
      end
    end
  end
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 9:19 AM.