09-16-2014, 03:23 AM
Revision.......
* 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?
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?