TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
365
Reaction score
407
First Language
French
Primarily Uses
RMMZ
TSR_MoveEvent Title.png
Author:
TSR, The Northern Frog
Download:
TSR_MoveEvent
This plugin allows to push, pull, pick up and throw events.



Code:
 * 
* =========================================================================================
 * == About this Plugin ====================================================================
 * =========================================================================================
 * Use the following comment tags to turn the event page into a movable event.
 * 
 * Event Comment Tags:
 * ===================
 * 
 *            <MOVABLE EVENT>
 *                  Event page having this comment tag can be pushed and 
 *                  pulled by the player. 
 * 
 * 
 *            <MOVABLE MYSTERY: X>
 *                  Event page having this comment tag can be pushed and 
 *                  pulled by the player. In addition, these events will  
 *                  play the 'Mystery Sound' (set in parameters), and turn 
 *                  ON the switch specified by X. 
 * 
 *                  This will happen only the first time the event is moved.
 *                  Those events will be considered as regular movable events
 *                  afterwards.
 * 
 * 
 *            <PICKUP EVENT>
 *                  Event page having this comment tags can be picked up and
 *                  thrown by the player. 
 * 
 * 
 *            <MOVE EVENT OFFSET: X>
 *                  Use this tag if you need to adjust the distance the
 *                  player has to walk to get closer to the movable event.
 *                  Without the tag, the distance will be defined by the 
 *                  'move event offset' parameter. 
 * 
 *                  This commment tag can also be used on pickup events to
 *                  set the distance between the player and the event it is
 *                  holding.
 * 
 * 
 * Map Note Tag:
 * =============
 * 
 *      By default the thrown events respect the same passability as the player.
 *      You can throw events over some unpassable tiles by using the following
 *      tag in a map notebox.
 * 
 *            <THROW REGION: x, x, x>
 *                  Use this map notetag to mark some region Id as passable
 *                  for throwing event through those regions.
 * 
 * 
 * 
 * HOW TO USE:
 * ===========
 * 
 *          TO PUSH: Hold the ARROW KEY in the direction toward the movable
 *                   event until it back off one tile.
 * 
 *          TO PULL: Hold the OK BUTTON when standing next to a movable event
 *                   and facing it, and wait until it move one tile.
 * 
 *              *There's a small delay when pushing or pulling. Keep holding
 *               the key and you'll see the player starting to 'run' against 
 *               the movable event. Then you'll hear the 'Effort Sound' (set
 *               in parameters) and see the 'Effort Balloon' (also set in
 *               parameters). After a few more frames, the event will move
 *               and the player will move along with it.
 * 
 *             **When pushing and pulling, the player will walk shortly to
 *               get closer to the movable event. The default distance is
 *               set in parameters. There's also an event comment tag to 
 *               assign specific distance to some events. 
 * 
 *            ***The pushing and pulling event will move at the speed set in
 *               the event tab. Player will move at same speed when pushing
 *               or pulling the event.
 * 
 * 
 *         TO PICKUP: Stand in front of a pickable event and hold the OK
 *                    BUTTON to pick it up. Keep holding the key because
 *                    releasing it will drop the event. You can move and
 *                    dash while holding an event. 
 * 
 *          TO THROW: Release the OK BUTTON to drop the event the player is
 *                    holding. The event will be dropped on the tile in front
 *                    of the player. If you drop it while holding an ARROW
 *                    KEY, the event will be thrown one tile away in front
 *                    of the player. And if you drop while holding both the
 *                    DASH BUTTON and an ARROW KEY, the event will be thrown
 *                    2 tiles away in front of the player.
 * 
 * 
 * SCRIPT CALLS:
 * =============
 * 
 *      In order to manage your movable events interaction on the map, you can 
 *      use a few script calls to check events position on the map.
 * 
 *       
 *      PUSH / PULL events
 *      ==================
 * 
 *      Use the following default call to check an event position at any time:
 * 
 *               $gameMap.event(eventId).pos(x, y) 
 * 
 *      It will return true or false wheter the event is at position x, y on
 *      the map. This can be checked in a parallel process event or in an
 *      autonomous movement script command.
 * 
 * 
 * 
 *      PICK & THROW events
 *      ===================
 *  
 *      These events can be a bit trickier to manage for game mechanics 
 *      purposes. The plugin provide additionnal script calls to check 
 *      these events positions.
 * 
 *               $gamePlayer.isHolding(eventId);
 * 
 *      This call will return true if the map event specified by eventId is 
 *      hold (carried) by the player.
 * 
 * 
 *               $gamePlayer.hasBroughtEvent(eventId, x, y, d)
 * 
 *      This call will return true if the map event specified by eventId is 
 *      hold by the player on tile x, y and turned in direction d.
 * 
 * 
 *               $gamePlayer.hasGaveEvent(eventId, targetEventId)
 * 
 *      This call will return true if the map event specified by eventId is 
 *      hold by the player on the tile in front of the map event specified
 *      by targetEventId The player must be facing the target event.
 * 
 * 
 *              $gamePlayer.hasThrownEvent(eventId, x, y)
 * 
 *      This one will returm true if the player has actually thrown or
 *      drop the map event specified by evenId on that exact tile at 
 *      position x, y.
 *     
 * 
 * 
*
Code:
===========================================================

ToU:

Use in any independant RPG Maker MZ or MV projects, including commercials.

Credit is required for using this Plugin. For crediting, use 'TSR' along with one of the following terms: 'The Northern Frog' or 'A frog from the north'

Do not change the Header or the Terms of usage.

DO NOT REDISTRIBUTE! If you want to share it, share the link to my itch.io account:  https://the-northern-frog.itch.io/

Sending me a copy of your completed game using my plugin would be appreciated,  but there's no obligation.

===========================================================

Regards!
TSR
 
Last edited:

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
365
Reaction score
407
First Language
French
Primarily Uses
RMMZ
First update!

Push / pull events:
  • Better transition for pushing and pulling, the player will walk shortly to get closer the the movable event. The default distance depends on a parameter, but can be set by an event comment tag to adjust to the event image size.
  • Player and movable event will walk the same speed defined by the event speed tab so you can set a lower speed for heavier things.

Pick up events:
  • Player walk on the tile of the event when picking it up, making a better transition.
  • When throw/drop an event while facing an impassable tile, the event will drop on the tile behind (or one of the sides if behind isn't free).



Regards! B) :rock-right:
 

cabanas_ds

Veteran
Veteran
Joined
Aug 13, 2020
Messages
100
Reaction score
26
First Language
english
Primarily Uses
RMMV
such a champ. last version worked good for me.
such a cool idea for puzzles or even just for a bit of fun.
 
  • Like
Reactions: TSR

ReIris

ReIris
Member
Joined
Sep 5, 2020
Messages
27
Reaction score
117
First Language
Chinese(TW)
Primarily Uses
RMMZ
Hello! I have question!
if i used galv's camcontrolMZ,this plugin will in walk appear push action.
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
365
Reaction score
407
First Language
French
Primarily Uses
RMMZ
Hello all!
New update: TSR_MoveEvent v1.1.1

  • some minor fixes (should fix your problem @m03271996)
  • Revamp of the comment tags for additional functionality
Code:
* Event Comment Tags:
 * ===================
 *
 *            <MOVABLE EVENT>
 *                  Event page having this comment tag can be pushed and
 *                  pulled by the player.
 *
 *                  <MOVABLE EVENT: X>
 *                      You can add a switch (X) argument to the comment
 *                      tag. If so, the event will only be movable when
 *                      the game switch X is ON. While the switch is OFF,
 *                      the player will react as if he can push/pull the
 *                      event, but it won't budge unless the switch is
 *                      turned ON.
 *
 *
 *            <MOVABLE MYSTERY: X>
 *                  Event page having this comment tag can be pushed and
 *                  pulled by the player. In addition, these events will 
 *                  play the 'Mystery Sound' (set in parameters), and turn
 *                  ON the switch specified by X.
 *
 *                  This will happen only the first time the event is moved.
 *                  Those events will be considered as regular movable events
 *                  afterwards.
 *
 *
 *            <PICKUP EVENT>
 *                  Event page having this comment tags can be picked up and
 *                  thrown by the player. You can use images from tiles sheets
 *                  or character sheets; in both case the event will be fixed
 *                  on the specified image, no matter the direction. The step
 *                  animation can be toggle ON when using a character sheet.
 *
 *              <PICKUP EVENT: X>
 *                  You can add a self switch X argument to the comment tag.
 *                  The event will turn ON the self switch specified by X
 *                  when it reach the ground after being dropped or thrown.
 * 
 *
 *            <PICKUP CHARACTER>
 *                  This comment tag have the same effect than the previous
 *                  one. But event having this comment tag must be assigned
 *                  an image from a character sheet because they will turn
 *                  around according to the player direction when picked up.
 *
 *                  Example:
 *                      The event is turned down and player comes from down
 *                      side (playing is looking up) and pick up the event.
 *                      The event and player are facing each other, so that
 *                      will remain when player change direction. Hence, if
 *                      player turn left, the event will turn right.
 *                 
 *
 *            <MOVE EVENT OFFSET: X>
 *                  Use this tag if you need to adjust the distance the
 *                  player has to walk to get closer to the movable event.
 *                  Without the tag, the distance will be defined by the
 *                  'move event offset' parameter.
 *
 *                  This commment tag can also be used on pickup events to
 *                  set the distance between the player and the event it is
 *                  holding.
 

ReIris

ReIris
Member
Joined
Sep 5, 2020
Messages
27
Reaction score
117
First Language
Chinese(TW)
Primarily Uses
RMMZ
Hello all!
New update: TSR_MoveEvent v1.1.1

  • some minor fixes (should fix your problem @m03271996)
  • Revamp of the comment tags for additional functionality
Code:
* Event Comment Tags:
* ===================
*
*            <MOVABLE EVENT>
*                  Event page having this comment tag can be pushed and
*                  pulled by the player.
*
*                  <MOVABLE EVENT: X>
*                      You can add a switch (X) argument to the comment
*                      tag. If so, the event will only be movable when
*                      the game switch X is ON. While the switch is OFF,
*                      the player will react as if he can push/pull the
*                      event, but it won't budge unless the switch is
*                      turned ON.
*
*
*            <MOVABLE MYSTERY: X>
*                  Event page having this comment tag can be pushed and
*                  pulled by the player. In addition, these events will
*                  play the 'Mystery Sound' (set in parameters), and turn
*                  ON the switch specified by X.
*
*                  This will happen only the first time the event is moved.
*                  Those events will be considered as regular movable events
*                  afterwards.
*
*
*            <PICKUP EVENT>
*                  Event page having this comment tags can be picked up and
*                  thrown by the player. You can use images from tiles sheets
*                  or character sheets; in both case the event will be fixed
*                  on the specified image, no matter the direction. The step
*                  animation can be toggle ON when using a character sheet.
*
*              <PICKUP EVENT: X>
*                  You can add a self switch X argument to the comment tag.
*                  The event will turn ON the self switch specified by X
*                  when it reach the ground after being dropped or thrown.
*
*
*            <PICKUP CHARACTER>
*                  This comment tag have the same effect than the previous
*                  one. But event having this comment tag must be assigned
*                  an image from a character sheet because they will turn
*                  around according to the player direction when picked up.
*
*                  Example:
*                      The event is turned down and player comes from down
*                      side (playing is looking up) and pick up the event.
*                      The event and player are facing each other, so that
*                      will remain when player change direction. Hence, if
*                      player turn left, the event will turn right.
*                
*
*            <MOVE EVENT OFFSET: X>
*                  Use this tag if you need to adjust the distance the
*                  player has to walk to get closer to the movable event.
*                  Without the tag, the distance will be defined by the
*                  'move event offset' parameter.
*
*                  This commment tag can also be used on pickup events to
*                  set the distance between the player and the event it is
*                  holding.
Thank you! It's fine now!
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
365
Reaction score
407
First Language
French
Primarily Uses
RMMZ
New update!
TSR_MoveEvent v1.1.2

It add a <prevent throw region: x, x, x> map notetag to mark some region where picked up events cannot land or pass through. This is mostly useful to prevent throwing event on roof top tiles.
 

MasterTenchi

Veteran
Veteran
Joined
Nov 2, 2019
Messages
38
Reaction score
20
First Language
English
Primarily Uses
RMMZ
Is there a way to animate the item pushed? Say, a boulder. So it looks as if it is rolling?
The event doesn't know it's moving, so normal walking doesn't work.
Was just wondering if I am being dense... lol.
 

MasterTenchi

Veteran
Veteran
Joined
Nov 2, 2019
Messages
38
Reaction score
20
First Language
English
Primarily Uses
RMMZ
Got This Going On:

If You grab an event, you can carry it around - but as soon as you drop it or throw it you get this:

TypeError
_0xa259bf[_0x5e1a44(...)] is not a function

Grrr.

More specifically:

rmmz_managers.js:2030 TypeError: _0xa259bf[_0x5e1a44(...)] is not a function
at Function.DataManager.<computed> [as isThrowRegion] (TSR_MoveEvent.js:295)
at Game_Player.<computed>.<computed> [as throwPass] (TSR_MoveEvent.js:295)
at Game_Player.throwPickup (TSR_MoveEvent.js:295)
at Game_Player.<computed>.updatePickup (TSR_MoveEvent.js:295)
at Game_Player.<computed>.<computed> [as moveEvent] (TSR_MoveEvent.js:295)
at Game_Player.<computed> [as update] (TSR_MoveEvent.js:295)
at Scene_Map.updateMain (rmmz_scenes.js:734)
at Scene_Map.<computed> [as updateMain] (VisuMZ_4_Debugger.js:404)
at Scene_Map.updateMainMultiply (rmmz_scenes.js:729)
at Scene_Map.updateMainMultiply (VisuMZ_0_CoreEngine.js:6716)

Moved it to a blank project - works well there. So it may have a problem with some other plugin. I'll research each one and find it and let ya know!
:ysad:


FOUND IT: OcRam_Core. Can't Use ANY of OcRam's plugins with this one... somewhere his CORE and THIS plugin error each other out.

*Sigh* You've encrypted your code section, so I can't help find the reasoning behind it, sorry - I'll have to leave that to you good sir.
 
Last edited:

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
365
Reaction score
407
First Language
French
Primarily Uses
RMMZ
Hello, and thanks for reporting!

Is there a way to animate the item pushed? Say, a boulder. So it looks as if it is rolling?
The event doesn't know it's moving, so normal walking doesn't work.
Was just wondering if I am being dense... lol.
The event actually 'know' it's moving, but the plugin prevent the step animation. In earlier version of the plugin, moving events did have the step animation, but I stopped it so fixed images from tiles sheet could be used as well.
But for rolling boulders, it would be cool, so I'll put the step aniamtion back as an option in the next version.

somewhere his CORE and THIS plugin error each other out.
Because of the way his core plugin handle notetags... But it's an easy fix, just give me a few days before I upload a new version.

Thank you! :cutesmile:
 

MasterTenchi

Veteran
Veteran
Joined
Nov 2, 2019
Messages
38
Reaction score
20
First Language
English
Primarily Uses
RMMZ
The amount of sexiness oozing from you right now is outstanding! :ysrs:

I created an entire multi-level dungeon around puzzles using your outstanding plugin..
Well, until I grabbed an object to chunk... hahahaha! :yswt:
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
365
Reaction score
407
First Language
French
Primarily Uses
RMMZ
Hello!
I've uploaded a new version:


It add a new event comment tag: <movable character> It work the same as <movable event>, but movable characters will play the step animation and turn in the direction they're moving when pushed/pulled.

@MasterTenchi
And it should work with Ocram core plugin, now.


Regards,
TSR :rock-right:
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
365
Reaction score
407
First Language
French
Primarily Uses
RMMZ
Hello, all!

Yet another update: TSR_MoveEvent v1.1.6
  • Add a <prevent throw region: x, x, x> map notetag to assign some regions as impassable for thrown events.

Regards B)
 

athosfranco

Veteran
Veteran
Joined
Apr 30, 2014
Messages
43
Reaction score
5
First Language
Portuguese
Primarily Uses
Really nice plugin. I tested and it works perfectly.
Is there a way to change the player's sprite when he's pushing/pulling/throwing stuff?
I have a character sheet with those poses and i wish to use it with this plugin.
 

ShadowDragon

Realist
Veteran
Joined
Oct 8, 2018
Messages
4,151
Reaction score
1,586
First Language
Dutch
Primarily Uses
RMMV
@athosfranco it's not using any poses at this point or will be though, I know MOG
can let you use poses (character poses), you can try to combine it, but not sure if it will
work in the way you want it. because the pushing/pulling/throwing use a complex code.

creating poses for it would be harder, but it's his call though.
there is also another plugin "Push_NPC" or around it that change your pull/push character
which you can try too, I dont know the exact name of that one though.

but that one is also, try to see if it works.
 

athosfranco

Veteran
Veteran
Joined
Apr 30, 2014
Messages
43
Reaction score
5
First Language
Portuguese
Primarily Uses
@athosfranco it's not using any poses at this point or will be though, I know MOG
can let you use poses (character poses), you can try to combine it, but not sure if it will
work in the way you want it. because the pushing/pulling/throwing use a complex code.

creating poses for it would be harder, but it's his call though.
there is also another plugin "Push_NPC" or around it that change your pull/push character
which you can try too, I dont know the exact name of that one though.

but that one is also, try to see if it works.

Well, maybe some switch could be activated while the player is pushing/pulling, and this switch is connected to a common event that changes the player graphics by the standard 'change image' option on the editor? Im not sure how complex that would be.
 

Latest Threads

Latest Posts

Latest Profile Posts

Me: "I don't to use other engines because I'd have to do a lot of coding."

Also my desktop right now....
mycurrentdesktop.jpg

...I literally spend more time using VS Code than MZ. :kaoswt:
actually, are there any JRPG type games (I guess turn based, so not ARPGs like say, Vagrant Story) where you have only one party member for the majority of the game? (I wonder if I'm forgetting something obvious.)
*sigh* This one turned out really well... except for the left arm pose...
fPRzKSp.jpg

Yes I purposely cutout the arm cause from the pic
A month into making my life/dating sim game and I've finally finished making all of the love interests :kaocry: I still have to make most of their emotion range and overworld sprites but aye I'm proud of myself.
would i get in trouble if i didn't take out the computer icons on my fake computer screen i had Discord, Messanger, and rpg maker up

Forum statistics

Threads
113,795
Messages
1,077,551
Members
147,845
Latest member
kopprochn
Top