This plugin allows to push, pull, pick up and throw events.
Spoiler: Instructions
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
Hello there, Northen Frog!
I loved this plugin and I'll probably use it in my game. Playing around with it a bit I found a few things I wanted to personalize but couldn't find a way to do it within the plugin manager, and unfortunately, I'm a total noob in javascrpt and couldn't make heads or tails of the code, so I thought I'd come to the expert who actually made the plugin and ask!
First is the delay before pushing or pulling, I couldn’t find a way to control how long it takes.
Second is when picking up any object the player character moves forward to the spot of the thing they picked up, and I couldn’t make the pickup be a stationary action.
Then is when picking up something that has the priority bellow or above the character, the picked object changes to same as character and stays on this priority after being put back down.
The last one is when trying to drop a picked item to an occupied or blocked space front of the player character, the dropped item jumps to the opposite direction, behind the player (or one of the sides if that is also blocked). Do you think I'd be possible to change this so that the dropped object lands on the same space the player is standing? I tested a bit and when there is no available place to drop it at all, that is what happens. Ideally If the forward option is blocked I’d like for this to be the immediate solution, not the last resort.
Anyway, I was wondering if I missed something, or if you could instruct, or help me with these changes, if they are at all possible.
Have a great day!