Lycan ABS + GPlats?
#4
Revision.......

Code:
#==============================================================================
# ** The Lycan ABS / GPLAT Pixel Platformer Patch
#------------------------------------------------------------------------------
#    version 1.1
#    by DerVVulfman
#    09-15-2014
#    RGSS / RPGMaker XP
#==============================================================================
#
#  INTRODUCTION:
#
#  This little script ammends the GPLAT Pixel Platformer system to work with
#  the Lycan ABS, so both jumping and dash/sneak systems can co-exist.
#
#
#------------------------------------------------------------------------------
#
#  INSTALLATION:
#
#  It is recommended to be placed above Main and below both the Lycan ABS and
#  the GPLAT Pixel Platformer Script. The Pixel Platformer script needs to be
#  set below the ABS script itself.
#
#  After that, just activate/deactivate the JUMP_HEIGHT_FAIL value within the
#  Lycan_GPlat module to determine  if you wish the player to be able to jump
#  over events with the 'Tall' flag as mentioned in the Lycan ABS code.
#
#  Optional values are available for altering.
#
#
#==============================================================================
#
#  CREDITS AND THANKS:
#
#  Thanks to swickster who suggested the idea.
#
#
#==============================================================================
#
#  COMPATABILITY:
#
#  Only designed for use with The Lycan ABS by DerVVulfman and the GPLAT Pixel
#  Platformer by G@MeF@Ce.  Both of these being solely RPGMaker XP scripts.
#
#
#==============================================================================
#
#  TERMS AND CONDITIONS:
#
#  Free for use, even within commercial products.  Only due credit is required.
#
#
#==============================================================================



module Lycan_GPlat
  
  JUMP_HEIGHT_FAIL      = true    # Whether jump checks for 'Tall' comments
  
  JUMP_LEFTRIGHT_CHECK  = 1       # How far away in tiles to check events
  
  JUMP_UPDOWN_CHECK     = 2       # How far below to test events
    
end



#==============================================================================
# ** Game_ABS
#------------------------------------------------------------------------------
#  This class deals with the Action Battle System and controls all Player,
#  Enemy and Companion Actions on the map.
#==============================================================================

class Game_ABS
  #--------------------------------------------------------------------------
  # * Update Jump
  #--------------------------------------------------------------------------
  def update_jump
  end
end


#==============================================================================
# Game_Player
#==============================================================================
class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias lycan_gplat_game_player_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If currently pressing a working jump key
    if Input.press?(JUMP_BUTTON) and not $game_switches[GPLAT_DISABLE_SWITCH]
      # If Jump height failure is being checked
      if Lycan_GPlat::JUMP_HEIGHT_FAIL
        # Return if a jump height check has failed
        return if jump_height_impassible? == true
      end
    end
    # Perform the original call
    lycan_gplat_game_player_update
  end
  #--------------------------------------------------------------------------
  # * Movement decision
  #    pixelcheck : if performing pixelmovement check
  #--------------------------------------------------------------------------
  def moving?(pixelcheck=false)
    unless @dot_m
      result = super()
      return result
    end
    # If move route is forced
    if @move_route_forcing
      return false if @move == false
      super()
    # Usually the time when present coordinate differs from real coordinates
    else
      return (@old_real_x != @real_x or @old_real_y != @real_y) if pixelcheck
      return (@x != (@real_x / 128.0).round or @y != (@real_y / 128.0).round)
    end
  end
  #--------------------------------------------------------------------------
  # * Jump Height Checking System
  #--------------------------------------------------------------------------
  def jump_height_impassible?
    diff_x  = Lycan_GPlat::JUMP_LEFTRIGHT_CHECK
    diff_y  = Lycan_GPlat::JUMP_UPDOWN_CHECK
    case @direction
      when 9,6,3;
      for x in 0..diff_x.to_i
        for y in 0..diff_y.to_i
          return true if too_tall?(@x+x, @y+y)
        end
      end
    when 7,4,1;
      for x in 0..diff_x.to_i
        for y in 0..diff_y.to_i
          return true if too_tall?(@x-x, @y+y)
        end
      end
    end
    return false
  end
end
  • It has its own config module now.
  • Rather than change the 'JUMP_KEY' in lycan, I removed the jumping method itself. No confusion that way
  • I added an attachment to the platformer's update method to see if the player is encountering a too-tall event.
  • The too-tall event system can be turned on/off and calibrated*

* The Too-Tall-To-Jump system may not be the best, but it can prevent SOME jumping over tall events if calibrated correctly. BUT it isn't the best. Technically, the added code to Game_Player's update method in the platformer script could have been made more modular to allow better coding.

Still.... How's this for getting em to work? Laughing
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }


Messages In This Thread
Lycan ABS + GPlats? - by swickster - 09-08-2014, 02:54 PM
RE: Lycan ABS + GPlats? - by DerVVulfman - 09-09-2014, 03:52 AM
RE: Lycan ABS + GPlats? - by DerVVulfman - 09-15-2014, 05:59 AM
RE: Lycan ABS + GPlats? - by DerVVulfman - 09-16-2014, 03:23 AM
RE: Lycan ABS + GPlats? - by swickster - 09-16-2014, 04:40 AM
RE: Lycan ABS + GPlats? - by DerVVulfman - 09-16-2014, 04:44 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Lycan abs - Making enemies flee on sight ChickenFetus 1 4,417 06-07-2016, 04:39 AM
Last Post: DerVVulfman
Question  Lycan ABS - Weapon display Jetboy 4 7,170 07-14-2015, 06:02 AM
Last Post: DerVVulfman
   Ahzoh's Lycan ABS On/Off queries Ahzoh 9 13,345 12-22-2014, 04:10 AM
Last Post: DerVVulfman



Users browsing this thread: 2 Guest(s)