So I'm using Shaz's large collision script and it has been a lifesaver. I'm doing events that require dynamically determined collision, and it's cut out 100+ events from some of my maps, which took them from unplayable to totally manageable.
Overall the script is great, but there's a bit of problem and I'm wondering if it would be easy to fix. The input for the script is a comment with integer arguments for width and height. Arguments are for the number of pixels that the object's collision should span, not tiles. Since there are 32 pixels per tile, a collision argument of 32,32 corresponds to collision one tile wide. 32,64 means one tile long and two tiles high, 64,64 is a 2x2 square, etc.
The issue is that a width argument for an even number of tiles creates an odd number of colliding tiles. IE, an argument of 64 creates collision three tiles wide, an argument of 128 creates file tiles, etc. Height arguments work correctly for both even and odd. Here's the script:
class Game_Event < Game_Character alias shaz_large_event_collision_clear_page_settings clear_page_settings alias shaz_large_event_collision_setup_page_settings setup_page_settings def clear_page_settings shaz_large_event_collision_clear_page_settings @collide_width = 0 @collide_height = 0 end def setup_page_settings shaz_large_event_collision_setup_page_settings @collide_width = 0 @collide_height = 0 list_index = 0 while list_index < @list.size && [108,408].include?(@list[list_index].code) colx, coly = @list[list_index].parameters[0].scan(/<collision: (\d+),(\d+)>/i)[0] @collide_width = colx.nil? ? 0 : (colx.to_i / 64) @collide_height = coly.nil? ? 0 : (coly.to_i / 32 - 1) list_index = @list.size if @collide_width != 32 || @collide_height != 32 list_index += 1 end end def pos?(x,y) x.between?(@x - @collide_width, @x + @collide_width) && y.between?(@y - @collide_height, @y) endendIn any case, thanks for the script Shaz. Lifesaver.
I've also got a second question I might as well throw in here. Is any extra processing required for events that have walking animation checked, but movement set to fixed? I have thousands of blank events on various maps that are set this way, and many of these maps have so many events that they are starting to suffer reduced framerates. Would it be worthwhile to uncheck walking animation on all these (we're talking hours of monotony), or is that condition not even going to be checked for an event whose graphic is set to none and has movement set to fixed?
Overall the script is great, but there's a bit of problem and I'm wondering if it would be easy to fix. The input for the script is a comment with integer arguments for width and height. Arguments are for the number of pixels that the object's collision should span, not tiles. Since there are 32 pixels per tile, a collision argument of 32,32 corresponds to collision one tile wide. 32,64 means one tile long and two tiles high, 64,64 is a 2x2 square, etc.
The issue is that a width argument for an even number of tiles creates an odd number of colliding tiles. IE, an argument of 64 creates collision three tiles wide, an argument of 128 creates file tiles, etc. Height arguments work correctly for both even and odd. Here's the script:
class Game_Event < Game_Character alias shaz_large_event_collision_clear_page_settings clear_page_settings alias shaz_large_event_collision_setup_page_settings setup_page_settings def clear_page_settings shaz_large_event_collision_clear_page_settings @collide_width = 0 @collide_height = 0 end def setup_page_settings shaz_large_event_collision_setup_page_settings @collide_width = 0 @collide_height = 0 list_index = 0 while list_index < @list.size && [108,408].include?(@list[list_index].code) colx, coly = @list[list_index].parameters[0].scan(/<collision: (\d+),(\d+)>/i)[0] @collide_width = colx.nil? ? 0 : (colx.to_i / 64) @collide_height = coly.nil? ? 0 : (coly.to_i / 32 - 1) list_index = @list.size if @collide_width != 32 || @collide_height != 32 list_index += 1 end end def pos?(x,y) x.between?(@x - @collide_width, @x + @collide_width) && y.between?(@y - @collide_height, @y) endendIn any case, thanks for the script Shaz. Lifesaver.
I've also got a second question I might as well throw in here. Is any extra processing required for events that have walking animation checked, but movement set to fixed? I have thousands of blank events on various maps that are set this way, and many of these maps have so many events that they are starting to suffer reduced framerates. Would it be worthwhile to uncheck walking animation on all these (we're talking hours of monotony), or is that condition not even going to be checked for an event whose graphic is set to none and has movement set to fixed?