First of all, great script. Thank you for maintaining it.
I'm having an issue where after the actors join my party they don't follow me, they just remain stationary after teleporting to the player's position. I have a feeling there is an incompatibility with ArcThunder's Pixel Movement script, but I can't find where.
Can you help me out?
Here is the pixel movement script:
#-------------------------------------------------------------------------------
# * Arcthunder Pixel Movement
#-------------------------------------------------------------------------------
# * By Khas Arcthunder (nilokruch@live.com)
# * Version: 1.0 US
# * Released on: 21/07/2011
#
#-------------------------------------------------------------------------------
# * Author's note
#-------------------------------------------------------------------------------
# Thank you for choosing Arcthunder scripts. If you find any bug, please let
# me know by reporting it at the official threads (threads created by me - Khas)
#
# You can find more scripts and updates (in portuguese or english) at:
# http://arcthunder.host.org/
#
# If you like my scripts and want to donate a little, anything you can give
# would be appreciated. Please visit http://arcthunder.host.org/ to donate.
#
#-------------------------------------------------------------------------------
# * Terms of use
#-------------------------------------------------------------------------------
# You must give credit to Khas if you are using any Arcthunder script;
# All Arcthunder Scripts are licensed under a Creative Commons license;
# All Arcthunder Scripts are for non-commercial projects, if you need
# them for a commercial game, please send a email to nilokruch@live.com
# All Arcthunder Scripts are for personal use, you may edit them and use in your
# own project, but you can't post any modified version without my permission.
#
#-------------------------------------------------------------------------------
# * Instructions
#-------------------------------------------------------------------------------
# 1. How to use
# Just place this script after materials. This script will change the movement
# of the player, the events and the vehicles of your game.
#
# 2. Physics system
# In order to make this script working correctly, there's a system called
# Khas Physics. This system will load all Pixel Movement maps at the start
# of the game and it will save the settings into a file called
# "Khas Physics.rgss2a". You must refresh the file if you make any modifications
# at the maps of your game.
#
# There's two ways of refreshing Physics:
# a. Delete the "Khas Physics.rgss2a"
# b. Set Force_Physics_Update = true
#
# When you finish your game and it's ready to send to other people, remember to
# delete "Khas Physics.rgss2a" before encrypting! The Physics System will
# automatically create a new file when the player plays at the first time.
#
# 3. Event Commands (put on comments of events on map)
# You may put special commands for some events. There are two special commands:
#
# a. [collision X]
# This command sets the collision constant of the event to X.
#
# b. [forcedefaultcmd]
# This command forces the event to move as the default RMVX movement.
#
# 4. Event Commands (script codes)
# You may call some new commands for the player or map events:
#
# character.centralize(x,y)
# This command centralizes the character at x,y.
#
# character.px
# This command returns the Pixel X coordinate.
#
# character.py
# This command returns the Pixel Y coordinate.
#
# character.pixel_passable?(px,py)
# This command checks the passability at px,py coordinates.
#
#-------------------------------------------------------------------------------
# * Incompatibilities
#-------------------------------------------------------------------------------
# The Arcthunder Pixel Movement is incompatible with:
# 1. RMVX Loop maps
# 2. Heavy modifications in Game_Character, Game_Player and Game_Event
# 3. Anti-lag scripts
# 4. Action Battle Systems (A compatible ABS is coming soon! Arcthunder ABS!)
#
#-------------------------------------------------------------------------------
# * Setup part
#-------------------------------------------------------------------------------
module Pixel_Core
# Pixel Movement maps (ID)
# Example:
# Maps = [1,3,4,5,6,7]
Maps = [1,2,3]
#-------------------------------------------------------------------------------
# * Physics update
#-------------------------------------------------------------------------------
# Force physics to update when testing?
# If you set this option to false you may delete the physics file manually
# to refresh the collision system. You only will need to refresh the file
# when you make a change in any map.
Force_Physics_Update = true
#-------------------------------------------------------------------------------
# * Auto-Multiply system
#-------------------------------------------------------------------------------
# Multiply event commands? (event_commands will be multiplied by Pixel constant)
# Please note that it isn't a very precise feature, it's better if you
# multiply the commands by yourself to get better results.
Multiply_Commands = false
# Commands that will be multiplied (ID, separated by commas)
Commands = [1,2,3,4,5,6,7,8,9,10,11,12,13]
#-------------------------------------------------------------------------------
# * Pixel settings (OTHER SETTINGS THAN THE DEFAULT MAY CRASH YOUR GAME!!!)
#-------------------------------------------------------------------------------
# Axis [x plus, y plus, width, height]
# Default: [0,0,0.75,0.75]
# True Pixel: [0.25,0.25,0.25,0.50]
Axis = [0.25,0.25,0.25,0.50]
# Bush axis [x plus, y plus, width, height]
Bush_Axis = [0.5,0.75,0.0,0.0]
# Counter axis [x plus, y plus, width, height]
Counter_Axis = [0.25,0.25,0.25,0.25]
# Pixel constant (32/Pixel must be an integer!) - Best setting: 4
Pixel = 4
# Tile divisor (256/Tile must be an integer!) - Best setting: 0.25
Tile = 0.25
# Default collision range (must be an integer!)
Collision = 3
# Trigger range (direction => [x,y])
Trigger_Range = {2=>[0,2],4=>[-2,0],6=>[2,0],8=>[0,-2]}
# Counter range
Counter_Range = {2=>[0,3],4=>[-3,0],6=>[3,0],8=>[0,-3]}
# Vehicle Range (gettin on or off vehicles)
Vehicle_Range = {2=>[0,3],4=>[-3,0],6=>[3,0],8=>[0,-3]}
end
#-------------------------------------------------------------------------------
# * End of setup part
#-------------------------------------------------------------------------------
class Game_Character
include Pixel_Core
attr_accessor :px
attr_accessor :py
attr_accessor :collision
alias apm_initialize initialize
alias apm_moveto moveto
alias apm_jump jump
alias apm_update_bush_depth update_bush_depth
alias apm_force_move_route force_move_route
alias default_mr move_right
alias default_ml move_left
alias default_mu move_up
alias default_md move_down
alias default_mur move_upper_right
alias default_mul move_upper_left
alias default_mlr move_lower_right
alias default_mll move_lower_left
def initialize
apm_initialize
if (Maps.include?($game_map.map_id) rescue false)
@x = @x.to_f
@y = @y.to_f
@pixel = true
else
@pixel = false
end
@px = (@x*Pixel).to_i
@py = (@y*Pixel).to_i
@collision = Collision
end
def moveto(x,y)
@pixel = Maps.include?($game_map.map_id)
apm_moveto(x,y)
if Maps.include?($game_map.map_id)
@x = @x.to_f
@y = @y.to_f
end
@px = (@x*Pixel).to_i
@py = (@y*Pixel).to_i
end
def update_bush_depth
if @pixel
if object? or @priority_type != 1 or @jump_count > 0
@bush_depth = 0
else
bush = $physics[$game_map.map_id][@px,@py,4] == 1
if bush and not moving?
@bush_depth = 8
elsif not bush
@bush_depth = 0
end
end
else
apm_update_bush_depth
end
end
def move_down(t=true)
@pixel ? pixel_md(t) : default_md(t)
end
def move_up(t=true)
@pixel ? pixel_mu(t) : default_mu(t)
end
def move_left(t=true)
@pixel ? pixel_ml(t) : default_ml(t)
end
def move_right(t=true)
@pixel ? pixel_mr(t) : default_mr(t)
end
def move_upper_right
@pixel ? pixel_mur : default_mur
end
def move_upper_left
@pixel ? pixel_mul : default_mul
end
def move_lower_right
@pixel ? pixel_mlr : default_mlr
end
def move_lower_left
@pixel ? pixel_mll : default_mll
end
def pixel_mr(turn_ok)
if pixel_passable?(@px+1,@py)
turn_right
@x += Tile
@px += 1
@real_x = (@x-Tile)*256
increase_steps
@move_failed = false
else
turn_right if turn_ok
check_touch(@px+1, @py)
@move_failed = true
end
end
def pixel_ml(turn_ok)
if pixel_passable?(@px-1,@py)
turn_left
@x -= Tile
@px -= 1
@real_x = (@x+Tile)*256
increase_steps
@move_failed = false
else
turn_left if turn_ok
check_touch(@px-1, @py)
@move_failed = true
end
end
def pixel_mu(turn_ok)
if pixel_passable?(@px,@py-1)
turn_up
@y -= Tile
@py -= 1
@real_y = (@y+Tile)*256
increase_steps
@move_failed = false
else
turn_up if turn_ok
check_touch(@px, @py-1)
@move_failed = true
end
end
def pixel_md(turn_ok)
if pixel_passable?(@px,@py+1)
turn_down
@y += Tile
@py += 1
@real_y = (@y-Tile)*256
increase_steps
@move_failed = false
else
turn_down if turn_ok
check_touch(@px, @py+1)
@move_failed = true
end
end
def pixel_mur
pixel_mu(true)
pixel_mr(true)
end
def pixel_mul
pixel_mu(true)
pixel_ml(true)
end
def pixel_mlr
pixel_md(true)
pixel_mr(true)
end
def pixel_mll
pixel_md(true)
pixel_ml(true)
end
def pixel_passable?(px,py)
return false unless $game_map.pixel_valid?(px,py)
return true if @through or debug_through?
return false if $physics[$game_map.map_id][px,py,0] == 0
return false if collision?(px,py)
return true
end
def collision?(px,py)
for event in $game_map.events.values
if (event.px - px).abs <= event.collision && (event.py - py).abs <= event.collision
next if event.through || event == self
return true if event.priority_type == 1
end
end
if @priority_type == 1 && !$game_player.in_airship?
return true if ($game_player.px - px).abs <= @collision && ($game_player.py - py).abs <= @collision
end
return false
end
def check_touch(px,py)
end
def force_move_route(mr)
apm_force_move_route(mr)
multiply_commands
end
def multiply_commands
return unless @pixel
return unless Multiply_Commands
return if @move_route.list.empty?
new_route = []
for cmd in @move_route.list
if Commands.include?(cmd.code)
Pixel.times do
new_route << cmd
end
else
new_route << cmd
end
end
@move_route.list = new_route
end
def centralize(fx=@x.to_i,fy=@y.to_i)
cx = @x - fx
cy = @y - fy
tx = (cx/Tile).to_i
ty = (cy/Tile).to_i
ty.times do; (cy > 0 ? pixel_mu(false) : pixel_md(false)); end
tx.times do; (cx > 0 ? pixel_ml(false) : pixel_mr(false)); end
end
def move_random
if @pixel
case rand(8)
when 0; pixel_mu(false)
when 1; pixel_md(false)
when 2; pixel_ml(false)
when 3; pixel_mr(false)
when 4; pixel_mur
when 5; pixel_mul
when 6; pixel_mlr
when 7; pixel_mll
end
else
case rand(4)
when 0; move_down(false)
when 1; move_left(false)
when 2; move_right(false)
when 3; move_up(false)
end
end
end
def move_type_toward_player
sx = @x - $game_player.x
sy = @y - $game_player.y
if sx.abs + sy.abs >= 20
move_random
else
if @pixel
move_toward_player
else
case rand(6)
when 0..3; move_toward_player
when 4; move_random
when 5; move_forward
end
end
end
end
def move_toward_player
sx = distance_x_from_player
sy = distance_y_from_player
if @pixel
unless sy == 0
sy > 0 ? pixel_mu(true) : pixel_md(true)
end
unless sx == 0
sx > 0 ? pixel_ml(true) : pixel_mr(true)
end
else
if sx != 0 or sy != 0
if sx.abs > sy.abs
sx > 0 ? move_left : move_right
if @move_failed and sy != 0
sy > 0 ? move_up : move_down
end
else
sy > 0 ? move_up : move_down
if @move_failed and sx != 0
sx > 0 ? move_left : move_right
end
end
end
end
end
def move_away_from_player
sx = distance_x_from_player
sy = distance_y_from_player
if @pixel
unless sy == 0
sy < 0 ? pixel_mu(true) : pixel_md(true)
end
unless sx == 0
sx < 0 ? pixel_ml(true) : pixel_mr(true)
end
else
if sx != 0 or sy != 0
if sx.abs > sy.abs
sx > 0 ? move_right : move_left
if @move_failed and sy != 0
sy > 0 ? move_down : move_up
end
else
sy > 0 ? move_down : move_up
if @move_failed and sx != 0
sx > 0 ? move_right : move_left
end
end
end
end
end
def jump(xp,yp)
apm_jump(xp,yp)
@px = @x*Pixel
@py = @y*Pixel
end
end
class Game_Player < Game_Character
alias apm_get_on_vehicle get_on_vehicle
alias apm_get_off_vehicle get_off_vehicle
def get_on_vehicle
@pixel ? pixel_gov : apm_get_on_vehicle
end
def get_off_vehicle
@pixel ? pixel_offv : apm_get_off_vehicle
end
def pixel_offv
if in_airship?
return unless pixel_airdocs?(@px,@py)
else
fx = @px+Vehicle_Range[@direction][0]
fy = @py+Vehicle_Range[@direction][1]
return unless pixel_walk?(fx,fy)
end
$game_map.vehicles[@vehicle_type].get_off
if in_airship?
@direction = 2
else
jump(Vehicle_Range[@direction][0]*Tile,Vehicle_Range[@direction][1]*Tile)
@transparent = false
end
@vehicle_getting_off = true
@move_speed = 4
@through = false
@walking_bgm.play
make_encounter_count
end
def pixel_gov
fx = @px+Trigger_Range[@direction][0]
fy = @py+Trigger_Range[@direction][1]
if ($game_map.boat.px - fx).abs <= $game_map.boat.collision && ($game_map.boat.py - fy).abs <= $game_map.boat.collision
return false if $physics[$game_map.map_id][@px+Vehicle_Range[@direction][0],@py+Vehicle_Range[@direction][1],1] == 0
jump(Vehicle_Range[@direction][0]*Tile,Vehicle_Range[@direction][1]*Tile)
@vehicle_getting_on = true
@vehicle_type = 0
@walking_bgm = RPG::BGM::last
$game_map.boat.get_on
return true
elsif ($game_map.ship.px - fx).abs <= $game_map.ship.collision && ($game_map.ship.py - fy).abs <= $game_map.ship.collision
return false if $physics[$game_map.map_id][@px+Vehicle_Range[@direction][0],@py+Vehicle_Range[@direction][1],2] == 0
jump(Vehicle_Range[@direction][0]*Tile,Vehicle_Range[@direction][1]*Tile)
@vehicle_getting_on = true
@vehicle_type = 1
@walking_bgm = RPG::BGM::last
$game_map.ship.get_on
return true
elsif ($game_map.airship.px - fx).abs <= $game_map.airship.collision && ($game_map.airship.py - fy).abs <= $game_map.airship.collision
$game_player.centralize($game_map.airship.x,$game_map.airship.y)
@vehicle_getting_on = true
@vehicle_type = 2
@through = true
@walking_bgm = RPG::BGM::last
$game_map.airship.get_on
return true
end
return false
end
def pixel_walk?(px,py)
lvt = @vehicle_type
@vehicle_type = -1
result = pixel_passable?(px,py)
@vehicle_type = lvt
return result
end
def pixel_airdocs?(px,py)
return false if $physics[$game_map.map_id][px,py,3] == 0
return false if collision?(px,py)
return true
end
def pixel_passable?(px,py)
return false unless $game_map.pixel_valid?(px,py)
return true if @through or debug_through?
case @vehicle_type
when 0
return false if $physics[$game_map.map_id][px,py,1] == 0
when 1
return false if $physics[$game_map.map_id][px,py,2] == 0
when 2
return true
else
return false if $physics[$game_map.map_id][px,py,0] == 0
end
return false if collision?(px,py)
return true
end
def move_by_input
return unless movable?
return if $game_map.interpreter.running?
if @pixel
case Input.dir8
when 1; pixel_mll
when 2; pixel_md(true)
when 3; pixel_mlr
when 4; pixel_ml(true)
when 6; pixel_mr(true)
when 7; pixel_mul
when 8; pixel_mu(true)
when 9; pixel_mur
end
else
case Input.dir4
when 2; move_down
when 4; move_left
when 6; move_right
when 8; move_up
end
end
end
def update_encounter
return if $TEST and Input.press?(Input::CTRL)
return if in_vehicle?
if @pixel
@encounter_count -= ($physics[$game_map.map_id][@px,@py,4] == 1 ? 2 : 1)
else
@encounter_count -= ($game_map.bush?(@x, @y) ? 2 : 1)
end
end
def collision?(px,py)
for event in $game_map.events.values
if (event.px - px).abs <= event.collision && (event.py - py).abs <= event.collision
next if event.through
return true if event.priority_type == 1
end
end
return false
end
def check_touch(px,py)
return false if $game_map.interpreter.running?
result = false
for event in $game_map.events.values
if (event.px - px).abs <= event.collision && (event.py - py).abs <= event.collision
if [1,2].include?(event.trigger) && event.priority_type == 1
event.start
result = true
end
end
end
return result
end
def pixel_th?(t)
return false if $game_map.interpreter.running?
result = false
for event in $game_map.events.values
if (event.px - @px).abs <= event.collision && (event.py - @py).abs <= event.collision
if t.include?(event.trigger) && event.priority_type != 1
event.start
result = true if event.starting
end
end
end
return result
end
def pixel_tt?(t)
return false if $game_map.interpreter.running?
result = false
fx = @px+Trigger_Range[@direction][0]
fy = @py+Trigger_Range[@direction][1]
for event in $game_map.events.values
if (event.px - fx).abs <= event.collision && (event.py - fy).abs <= event.collision
if t.include?(event.trigger) && event.priority_type == 1
event.start
result = true
end
end
end
if !result && $physics[$game_map.map_id][fx,fy,5] == 1
fx += Counter_Range[@direction][0]
fy += Counter_Range[@direction][1]
for event in $game_map.events.values
if (event.px - fx).abs <= event.collision && (event.py - fy).abs <= event.collision
if t.include?(event.trigger) && event.priority_type == 1
event.start
result = true
end
end
end
end
return result
end
def check_touch_event
return false if in_airship?
return (@pixel ? pixel_th?([1,2]) : check_event_trigger_here([1,2]))
end
def check_action_event
return false if in_airship?
return true if (@pixel ? pixel_th?([0]) : check_event_trigger_here([0]))
return (@pixel ? pixel_tt?([0,1,2]) : check_event_trigger_there([0,1,2]))
end
end
class Game_Event < Game_Character
alias apm_event_initialize initialize
alias apm_setup setup
def initialize(m,e)
apm_event_initialize(m,e)
setup_collision
end
def setup_collision
@collision = Collision
unless @list.nil?
for value in 0...@list.size
next if @list[value].code != 108 && @list[value].code != 408
if @list[value].parameters[0].include?("[collision ")
@list[value].parameters[0].scan(/\[collision ([0.0-9.9]+)\]/)
@collision = $1.to_i
end
end
end
@force_dc = false
return unless @pixel
unless @list.nil?
for value in 0...@list.size
next if @list[value].code != 108 && @list[value].code != 408
if @list[value].parameters[0] == ("[forcedefaultcmd]")
@force_dc = true
end
end
end
end
def check_touch(px,py)
return if $game_map.interpreter.running? || $game_player.in_vehicle?
if @trigger == 2 && ($game_player.px - px).abs <= @collision && ($game_player.py - py).abs <= @collision
start if not jumping? and @priority_type == 1
end
end
def setup(n)
apm_setup(n)
unless @page.nil?
setup_collision
multiply_commands unless @force_dc
end
end
def move_random
if @force_dc
case rand(4)
when 0; pixel_md(true)
when 1; pixel_ml(true)
when 2; pixel_mr(true)
when 3; pixel_mu(true)
end
else
super
end
end
def pixel_mr(turn_ok)
if @force_dc
if pixel_passable?(@px+Pixel,@py)
turn_right
@x += 1
@px += Pixel
@real_x = (@x-1)*256
increase_steps
@move_failed = false
else
turn_right if turn_ok
check_touch(@px+1, @py)
@move_failed = true
end
else
super(turn_ok)
end
end
def pixel_ml(turn_ok)
if @force_dc
if pixel_passable?(@px-Pixel,@py)
turn_left
@x -= 1
@px -= Pixel
@real_x = (@x+1)*256
increase_steps
@move_failed = false
else
turn_left if turn_ok
check_touch(@px-1, @py)
@move_failed = true
end
else
super(turn_ok)
end
end
def pixel_mu(turn_ok)
if @force_dc
if pixel_passable?(@px,@py-Pixel)
turn_up
@y -= 1
@py -= Pixel
@real_y = (@y+1)*256
increase_steps
@move_failed = false
else
turn_up if turn_ok
check_touch(@px, @py-1)
@move_failed = true
end
else
super(turn_ok)
end
end
def pixel_md(turn_ok)
if @force_dc
if pixel_passable?(@px,@py+Pixel)
turn_down
@y += 1
@py += Pixel
@real_y = (@y-1)*256
increase_steps
@move_failed = false
else
turn_down if turn_ok
check_touch(@px, @py+1)
@move_failed = true
end
else
super(turn_ok)
end
end
end
class Game_Map
alias apm_initialize initialize
alias apm_setup setup
def initialize
apm_initialize
@pixel_w = 0
@pixel_h = 0
end
def setup(id)
apm_setup(id)
@pixel_w = Pixel_Core::Pixel*@map.width
@pixel_h = Pixel_Core::Pixel*@map.height
end
def pixel_valid?(px,py)
return (px >= 0 && px < @pixel_w && py >= 0 && py < @pixel_h)
end
end
class Game_Vehicle < Game_Character
alias apm_set_location set_location
alias apm_sync_with_player sync_with_player
def set_location(m,x,y)
apm_set_location(m,x,y)
if Maps.include?(m)
@x = @x.to_f
@y = @y.to_f
@pixel = true
else
@pixel = false
end
@px = (@x*Pixel).to_i
@py = (@y*Pixel).to_i
end
def sync_with_player
apm_sync_with_player
@px = $game_player.px
@py = $game_player.py
end
end
class Khas_Physics
Axis = Pixel_Core::Axis
Bush_Axis = Pixel_Core::Bush_Axis
Pixel = Pixel_Core::Pixel
Tile = Pixel_Core::Tile
Counter_Axis = Pixel_Core::Counter_Axis
def initialize
@maps = {}
@passages = load_data("Data/System.rvdata").passages
run
end
def run
size = []; phase = 0
for i in 0...Pixel_Core::Maps.size
size << (100*i)/Pixel_Core::Maps.size
end
warn = Sprite.new
warn.bitmap = Bitmap.new(192,32)
warn.y = 376
for id in Pixel_Core::Maps
warn.bitmap.clear
warn.bitmap.draw_text(32,0,160,32,"Loading... #{size[phase]}%")
Graphics.update; Graphics.wait(5)
map = load_data(sprintf("Data/Map%03d.rvdata", id))
@maps[id] = Table.new(map.width*Pixel,map.height*Pixel,6)
for x in 0...(map.width*Pixel)
for y in 0...(map.height*Pixel)
@maps[id][x,y,0] = process_point(x*Tile+Axis[0],y*Tile+Axis[1],map,0x01)
@maps[id][x,y,1] = process_point(x*Tile+Axis[0],y*Tile+Axis[1],map,0x02)
@maps[id][x,y,2] = process_point(x*Tile+Axis[0],y*Tile+Axis[1],map,0x04)
@maps[id][x,y,3] = process_point(x*Tile+Axis[0],y*Tile+Axis[1],map,0x08)
@maps[id][x,y,4] = bush_point?(x*Tile+Bush_Axis[0],y*Tile+Bush_Axis[1],map)
@maps[id][x,y,5] = counter_point?(x*Tile+Counter_Axis[0],y*Tile+Counter_Axis[1],map)
end
end
phase += 1
end
warn.bitmap.clear
warn.bitmap.draw_text(32,0,160,32,"Loading... 100%")
Graphics.update; Graphics.wait(20)
warn.bitmap.dispose; warn.dispose
warn = nil
Graphics.update
end
def process_point(x,y,map,flag)
return 0 unless (x >= 0 && x < map.width && y >= 0 && y < map.height)
return 0 unless free_tile?(x.to_i,y.to_i,map,flag)
return 0 unless free_tile?((x+Axis[2]).to_i,y.to_i,map,flag)
return 0 unless free_tile?(x.to_i,(y+Axis[3]).to_i,map,flag)
return 0 unless free_tile?((x+Axis[2]).to_i,(y+Axis[3]).to_i,map,flag)
return 1
end
def bush_point?(x,y,map)
return 1 if (@passages[map.data[x.to_i,y.to_i,1]] & 0x40 == 0x40 rescue false)
return 1 if (@passages[map.data[(x+Bush_Axis[2]).to_i,y.to_i,1]] & 0x40 == 0x40 rescue false)
return 1 if (@passages[map.data[x.to_i,(y+Bush_Axis[3]).to_i,1]] & 0x40 == 0x40 rescue false)
return 1 if (@passages[map.data[(x+Bush_Axis[2]).to_i,(y+Bush_Axis[3]).to_i,1]] & 0x40 == 0x40 rescue false)
return 0
end
def counter_point?(x,y,map)
return 1 if (@passages[map.data[x.to_i,y.to_i,0]] & 0x80 == 0x80 rescue false)
return 1 if (@passages[map.data[(x+Counter_Axis[2]).to_i,y.to_i,0]] & 0x80 == 0x80 rescue false)
return 1 if (@passages[map.data[x.to_i,(y+Counter_Axis[3]).to_i,0]] & 0x80 == 0x80 rescue false)
return 1 if (@passages[map.data[(x+Counter_Axis[2]).to_i,(y+Counter_Axis[3]).to_i,0]] & 0x80 == 0x80 rescue false)
return 0
end
def free_tile?(x,y,map,flag)
for i in [2, 1, 0]
tile_id = map.data[x, y, i]
return false if tile_id == nil
pass = @passages[tile_id]
next if pass & 0x10 == 0x10
return true if pass & flag == 0x00
return false if pass & flag == flag
end
return false
end
def [](id)
return @maps[id]
end
end
if File.exists?("Khas Physics.rgss2a") && !(Pixel_Core::Force_Physics_Update && $TEST)
tmf = File.open("Khas Physics.rgss2a", "rb")
$physics = Marshal.load(tmf); tmf.close
else
$physics = Khas_Physics.new
tmf = File.open("Khas Physics.rgss2a", "wb")
Marshal.dump($physics,tmf); tmf.close
end
Any help would be appreciated, thank you!