Camera Target

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
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
 
Last edited by a moderator:

Quigon

electric boogaloo
Veteran
Joined
Mar 17, 2012
Messages
1,982
Reaction score
954
First Language
English
Primarily Uses
N/A
Will be very useful instead of mucking around with map scrolling. Thanks for this!
 

amerk

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,433
Reaction score
495
First Language
English
Primarily Uses
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.
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
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.
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,309
Reaction score
531
First Language
indonesian
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)
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
I thought of that as a potential workaround, but it's too unreliable. Plus, I'm using a pixel movement script.
 

light487

Parrot Keeper
Veteran
Joined
Mar 26, 2013
Messages
852
Reaction score
26
First Language
English
Primarily Uses
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.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
No, I will not be adding such a feature. This camera only targets characters, not tiles. The code required is too different.
 
Last edited by a moderator:

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
Ah, that's unfortunate. If someone or you were to make such a script, do you think it would conflict with this one?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
It shouldn't, since this script does not actually do anything to the camera's position. All it does is change who to follow.
 

light487

Parrot Keeper
Veteran
Joined
Mar 26, 2013
Messages
852
Reaction score
26
First Language
English
Primarily Uses
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.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top