Hello
So one of the scripts I'm using is Huddels Event Hitboxes, it's a script that makes events have a bigger "hitbox"
Now I understand events don't actually have hitboxes in vx ace but this script does something that makes the area the event takes up bigger than one tile.
It's a really good script that I've been using for a while but now I found a problem.
For some reason, events using this scripts command cannot move right nor left, at least in the custom movement option.
If I choose "move right" or "move left" or even "turn right/left", nothing, doesn't work for some reason.
I found this out because I'm making and event that has a very specific pattern where he goes right, left, up, down, and the sprite is pretty big so I had to use the script command to make the hitbox bigger.
But now the event just doesn't go right nor left.
Can anyone help me solve this?
Here's the script.
And this is the script command that I put on my event
hitbox_y=-2
hitbox_x=-1
hitbox_height=3
hitbox_width=3
So one of the scripts I'm using is Huddels Event Hitboxes, it's a script that makes events have a bigger "hitbox"
Now I understand events don't actually have hitboxes in vx ace but this script does something that makes the area the event takes up bigger than one tile.
It's a really good script that I've been using for a while but now I found a problem.
For some reason, events using this scripts command cannot move right nor left, at least in the custom movement option.
If I choose "move right" or "move left" or even "turn right/left", nothing, doesn't work for some reason.
I found this out because I'm making and event that has a very specific pattern where he goes right, left, up, down, and the sprite is pretty big so I had to use the script command to make the hitbox bigger.
But now the event just doesn't go right nor left.
Can anyone help me solve this?
Here's the script.
#------------------------------------------------------------
#------------------------------------------------------------
#--------------------- EVENT HITBOXES ---------------------
#------------------------------------------------------------
#------------------------------------------------------------
#
# Script created by Hudell (www.hudell.com)
# Version: 1.1
# You're free to use this script on any project
#
# Change Log:
#
# v1.1 - 2015-08-06
# => Changed the script to reload hitbox data when the event page is changed
#
# v1.0 - 2015-07-25
# => Created the script
#
#
#------------------------------------------------------------
#------------------------------------------------------------
#----------------------- HOW TO USE -----------------------
#------------------------------------------------------------
#------------------------------------------------------------
#
# In any event that you want to change the size, add any of those settings in a comment:
#
# hitbox_y=0
# hitbox_x=0
# hitbox_height=1
# hitbox_width=1
#
# Change the values as you need. Only integer values are support. A height of 1 means the event is 1 tile high. A height of 2 means the event is two tiles high
# You need to use negative x/y values to move the hitbox left/up.
#
#
#------------------------------------------------------------
#------------------------------------------------------------
#--------------- DON'T EDIT AFTER THIS LINE ---------------
#------------------------------------------------------------
#------------------------------------------------------------
class Game_Event < Game_Character
attr_writer :hitbox_x
attr_writer :hitbox_y
attr_writer :hitbox_width
attr_writer :hitbox_height
def get_config(regex, default)
return default if @list.nil?
@list.each do |command|
if command.code == 108 || command.code == 408
begin
result = command.parameters[0].scan(regex)
unless result.nil?
value = result[0][0].to_i
return value
end
rescue
end
end
end
default
end
def hitbox_x
if @hitbox_x.nil?
regex = /hitbox\_x_*=_*(.*)$/
@hitbox_x = get_config(regex, 0)
end
@hitbox_x
end
def hitbox_y
if @hitbox_y.nil?
regex = /hitbox\_y_*=_*(.*)$/
@hitbox_y = get_config(regex, 0)
end
@hitbox_y
end
def hitbox_width
if @hitbox_width.nil?
regex = /hitbox\_width_*=_*(.*)$/
@hitbox_width = get_config(regex, 1)
end
@hitbox_width
end
def hitbox_height
if @hitbox_height.nil?
regex = /hitbox\_height_*=_*(.*)$/
@hitbox_height = get_config(regex, 1)
end
@hitbox_height
end
def left_x
@x + hitbox_x
end
def right_x
@x + hitbox_x + hitbox_width
end
def top_y
@y + hitbox_y
end
def bottom_y
@y + hitbox_y + hitbox_height
end
def pos?(x, y)
x >= left_x && x < right_x && y >= top_y && y < bottom_y
end
alias :hudell_event_sizes_game_event_setup_page :setup_page
def setup_page(new_page)
hudell_event_sizes_game_event_setup_page(new_page)
@hitbox_x = nil
@hitbox_y = nil
@hitbox_height = nil
@hitbox_width = nil
end
end
#------------------------------------------------------------
#--------------------- EVENT HITBOXES ---------------------
#------------------------------------------------------------
#------------------------------------------------------------
#
# Script created by Hudell (www.hudell.com)
# Version: 1.1
# You're free to use this script on any project
#
# Change Log:
#
# v1.1 - 2015-08-06
# => Changed the script to reload hitbox data when the event page is changed
#
# v1.0 - 2015-07-25
# => Created the script
#
#
#------------------------------------------------------------
#------------------------------------------------------------
#----------------------- HOW TO USE -----------------------
#------------------------------------------------------------
#------------------------------------------------------------
#
# In any event that you want to change the size, add any of those settings in a comment:
#
# hitbox_y=0
# hitbox_x=0
# hitbox_height=1
# hitbox_width=1
#
# Change the values as you need. Only integer values are support. A height of 1 means the event is 1 tile high. A height of 2 means the event is two tiles high
# You need to use negative x/y values to move the hitbox left/up.
#
#
#------------------------------------------------------------
#------------------------------------------------------------
#--------------- DON'T EDIT AFTER THIS LINE ---------------
#------------------------------------------------------------
#------------------------------------------------------------
class Game_Event < Game_Character
attr_writer :hitbox_x
attr_writer :hitbox_y
attr_writer :hitbox_width
attr_writer :hitbox_height
def get_config(regex, default)
return default if @list.nil?
@list.each do |command|
if command.code == 108 || command.code == 408
begin
result = command.parameters[0].scan(regex)
unless result.nil?
value = result[0][0].to_i
return value
end
rescue
end
end
end
default
end
def hitbox_x
if @hitbox_x.nil?
regex = /hitbox\_x_*=_*(.*)$/
@hitbox_x = get_config(regex, 0)
end
@hitbox_x
end
def hitbox_y
if @hitbox_y.nil?
regex = /hitbox\_y_*=_*(.*)$/
@hitbox_y = get_config(regex, 0)
end
@hitbox_y
end
def hitbox_width
if @hitbox_width.nil?
regex = /hitbox\_width_*=_*(.*)$/
@hitbox_width = get_config(regex, 1)
end
@hitbox_width
end
def hitbox_height
if @hitbox_height.nil?
regex = /hitbox\_height_*=_*(.*)$/
@hitbox_height = get_config(regex, 1)
end
@hitbox_height
end
def left_x
@x + hitbox_x
end
def right_x
@x + hitbox_x + hitbox_width
end
def top_y
@y + hitbox_y
end
def bottom_y
@y + hitbox_y + hitbox_height
end
def pos?(x, y)
x >= left_x && x < right_x && y >= top_y && y < bottom_y
end
alias :hudell_event_sizes_game_event_setup_page :setup_page
def setup_page(new_page)
hudell_event_sizes_game_event_setup_page(new_page)
@hitbox_x = nil
@hitbox_y = nil
@hitbox_height = nil
@hitbox_width = nil
end
end
And this is the script command that I put on my event
hitbox_y=-2
hitbox_x=-1
hitbox_height=3
hitbox_width=3