PushEvent.js (pushable events)

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
This is such a common thing in RPGs and it turned out so easy to do, that I know that this plugin probably already exists (maybe more than once).

Mine is special for these simple comment tags. (perhaps?)
  • <push> makes an event pushable
  • <moveIfCornered> makes event move if push up against obstacle
  • <withDirection> makes event face direction like driving it
  • <heavySpeed:number> will make the push slow down to that speed
They go in event comments and not in the note, because I wanted it to rely on pages. The events pushability is also independent of their trigger, so you can have a push by pushing and a talk by action button.

This plugin is based on some event script I wrote for @XGuarden at her request so this is really her idea.
This thread: https://forums.rpgmakerweb.com/index.php?threads/push-a-box-using-javascript.75244/

That's really all that's to this plugin.

I wish I could say more about it, but all it does is makes events pushable with event comments. I allow commercial use too, as I do with all my 2 scripts. Keeping myself busy, yepper!

EDIT:
I made a version 0.3, because just a slight optimization. When I rushed to correct the broken pages, I snuck the comments reader in Sprite_Character.prototype.update which turns out runs every frame, so I added some Boolean to make sure to only read the comments once per page per solo frame, and not rapidly and redundantly re-capture all the data every frame.

Update: version 0.4
I corrected a possible bug for events without pages. I'm not sure, but this might work better with events spawned with another plugin. Thanks
@Edilsonsoares

Update: version 0.5 - Cognitive impairment re-fix. Thanks to @Rhino
 

Attachments

Last edited:

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
Nicely done, mogwai! Sometimes the most useful plugins are the ones that are simple things everyone asks about.
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
Thanks @Trihan ! Kudos I get, fuels my motivation to make more things.
What I'm curious to see in this thread if anyone gets my classic Dragon Quest reference in the example video of pushing the old man to the hot springs.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
I didn't pick up on it but then again I came to that series fairly late.
 

The Stranger

The Faceless Friend
Veteran
Joined
Sep 14, 2012
Messages
3,341
Reaction score
21,539
First Language
British English
Primarily Uses
RMMV
That music is awesome!

Handy script\plug-in. Eventing pushable stuff is always fairly time consuming - this saves a lot of time.
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
@The Stranger Yep. I made about 4 different versions of the event script in the push thread, because I kept missing something in each one, but this way those four event scripts are basically a comment tag now. I picked out the music from Audioswap.

@Trihan
I thought it was push the old man to a hot spring, but all I could find was pushing the old man to church. Perhaps it was the Taloon chapter and the same old man at night time. I had the NES version; this is the DS version.
 
Last edited:

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
I just want to bump this old thread to say the first version was kinda broken!
I've made a version 0.2...

I had it take comments on setCharacterBitmap, which turns out only runs once and then when you update the bitmaps. So it wasn't reading comments on page changes. I fixed this.

I also changed my aliases to IIFE arguments so there is no chance of name collisions. @Clock Out taught me this neat trick. @LTN Games might have been on about this earlier too, but I needed an example to get it.

EDIT/EDIT:
I made a version 0.3, because just a slight optimization. When I rushed to correct the broken pages, I snuck the comments reader in Sprite_Character.prototype.update which turns out runs every frame, so I added some Boolean to make sure to only read the comments once per page per solo frame, and not rapidly and redundantly re-capture all the data every frame.
 
Last edited:

Edilsonsoares

Villager
Member
Joined
Mar 4, 2016
Messages
28
Reaction score
2
First Language
portugues
Primarily Uses
N/A
I open a title screen and when I press the new game, it appears
 
Last edited:

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
@Edilsonsoares
I can only read a Google translate, which is loose, but I know what that screenshot means

Ayeyeye!

I can think of a fix for this.
Though, out of curiosity, are you using an event spawning plugin?

If so, it seems to be doing it dangerously, creating an event without its pages.

Try this version 0.4 - I think it will work, but I'm not sure what other risky events might be in your game.
 

Attachments

Last edited:

Edilsonsoares

Villager
Member
Joined
Mar 4, 2016
Messages
28
Reaction score
2
First Language
portugues
Primarily Uses
N/A
I've disabled all plugins,but the error persists :rswt
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
I thought it might have been the characterBase boats, but I can't replicate this error, so I'm not sure what is wrong.

Did you get the version 0.4 attached to my last post? The download link seems to have a 0 for a download count.
 

Edilsonsoares

Villager
Member
Joined
Mar 4, 2016
Messages
28
Reaction score
2
First Language
portugues
Primarily Uses
N/A
I had not seen... :rswt
Now it worked
Muito obrigado ou melhor, thanks
 

AestheticGamer

Veteran
Veteran
Joined
Dec 27, 2014
Messages
55
Reaction score
24
First Language
English
Primarily Uses
Heads-up, this plug-in for whatever reason completely breaks the "Direction Fix" check for events so it just doesn't work anymore.
 

AestheticGamer

Veteran
Veteran
Joined
Dec 27, 2014
Messages
55
Reaction score
24
First Language
English
Primarily Uses
Basically I have sprites loaded from Character sheets in the environment, with a $ symbol in front to make it a limited spritesheet. I do this for some objects in my game, such as items you pick up so they don't take up space on tilesheets/NPCs who are bigger than 48x48 tiles. In this case it was something that was 48x48 tiles, but on a 3x4 tilesheet.

So one of the sheets has different items on different directions of the sheet, like this:



So I was trying to use the lower-left bottle. And on the event, so it would turn into the different colored keys when you observed it from different directions, I checked the lower-left Event box for "Direction Fix" in RPG Maker, since that locks the direction of an event normally.

But I noticed it wasn't doing that in the game, even with the Direction Fix set it would still turn into different objects when I observed it from different directions.

So I turned off all of my plug-ins and indeed direction fix worked again. So then I turned on each plug-in individually to see which broke the Direction Fix (and turned the others off if they didn't do it to find which one was the problem child), and it ended up being this plug-in. Even by itself it broke the Direction Fix option for Events without any other plug-ins turned on. Once I had turned all the other plug-ins on and turned this one off, it was working again too.
 

Rhino

~Inactive~
Veteran
Joined
Feb 28, 2017
Messages
482
Reaction score
789
First Language
English
Primarily Uses
RMMV
Turn off walking/stepping.
I'm having a problem with the directional fix too. I've turned the walking & stepping off but it hasn't helped :kaocry: I checked my other plugins but it does seem to be this one causing the problem.

EDIT: I just realised I have an event that needs a stepping animation anyway so this wouldn't be a viable fix for me.
 
Last edited:

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
That's not really the same problem. That other one had a sprite with different things on each frame.

The only thing that should break the direction fix is the <withDirection> comment. That will change the direction to the pusher's direction.
 

Rhino

~Inactive~
Veteran
Joined
Feb 28, 2017
Messages
482
Reaction score
789
First Language
English
Primarily Uses
RMMV
Erm, sorry for being dense. I'll try to explain the problem better. I'm making an event with Starbird's Animated Fountain. It has four different fountains on the sprite sheet.
I'm trying to use this one.
1.png

When I interact with it from the front, it changes. The only direction it works in is if the player is facing left.
2.png 4.jpg

(I will be fixing the sides so the interaction looks better, I'm mostly concerned about the up & down interaction.)

This is how the event looks- the direction fix is on and there's no push comments.
3.png

You mentioned to AestheticGamer to turn the Walking + Stepping for the event off, which didn't work for me, but wouldn't help anyway as I need the stepping animation for the water. I've also tried using a set move route: direction fix when you interact with the event, but that changes the graphic and then locks it into the wrong image.

I hope this makes more sense ^^'
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
These screenshots show default events like they are supposed to behave.

It's a little ambiguous to see the problem with my script.

A screenshot or a bbcode box with the push comments would help.

I'm not even sure you are pushing the event yet.
 

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

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,033
Messages
1,018,441
Members
137,820
Latest member
georg09byron
Top