Camera Core – MV Plugin

      13 Comments on Camera Core – MV Plugin

This plugin allows developers to preform various camera motions including focusing and zooming.


Look at the code or download the Plugin:


Camera Core
SumRndmDde

This plugin allows developers to preform various camera motions including
focusing and zooming.

=======================================================================
Camera Focusing
=======================================================================

If you wish for the camera to focus on something, use the following
Plugin Commands:

FocusCamera [x] [y] [duration]

Insert an X and Y coordinate on the map to have the camera focus on it.
The duration determines how many frames it takes the camera to transition.

FocusCamera event [id] [duration]

Replace “id” with an Event’s ID on the current map to have the camera focus
on that specific event. The duration determines how many frames it takes the
camera to transition.

FocusCamera follower [id] [duration]

Replace “id” with a Follower’s index in the current party to have the camera
focus on that specific follower. The duration determines how many frames it
takes the camera to transition.

FocusCamera player [duration]

Focues the camera onto the player.
The duration determines how many frames it takes the camera to transition.

ResetFocus [duration]

Resets the focus on the camera back to the player.
The duration determines how many frames it takes the camera to transition.

=======================================================================
Zooming
=======================================================================

In order to zoom the camera in and out, use the following commands:

ZoomIn [scale] [duration]

Set “scale” to the scale you wish the camera to zoom in.
Setting scale to 1 would be the normal scale, greater than 1 would zoom in.
The duration determines how many frames it takes the camera to transition.

ZoomOut [scale] [duration]

Set “scale” to the scale you wish the camera to zoom in.
Setting scale to 1 would be the normal scale, greater than 1 would zoom out.
The duration determines how many frames it takes the camera to transition.

ResetZoom [duration]

Resets the zoom back to its default.
The duration determines how many frames it takes the camera to transition.

=======================================================================
Camera Shifting
=======================================================================

If you wish to shift the camera, use the following Plugin Command:

ShiftCamera [x-shift] [y-shift] [duration]

This shifts the camera a certain x and/or y blocks.
This does NOT change the camera’s focus. If the camera’s focused on the
player, for example, and the camera is shifted upward 2 squares, the camera
will continue to follow the player, only it will be shifted up two squares.

=======================================================================
Camera Waiting
=======================================================================

If you wish to have an event “wait” before a camera is done moving, use the
following Plugin Commands:

WaitForCamera

This will stop the event processing until the camera has completed its focus
and zooming.

WaitForCameraFocus

This will wait for the camera to complete its movement to a new focus.

WaitForCameraZoom

This will wait for the camera to finish its zoom motion.


Screenshot:

13 thoughts on “Camera Core – MV Plugin

  1. Chris

    Is there a way to make this work as soon as the game loads? I want to have the camera zoomed permanently, but so far, this only seems to work if I step on an event – and, unfortunately, it won’t allow me to create an event on the same square that my character starts on.

    Thanks!

    Reply
    1. LUKElcs

      I would try using parallel events.
      When an events trigger is set to parallel, it loops continously, kind of like autorun, however, other events can run on-top
      of it, and the player can still move around. Once the zoom effect is applied, you can just switch it off with self switch.

      Reply
  2. kwingo

    I’ve tried using this to that when I exit a room for example, it then is meant to focus on an enemy and move along with him, however, I am getting reference [eventID] not defined? Any ideas?

    Reply
    1. CSEmber

      Your player will already be on the other map if you’ve already done the transfer. Try setting your player character to transparent so they *appear* to have left but the player is still viewing the map they just exited.

      Reply
  3. Kevin Frost

    Great stuff here, as usual! I do have one question though. Is it possible to lock the camera to the mouse cursor?
    The project I’m working on is based heavily on UI interaction with the mouse, and I need to be able to pan around a map a bit. If possible to be able to move the camera with mouse movement if it’s x amount of pixels away from the center of the screen (the further from the center the faster the camera scrolls) that would be awesome!

    Reply
  4. some_nerd_idk

    this plugin is great but im having problems,im using Yanfly CoreEngine and im trying to zoom out in one scene but black line appear around where the camera was,and the thing is i saw there was the option to fix the black line especifically because of the yanfly core but i put it to true and it still didnt work,would really apreciate if i could get some help.

    Reply
  5. Stompai

    It’s a pretty good plugin, along with the smooth camera one.
    A shame that it doesn’t work with parallaxes mapping :'(

    Reply
  6. Pingback: 10 dicas de desenvolvimento no RPG Maker MV - Memória BIT

  7. Name Name

    i keep getting a javascript error like “Octal literals are not allowed in strict mode.” whenever i try to activate an event thats supposed to zoom in on another event. not only that, but when the camera does work it only ever seems to want to zoom in on the center of the screen regardless of what i say…anybody got any ideas? i guess i can make my game work without being able to move the camera wherever but it sort of defeats the point of the plugin -_-

    Reply
    1. Digashi Steelhead

      Octal literals means something is in octal form. aka, an Id or an x value is 002 instead of 2. This confuses javascript, bc of how octals work which is a bit complicated. Just make sure there is no leading zeros, and it should work.

      Reply
  8. justsomeguy

    I am also getting thin black lines when zooming in during battles.

    Enabling the option to fix this causes my game to crash on startup with the error: cannot read property “x” of undefined.

    Got excited when I saw this option as this think black line has been bugging me.. only to be met with a crash 🙁

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *