Shaz Large Collision Graphic

Hello, I had found Shaz's large collision script she had written for another member some time ago, but for the life of me, I can't get it to work. I even opened a new project and tried.

Spoiler
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)
end
end

Its tiny here is the link.


Thanks for your help!
The script works ok for me. Here is the comment tag I used :

Code:
# 1 tile width, 3 tile height
<collision: 0,96>
WTBH? I tried again, and get nothing. Can you post a screen cap of your event, please? I would greatly appreciate it.
Hmm ... the event really is nothing special. 


large-event-img.png
Please don't use that script.  It's too complicated, working in pixels.  I've done a better version that works in tiles instead:  here's the code


NEITHER of these should be used for events that are moving around.  They are ONLY for events that stay in the same spot (like transfer events that will cover multiple tiles).


The event you have the comment on needs to be in the lower left corner of the collision area.  So if you have a sprite to go with it, you will either need to edit the spritesheet to take that into consideration, or use a second event that contains the sprite but no commands.


If you still can't get it working, perhaps you should show a screenshot of your event so we can take a look
Thanks. The damned thing is not working for me. I'll post an image of my event.


The script DOES go above Main but below Materials, right? It only works when the player is IMMEDIATELY on the event itself... 🙁

Spoiler
Script.png


Event.png



Well, I'll keep the new code around for other things, but do you know if it's possible to have a big event that IS moving? I don't know if pixel perfect collision is that big of an issue, since the player will be moving so rapidly that I doubt 2px is going to be much of a killer for most folks.



To be most precise, I am looking for a script that can make the players hitbox equal to as many as 7 tiles long and 2 high. Alternatively, those dimensions on a regular event would work, also.


Thanks!
get rid of the space after the comma


Someone wrote a script for moving events with large collision areas, but I don't recall who that was, or if it's for Ace or MV.


Looks like the version you're using doesn't require the event to be in the lower left corner of the collision area, but the lower center of the collision area.  So you could use a multi-tile wide sprite without having to adjust it.
pfff, that simple eh? ha ha, I are genius! Thanks.


Testing out your pixel one, it doesnt seem to be an issue with the event flying along at max speed. I am going to test your tile one, seems more in line with what i seek.
The tile-based one DOES need the event to be in the lower left corner if it's more than a tile wide.  Just keep that in mind, but otherwise, they should behave fairly similarly.
how would i set the event image up so it will be lower left side? Not familiar with that action.
You need to remember that when you give an event a sprite that is larger than the default tile size, the sprite will be centered horizontally on the event.  So if you're setting up an event that's more than one tile wide, and you want to give it a large sprite, the sprite has to be wide enough that when it's centered, the image appears to be over the hit area.  This would require adding whitespace to the left of the sprite to move it far enough to the right that it looks to be aligned with the event.  


Not much fun.  I normally only use this script for events that don't have sprites.
I have an event that is like this:

OOOOOOO


OOOXOOO


Where X represents the event's location in relation to the sprite. I am going to try and resize it smaller horizontally, but for it to work right now, what collision tag would I use? I am using <collision: 192,64>


Do I need to edit the sprite to move it over left or right? Or should it work as is?

Spoiler
big event not working.png
<collision: 224,64>


it's # tiles wide x 32, # tiles high x 32


The sprite should work as it is.  It's only if you're using the later version, where you enter the number of tiles rather than pixels, that you have to worry about the sprite.

Original thread: https://forums.rpgmakerweb.com/threads/shaz-large-collision-graphic.67740/