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.

Terrain and Changes!

Here's what i had in mind, im not sure if it can be done or has been done... but i searched and came up blank...

Changes and SFX with Terrain tags!
Terrain tag 0 = Nothing
-Sound, Nothing
-Character Graphic is 'Normal'
--if character has weapon or armor equip, graphic is 'normal_Sword'

Terrain Tag 1 = Water
-Play once, Slash Fx, Animation Splash
-Change Character Graphic to 'Swim'
--If Character has weapon or armor equip, graphic is 'swim_sword'

Terrain Tag 2 = Climb Wall
-Change Graphic to 'Climb'
--if Character has weapon or armor equip, graphic is 'climb_sword'

Terrain Tag 3 = Crawl Under
-Change Graphic to 'Crawl'
--if char. has wep or arm equip, graphic is "crawl...'

Terrain Tag 4 = Ice
-(not sure if its possible) Slip effect, character move two extra spaces speed slows down within that time...

Terrain Tag 5 = (Not sure about the fifth one...)


does anyone get what i mean... this would be very helpful to me and others as well...
Will Credit!!!:thumb:
 
I made terrain tags 0, 1, 2 and 3... at least it's something :)

Code:
class Game_Player
  
  Splash_Anim = 1


  def weapon_or_armor?
    actor = $game_party.actors[0]
    return (actor.weapon_id || actor.armor1_id || actor.armor2_id ||
      actor.armor3_id || actor.armor4_id)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Remember whether or not moving in local variables
    last_moving = moving?
    # If moving, event running, move route forcing, and message window
    # display are all not occurring
    unless moving? or $game_system.map_interpreter.running? or
           @move_route_forcing or $game_temp.message_window_showing
      # Move player in the direction the directional button is being pressed
      case Input.dir4
      when 2
        move_down
      when 4
        move_left
      when 6
        move_right
      when 8
        move_up
      end
    end
    
    if terrain_tag == 0 && weapon_or_armor?
      @character_name = 'normal_sword'
    end
    if terrain_tag == 1
      if @splash == nil or @splash == false
        @animation_id = Splash_Anim
        @splash = true
      end
      if weapon_or_armor?
        @character_name = 'swim_sword'
      end
    else
      @splash = false
    end
    if terrain_tag == 2 && weapon_or_armor?
      @character_name = 'climb_sword'
    end
    if terrain_tag == 3 && weapon_or_armor?
      @character_name = 'crawl_sword'
    end
    
    # Remember coordinates in local variables
    last_real_x = @real_x
    last_real_y = @real_y
    super
    # If character moves down and is positioned lower than the center
    # of the screen
    if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
      # Scroll map down
      $game_map.scroll_down(@real_y - last_real_y)
    end
    # If character moves left and is positioned more let on-screen than
    # center
    if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
      # Scroll map left
      $game_map.scroll_left(last_real_x - @real_x)
    end
    # If character moves right and is positioned more right on-screen than
    # center
    if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
      # Scroll map right
      $game_map.scroll_right(@real_x - last_real_x)
    end
    # If character moves up and is positioned higher than the center
    # of the screen
    if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
      # Scroll map up
      $game_map.scroll_up(last_real_y - @real_y)
    end
    # If not moving
    unless moving?
      # If player was moving last time
      if last_moving
        # Event determinant is via touch of same position event
        result = check_event_trigger_here([1,2])
        # If event which started does not exist
        if result == false
          # Disregard if debug mode is ON and ctrl key was pressed
          unless $DEBUG and Input.press?(Input::CTRL)
            # Encounter countdown
            if @encounter_count > 0
              @encounter_count -= 1
            end
          end
        end
      end
      # If C button was pressed
      if Input.trigger?(Input::C)
        # Same position and front event determinant
        check_event_trigger_here([0])
        check_event_trigger_there([0,1,2])
      end
    end
  end
end
 
Wow this helps out alot!!!
Now all i need is to get the rest down... finish some actual character sets for what i need and HA!
Thank you for this...
It will make My Zelda Game work like a charm!!!
I can actually get link in the water!!!
and climb... with out silly events everywhere!!!
 

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