Camera Target

This script allows you to set the camera to follow a particular character on the map using script calls. By default, the camera follows the player.



Download

Get it at Hime Works

Installation

Place this script below Materials and above Main

Usage

To set the camera's target, make a script call in an event or a move route

set_camera_target(char_id)If char_id = -1, then it is the playerIf char_id = 0, then it is the current event

if char_id > 0, then it is the specified event
Will be very useful instead of mucking around with map scrolling. Thanks for this!
This I strongly agree with! I've always wanted a script that follows a specified event since map scrolling is a pain when you have to tailor it to an event's movements.
Would it be possible to have the camera simply adjust based on where the player (or in this case, the target) is? For example, Targetting the player, have the camera adjust to view 5 tiles higher. It follows the player but is centered 5 tiles higher than the player.

It would allow me to make a dodging mini-game in which the player must dodge say, boulders falling from the north of the map, so they can see further ahead.
hmmm trick it by making blank event 5 tiles above. then... make him move the same as player. (hint: paralel process, if input up move event up, etc)
I thought of that as a potential workaround, but it's too unreliable. Plus, I'm using a pixel movement script.
Would it be possible to have the camera simply adjust based on where the player (or in this case, the target) is? For example, Targetting the player, have the camera adjust to view 5 tiles higher. It follows the player but is centered 5 tiles higher than the player.

It would allow me to make a dodging mini-game in which the player must dodge say, boulders falling from the north of the map, so they can see further ahead.
Yes.. a parameter to "offset" the camera by an x,y coordinate relative to the targeted event.
No, I will not be adding such a feature. This camera only targets characters, not tiles. The code required is too different.
Ah, that's unfortunate. If someone or you were to make such a script, do you think it would conflict with this one?
It shouldn't, since this script does not actually do anything to the camera's position. All it does is change who to follow.
So you couldn't offset these x,y's in $game_system.camera_target.center(char.x, char.y) ? Like say you want it 2 tiles higher you would just subtract 2*32 from the Y coord here? (Assuming this is working in pixels)..?

I dunno.. just thinking out loud.

Original thread: https://forums.rpgmakerweb.com/threads/camera-target.11774/