VXAce Problem with hitboxes and "event touch"

Im woking on a boss fight where the Boss launches these rather large 5x3 projectiles.

**** my life 2.png



I've been using Hudell's Event Hitboxes script which is really good and easy to use. Though I came across a slight issue.
For some reason, the script doesn't work for events that have "through" marked or even "above character".

**** my life.png


For some reason, when it's marked as either through or above character, only the space marked by the red square has a hitbox, that being the original 32x32 hitbox. Not exactly ideal.


So I figured "fine, I'll just have it be an event touch event and when it touches the player it damages them.
Even bigger problem though, for some mind boggling reason "Event touch" doesn't seem the work if the player isn't moving.
It's facing the player, it's touching them, but for some reason it only damages the player if they are moving which is not good. It only works if the player is touched by the center of the sprite, again the area marked by the red square.

Is there any way to solve this? maybe edit Huddels script to work on above player and through events and make it so the whole hitbox damages the player when the event touches them and not just the center?

Thank you.

Spoiler: Huddel's 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
Im woking on a boss fight where the Boss launches these rather large 5x3 projectiles.

View attachment 347797


I've been using Hudell's Event Hitboxes script which is really good and easy to use. Though I came across a slight issue.
For some reason, the script doesn't work for events that have "through" marked or even "above character".

View attachment 347798

For some reason, when it's marked as either through or above character, only the space marked by the red square has a hitbox, that being the original 32x32 hitbox. Not exactly ideal.


So I figured "fine, I'll just have it be an event touch event and when it touches the player it damages them.
Even bigger problem though, for some mind boggling reason "Event touch" doesn't seem the work if the player isn't movie.
It's facing the player, it's touching them, but for some reason it only damages the player if they are moving which is not good.

Is there any way to solve this? maybe edit Huddels script to work on above player and through events or make it so event touch works on players that aren't moving?

Thank you.

Spoiler: Huddel's 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

Ok correction.
Just realized that if the player stands still IN THE CENTER of the sprite, it works.
Anywhere else the player has to move.
That still won't work
Managed to find an interesting workaround.
Instead of making the hitbox larger, I used Hudells script to slightly raise the hitbox and DaimoniousTailsGames's Proximity Detection Script with a parallel process to detect if the player was inside the sprite.
Captura de ecrã 2025-08-19 153920.png


Im not sure how, but this somehow works and that makes me happy and now the projectile damages the player no problem.

Still, I'd like to know if theres any solution for the hitbox problem.
from your description you have misunderstood several of the RM settings.

First, "Through" means "ignore all passability and collision restrictions" - so of course a through event will never react to any touch. The same goes for "above" which is basically "away from the player".
So that behaviour is exactly normal.

Second, there are no hitboxes by default. The default collision works by coordinate comparison, which is why only the event position counts even if the event itself is larger.
And while there are scripts for large events, those usually only work for non-moving events, it would be much more difficult to handle large moving events.

Third, the trigger "event touch" means "event moves on player position", while "player touch" means "Player moves on event position". And since position means a coordinate it is of course only the center box with the event that triggers anything.

So basically your post says that you have a problem with everything working as intended and no errors anywhere.

That said, you simply need to find a different way to handle things. My first suggestion would be to check player coordinates for being inside the bottom row of five hexes of the attack event.
that is a number of mathematics (control variable commands) around the two pairs of coordinates.
Unless you have a rather complex movement that should work for this case.

EDIT: ninja'd
from your description you have misunderstood several of the RM settings.

First, "Through" means "ignore all passability and collision restrictions" - so of course a through event will never react to any touch. The same goes for "above" which is basically "away from the player".
So that behaviour is exactly normal.

Second, there are no hitboxes by default. The default collision works by coordinate comparison, which is why only the event position counts even if the event itself is larger.
And while there are scripts for large events, those usually only work for non-moving events, it would be much more difficult to handle large moving events.

Third, the trigger "event touch" means "event moves on player position", while "player touch" means "Player moves on event position". And since position means a coordinate it is of course only the center box with the event that triggers anything.

So basically your post says that you have a problem with everything working as intended and no errors anywhere.

That said, you simply need to find a different way to handle things. My first suggestion would be to check player coordinates for being inside the bottom row of five hexes of the attack event.
that is a number of mathematics (control variable commands) around the two pairs of coordinates.
Unless you have a rather complex movement that should work for this case.

EDIT: ninja'd
I already found a workaround that works for this so I should be fine but how would I go about doing it the way you said?
And yeah it's a simple movement, the attack just goes down.
basically use four control variable commands to load the coordinates for both player and attack command into four variables.
then substract player x from event x and player y from event y
followed by conditional branches:
if the difference in y is 0 then the player is in the same height of the attack
if the difference in x is between -2 and +2 the player is in the 5 box area of the attack edge.
if both is true, damage
basically use four control variable commands to load the coordinates for both player and attack command into four variables.
then substract player x from event x and player y from event y
followed by conditional branches:
if the difference in y is 0 then the player is in the same height of the attack
if the difference in x is between -2 and +2 the player is in the 5 box area of the attack edge.
if both is true, damage
oohhh, yeah that makes sense. Seems pretty simple.
Thank you so much!
basically use four control variable commands to load the coordinates for both player and attack command into four variables.
then substract player x from event x and player y from event y
followed by conditional branches:
if the difference in y is 0 then the player is in the same height of the attack
if the difference in x is between -2 and +2 the player is in the 5 box area of the attack edge.
if both is true, damage
Actually, any way you could send some pics of how to do this? I'm trying to replicate it and I'm having some trouble
show a screenshot of what yo0u have so far and a lot of people here can tell you where you went wrong
show a screenshot of what yo0u have so far and a lot of people here can tell you where you went wrong
Well I'll keep with the way I did it which was using which DaimoniousTailsGames's Proximity Detection Script, it's working really well so far.

Original thread: https://forums.rpgmakerweb.com/threads/problem-with-hitboxes-and-event-touch.179651/