Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Chanign the bush flag

Is there a way to increase the depth of the bush flag? Prferably with options to chang it in game. See, atm, it only covers the bottom eigth of a leg, which is fine for swamps and small plants, but terrible for sewers and OW forests. If not, i suppose i could create sepraete graphics.
 
In Sprite_Character, you can find this line:
Code:
self.bush_depth = @character.bush_depth
It's the line that defines the transparency for the sprite. The definition for the bush_depth method can be found in Game_Character...
Code:
  def bush_depth
    if @tile_id > 0 or @always_on_top
      return 0
    end
    if @jump_count == 0 and $game_map.bush?(@x, @y)
      return 12 # This line to be changed
    else
      return 0
    end
  end
Just change the 12 in the marked line to whatever you think is right, and you should be fine. It's untested, though...
 
For changing it with the terrain tags/types.
Change the number on the returns in the "case terrain_tag" function for changing the count of pixels of the bush depth.
Code:
class Game_Character
  def bush_depth
    if @tile_id > 0 or @always_on_top
      return 0
    end
    if @jump_count == 0 and $game_map.bush?(@x, @y)
      case terrain_tag
      when 0
        return 12
      when 1
        return 18
      when 2
        return 24
      when 3
        return 32
      when 4
        return 40
      when 5
        return 48
      when 6
        return 56
      when 7
        return 64
      else
        return 12
      end
    else
      return 0
    end
  end
end

For changing it via the variable $bush_depth: (You can change the $bush_depth variable with a call of script in an event)
Code:
class Game_Character
  def bush_depth
    if @tile_id > 0 or @always_on_top
      return 0
    end
    if @jump_count == 0 and $game_map.bush?(@x, @y)
      if $bush_depth.is_a?(Integer)
        return $bush_depth
      else
        return 12
      end
    end
  end
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top