Big Sprite Movement/Collision/Trigger Fix

dahlys

Meatbun
Veteran
Joined
Aug 28, 2017
Messages
95
Reaction score
99
First Language
English
Primarily Uses
RMMV
Big Sprite Movement/Collision/Trigger Fix
by Dahlys

Make Player, Vehicles, and Events BIG

Introduction

By default, only the base tile for characters is solid regardless of sprite size. To make it bigger, you need to make multiple events. With this plugin, you can make characters occupy more tiles. You can have larger map monsters, bigger vehicles, or enlarge the player.

Features
  • Set vehicle size in plugin parameters. Set event size by notetag or comment (when size is only applicable to certain pages). Set player size by running an event containing a bigPlayer comment. Change character sizes halfway through an event using a comment tag.
  • Big player and events can be any shape and size (vehicles still in the works, but rectangular, circle, and diamond shape are ok). You can make the base tile passable and the rest of the character solid! Also, you can make the sprite rotation axis be at the center of the big sprite rather than the base tile. You can even customize right down to which tiles are solid when the character faces a certain direction.
  • When a big character moves and turns around, the size will be adjusted accordingly. If a part of the large event hit the map edges/impassable tiles/characters and cannot move/turn, it will not move/turn. Same goes for diagonal movement (both player and event), jump and swap.
  • Player, vehicle, and event triggers will also be enlarged automatically. You can choose whether the player/event triggers activate regardless of direction (as long as it is touching) because big sprites might not be able to turn to face the player/event.
  • Choose whether you want to get on/off only from the side of the vehicle or from any direction. Getting on/off the side makes more sense and is visually appealing for vehicles like big cars and boats/ships. For side get on/off, you can choose which side is preferred by picking between left-hand drive and right-hand drive.
  • Choose whether you want a vehicle to reverse or flip directions when you suddenly make a 180 degree turn.
  • Plugin compatibility was tested with Galv's diagonal movement and spawn events as well as Yanfly's region and vehicle restrictions.
Plugin Download

At github: https://github.com/dahlys/rpgmaker/blob/master/Dahlys_BigSprites.js
Plugin Order: After Yanfly's core (if using), diagonal movement, but before region and vehicle restrictions.

Example


Terms of Use

Credit Dahlys for the plugin. It is free to use.
 
Last edited:

matgraz

Veteran
Veteran
Joined
Feb 4, 2018
Messages
66
Reaction score
4
First Language
Portuguese
Primarily Uses
RMMV
I'm trying it, i cant seem to make it work...

I made a event that would trigger a bell sound and the plugin comment
upload_2019-9-15_22-1-40.png
upload_2019-9-15_22-2-2.png


But when i try it, it still has a small collision area:

upload_2019-9-15_22-3-41.png



Did i miss something?

Thanks!
 

Featherbrain

Veteran
Veteran
Joined
Jan 12, 2020
Messages
50
Reaction score
44
First Language
English
Primarily Uses
RMMV
This... is... AWESOME!!

I've been looking for a plugin that handled collision for larger events for like a year and somehow never even came across this one until now (coincidentally, while looking for a solution to something totally different, of course). There are plenty of plugins for larger event hitboxes, but I couldn't find a single one that actually checks for "self-collision" and thus allows events to move. So far this seems to work beautifully for that and deserves much more recognition than it seems to have gotten.

Lovely. Thanks so much!

Not sure if you're still active or making updates to this, but just in case, I did find an incompatibility (well, technically, two incompatibilities) with diagonal sprite display during event movement.

For background info, I'm using both Galv's AND Victor Engine diagonal plugins--this is because Galv's plugin does not handle "autonomous" diagonal movement for events. E.g., if you set an event to "random" or "approach" using only Galv's plugin, the movement route will not display diagonal sprites (in fact, autonomous movement routes don't even include diagonal movements, only up/left/right/down). However, using Victor Engine DiagonalMovement in addition to Galv's seems to rewrite the "random" and "approach" functions in a way that not only adds diagonal movements into autonomous movement routes but also displays the diagonal sprites, using Galv's spritesheet format no less!

That said, without Victor Engine plugin, Galv's plugin by itself can ordinarily still display the diagonal sprites in event movement routes, just not "autonomously," only using movement commands (or the corresponding script codes). That is, if you select the movement route command "Move Lower Left," it WILL move diagonally and properly display the diagonal sprites. So, with some elaborate if-statements in script calls, you can simulate the "autonomous" movements using Galv's plugin and still display the diagonal sprites, even without the Victor Engine plugin.

...Long story short, your plugin breaks both of these features in both plugins. Neither autonomous nor movement command diagonals actually display the diagonal sprites. You don't get diagonal movement, much less sprites, in autonomous movement like "random" and "approach" (from VE_DiagonalMovement), and although you can still get events to move diagonally with movement route commands like "Move Lower Left," it still doesn't display the appropriate diagonal sprite (from Galv's Diagonal Movement).

It would be amazing if the incompatibility with Galv's could be fixed so that movement commands display the diagonal. It would be INCREDIBLE to also have compatibility for VE_DiagonalMovement or at least for the functionality from that plugin that includes diagonals in autonomous movement routes. I'm pretty sure the problem there is in the way "MoveRandom" function is set up. (But... I'm a newb so idk.)

ETA: In fact, after some tinkering with that function, I was able to get your plugin to include diagonal movements in autonomous movement routes (without VE_DiagonalMovements), but the diagonal sprites still don't display properly during the diagonal movements:

JavaScript:
    var _Game_Character_moveRandom = Game_Character.prototype.moveRandom;
    Game_Character.prototype.moveRandom = function() {
        if (this._bigSprite.type && this._bigSprite.type.includes('B')) {
            var d = Math.randomInt(10);
            if (d % 2 !== 0 && d !==5) {
                var horz = (d === 1 || d === 7) ? 4 : 6;
                var vert = (d === 1 || d === 3) ? 2 : 8;
                if (this.canPassDiagonally(this._x, this._bigSprite.Y0, horz, vert)) {
                    this.moveDiagonally(horz, vert);
                }
            } else if (d % 2 == 0) {
                if (this.canPass(this.x, this._bigSprite.Y0, d)) {
                    this.moveStraight(d);
                }
            }           
        } else {
            _Game_Character_moveRandom.call(this);
        }
    };
Again, I'm a newb, so this hack is probably sloppy and/or breaking something, but hey, maybe it helps?

Note: Diagonal movement and diagonal sprites for player seems to work fine. This is strictly for event movement.

Sorry for the wall of text (I'll spoiler hide it). I probably could have been more concise/clear but it's late and I've been tinkering with this stuff all day... And this is a three year old thread so I'm not sure anyone's interested in this obscure incompatibility anyway, lol.

Regardless, thanks again for this awesome plugin. Even if the diagonal movement for events gets sacrificed I think I'll be sticking with it. It definitely fills a void in collision plugins for moving events.
 
Last edited:

dahlys

Meatbun
Veteran
Joined
Aug 28, 2017
Messages
95
Reaction score
99
First Language
English
Primarily Uses
RMMV
Last edited:

dahlys

Meatbun
Veteran
Joined
Aug 28, 2017
Messages
95
Reaction score
99
First Language
English
Primarily Uses
RMMV
This... is... AWESOME!!

I've been looking for a plugin that handled collision for larger events for like a year and somehow never even came across this one until now (coincidentally, while looking for a solution to something totally different, of course). There are plenty of plugins for larger event hitboxes, but I couldn't find a single one that actually checks for "self-collision" and thus allows events to move. So far this seems to work beautifully for that and deserves much more recognition than it seems to have gotten.

Lovely. Thanks so much!

Not sure if you're still active or making updates to this, but just in case, I did find an incompatibility (well, technically, two incompatibilities) with diagonal sprite display during event movement.

For background info, I'm using both Galv's AND Victor Engine diagonal plugins--this is because Galv's plugin does not handle "autonomous" diagonal movement for events. E.g., if you set an event to "random" or "approach" using only Galv's plugin, the movement route will not display diagonal sprites (in fact, autonomous movement routes don't even include diagonal movements, only up/left/right/down). However, using Victor Engine DiagonalMovement in addition to Galv's seems to rewrite the "random" and "approach" functions in a way that not only adds diagonal movements into autonomous movement routes but also displays the diagonal sprites, using Galv's spritesheet format no less!

That said, without Victor Engine plugin, Galv's plugin by itself can ordinarily still display the diagonal sprites in event movement routes, just not "autonomously," only using movement commands (or the corresponding script codes). That is, if you select the movement route command "Move Lower Left," it WILL move diagonally and properly display the diagonal sprites. So, with some elaborate if-statements in script calls, you can simulate the "autonomous" movements using Galv's plugin and still display the diagonal sprites, even without the Victor Engine plugin.

...Long story short, your plugin breaks both of these features in both plugins. Neither autonomous nor movement command diagonals actually display the diagonal sprites. You don't get diagonal movement, much less sprites, in autonomous movement like "random" and "approach" (from VE_DiagonalMovement), and although you can still get events to move diagonally with movement route commands like "Move Lower Left," it still doesn't display the appropriate diagonal sprite (from Galv's Diagonal Movement).

It would be amazing if the incompatibility with Galv's could be fixed so that movement commands display the diagonal. It would be INCREDIBLE to also have compatibility for VE_DiagonalMovement or at least for the functionality from that plugin that includes diagonals in autonomous movement routes. I'm pretty sure the problem there is in the way "MoveRandom" function is set up. (But... I'm a newb so idk.)

ETA: In fact, after some tinkering with that function, I was able to get your plugin to include diagonal movements in autonomous movement routes (without VE_DiagonalMovements), but the diagonal sprites still don't display properly during the diagonal movements:

JavaScript:
    var _Game_Character_moveRandom = Game_Character.prototype.moveRandom;
    Game_Character.prototype.moveRandom = function() {
        if (this._bigSprite.type && this._bigSprite.type.includes('B')) {
            var d = Math.randomInt(10);
            if (d % 2 !== 0 && d !==5) {
                var horz = (d === 1 || d === 7) ? 4 : 6;
                var vert = (d === 1 || d === 3) ? 2 : 8;
                if (this.canPassDiagonally(this._x, this._bigSprite.Y0, horz, vert)) {
                    this.moveDiagonally(horz, vert);
                }
            } else if (d % 2 == 0) {
                if (this.canPass(this.x, this._bigSprite.Y0, d)) {
                    this.moveStraight(d);
                }
            }          
        } else {
            _Game_Character_moveRandom.call(this);
        }
    };
Again, I'm a newb, so this hack is probably sloppy and/or breaking something, but hey, maybe it helps?

Note: Diagonal movement and diagonal sprites for player seems to work fine. This is strictly for event movement.

Sorry for the wall of text (I'll spoiler hide it). I probably could have been more concise/clear but it's late and I've been tinkering with this stuff all day... And this is a three year old thread so I'm not sure anyone's interested in this obscure incompatibility anyway, lol.

Regardless, thanks again for this awesome plugin. Even if the diagonal movement for events gets sacrificed I think I'll be sticking with it. It definitely fills a void in collision plugins for moving events.
I never tested compatability with diagonal sprites cos I don't use them so I didn't realize there was a bug there, only tested Galv's diagonal movement. And I haven't tested it with Victor's engine at all.

I could take a look, but like you said, it's been 3 years and I can't even remember what is what when I look at my own code... Not to mention I work more with python than javascript these days...
 

Featherbrain

Veteran
Veteran
Joined
Jan 12, 2020
Messages
50
Reaction score
44
First Language
English
Primarily Uses
RMMV
Yeah, I figured you might have moved on by now, lol. Well, if you do get a chance to check it out, I'd be grateful, but if you don't feel like it, no worries! It's still a great plugin and I'll tinker with it as I go. Thanks again for sharing it.

ETA: Just FYI, I figured out a workaround for my project today as far as the diagonal sprite display goes. So, just in case you were looking into that, you don't have to worry about it. At least not for my sake!
 
Last edited:

dahlys

Meatbun
Veteran
Joined
Aug 28, 2017
Messages
95
Reaction score
99
First Language
English
Primarily Uses
RMMV
Yeah, I figured you might have moved on by now, lol. Well, if you do get a chance to check it out, I'd be grateful, but if you don't feel like it, no worries! It's still a great plugin and I'll tinker with it as I go. Thanks again for sharing it.

ETA: Just FYI, I figured out a workaround for my project today as far as the diagonal sprite display goes. So, just in case you were looking into that, you don't have to worry about it. At least not for my sake!
I haven't tested it very thoroughly, but the diagonal sprites seem to be working for me now. I tested with both Galv and Victor's plugins turned on, but didn't mess with approach or random movement, only event and player movement. I hope all your sprites are have diagonals, or this is gonna get complicated instead of being an easy 1 liner fix (all I had to do was turn on/off a switch called this._diagDir). Under the new plugin parameters make sure diagonal charsets are set to true (it is false by default so as not to mess with other people's stuff).

That's all, just redownload the updated plugin on github.
 

Featherbrain

Veteran
Veteran
Joined
Jan 12, 2020
Messages
50
Reaction score
44
First Language
English
Primarily Uses
RMMV
First off, you are awesome! And yeah, setting this._diagDir was my fix too, but I only shoehorned it in my modified moveRandom function to solve my very specific edge case with random large event movement. Your changes also let me define collision for the player (with diagonal sprites)--not really needed for my current project but definitely more robust. From what I can tell everything is working perfectly now. Thanks so much!
 

cabanas_ds

Veteran
Veteran
Joined
Aug 13, 2020
Messages
54
Reaction score
15
First Language
english
Primarily Uses
RMMV
i desperately want this for MZ!
 

dahlys

Meatbun
Veteran
Joined
Aug 28, 2017
Messages
95
Reaction score
99
First Language
English
Primarily Uses
RMMV
i desperately want this for MZ!
I don't have MZ, and don't plan on buying it unless it goes on 80% sale or something, so you'll have to port it yourself, unfortunately.
 

Featherbrain

Veteran
Veteran
Joined
Jan 12, 2020
Messages
50
Reaction score
44
First Language
English
Primarily Uses
RMMV
FYI: This plugin is also incompatible with Yanfly Move Route Core. When "big sprites" set by this plugin use Yanfly move commands, they either don't work or result in bizarre behavior (sprite display errors, soft-locks).

That said, the Yanfly move commands seem to work fine as long as you disable the "big sprite" setting on the fly, i.e. give the "big sprite" event a self-switch page that does not have the <bigEvent> comment, then script call to $gameSelfSwitches to flip switch on and off before and after the movement commands.

That workaround seems good enough for my purposes since collision isn't that crucial during a controlled move route sequence anyway. Just posting here in case you wanted to know or anyone using this ran into the same thing.

ETA: Actually, this workaround doesn't work all the time. Even if no "big events" are currently set on the map, at least some of the Yanfly move commands don't seem to work for the player when this plugin is enabled. I'll have to figure something else out to get "move event to x, y coordinates" type function.

ETA 2: Just a further update. The issue with the player movement from my last update is actually from VE Diagonal Movement which fully rewrites the "findDirectionTo" function; removing that portion of his plugin fixed the error with player movement using Yanfly Move Core. Although, this incompatibility only seems to appear if your plugin is also enabled, Yanfly Move Core and VE Diagonal both work without issue if only they are used. All three of these plugins reference and/or rewrite similar functions relating to movement so compatibility may just be a lost cause.

ETA 3: My final (probably) addendum to this: Galv's Move Route Extras has a command to move toward a point that can be looped until the point is reached. It seems slightly more compatible with your plugin than Yanfly's, with a comparable feature set, but I still have to disable the "big sprite" settings before calling these commands. Anyway, this particular configuration let me do what I needed to do at the moment.
 
Last edited:

cabanas_ds

Veteran
Veteran
Joined
Aug 13, 2020
Messages
54
Reaction score
15
First Language
english
Primarily Uses
RMMV
I don't have MZ, and don't plan on buying it unless it goes on 80% sale or something, so you'll have to port it yourself, unfortunately.
i don't understand what porting it even means yet but maybe i'll figure it out soon :)
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,635
Reaction score
906
First Language
Dutch
Primarily Uses
RMMV
@cabanas_ds porting means, creating this plugin to be able to use in RPG MZ as well,
sometimes it require some coding in order to work, sometimes, a new plugin with
bigger alternatezation in order to work in MZ.

MV and MZ uses both plugins in javascript, MZ uses @target MZ and if there isn't much
different, adding that will work for MZ directly, but 99% of the time, a bit of code need
to be added, so that's why "porting" the plugin to MZ to be compatable :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I had lots of fun! Kids loved me, and some took pictures. Unfortunately, the videos didn't send... but you'll see Chica in action when I do a trailer for Fandom Scouts!
Dama wrote on akoniti's profile.
Hi
Thanks for your review.
I was checking the trailer for details and as the woman shut the door at the exact moment the song I was hearing said "you slim the door" and I couldn't resist to add it there. :D And I used this idea one more time on another scene.
Just doing some tileset tinkering again...
rux
Someone please help me make my game.
I need someone to volunteer, I am on my knees man.

Forum statistics

Threads
104,690
Messages
1,008,147
Members
136,183
Latest member
brandini503
Top