Saireau

Veteran
Veteran
Joined
Dec 19, 2019
Messages
108
Reaction score
60
First Language
German
Primarily Uses
RMMV
Hello,

I would like to request a plugin that allows me to easily focus the camera on a specific event and follow it around. So, all that's needed are two plugin commands: 'Focus on Event' which takes an event ID and 'Reset Focus' which focusses the player again.

Camera pans and cutscenes are very annoying with just the Scroll Map command. I think many other people would benefit from a simple plugin like this as well.

Please help. :)
 

Saireau

Veteran
Veteran
Joined
Dec 19, 2019
Messages
108
Reaction score
60
First Language
German
Primarily Uses
RMMV
That has this smooth camera movement in it which can't be deactivated. But yeah, other than that, it's basically what I would like to have. :)
 

busbuzz

Veteran
Veteran
Joined
Jun 17, 2021
Messages
168
Reaction score
47
First Language
English
Primarily Uses
RMMZ
it does exactly what you're asking for. it can focus on events, specific coordinates and reset to player, and it has moving speed control
 

Saireau

Veteran
Veteran
Joined
Dec 19, 2019
Messages
108
Reaction score
60
First Language
German
Primarily Uses
RMMV
Well, um, yeah! :) But as I said, it has an additional feature I don't want that can't be deactivated. I asked Galv about it, but he has no plans to include the option to turn it off.
 

Saireau

Veteran
Veteran
Joined
Dec 19, 2019
Messages
108
Reaction score
60
First Language
German
Primarily Uses
RMMV
I would like to bump this. I could really use this plugin.
 

Saireau

Veteran
Veteran
Joined
Dec 19, 2019
Messages
108
Reaction score
60
First Language
German
Primarily Uses
RMMV
Do MV plugins work for MZ too?
 

Saireau

Veteran
Veteran
Joined
Dec 19, 2019
Messages
108
Reaction score
60
First Language
German
Primarily Uses
RMMV
If I understand it correctly, I need a subscription to download the plugin. :/ But thanks anyway!
 

JorgeMaker

Veteran
Veteran
Joined
Jan 14, 2020
Messages
57
Reaction score
52
First Language
Português - BR
Primarily Uses
RMMZ
Maybe you can use my plugin:
It makes the camera smoother too and you don't seem to be interested in it, but it's possible to disable this function during gameplay.
(Set the "Slide Coefficient" parameter to 48, btw).
 
Last edited:

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
966
Reaction score
470
First Language
PT-BR
Primarily Uses
RM2k3
I didn't find any free alternative, I know how to do this with Javascript command, but you have to use event in parallel process and the effect doesn't look good:
$gamePlayer.center(X,Y)

Example:
JavaScript:
$gamePlayer.center($gameMap._event[1].x,$gameMap._event[1].y)
 
Last edited:

Saireau

Veteran
Veteran
Joined
Dec 19, 2019
Messages
108
Reaction score
60
First Language
German
Primarily Uses
RMMV
@JorgeMaker: Thanks, man! :) Focussing works perfectly as far as I can tell after testing it for a bit. Is there any chance you might add the option to add scrolling/panning to the event before setting the focus? It's an abrupt change right now, but I guess many people smoothly move the camera to their characters during cutscenes.

@Dev_With_Coffee: I tried your solution too, just to see how it looks. But the script call doesn't do anything for me. :/ Are you sure it works in MZ?
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
966
Reaction score
470
First Language
PT-BR
Primarily Uses
RM2k3
:/ Are you sure it works in MZ?
I'm sorry, I forgot to put an "S" there:
Example:
JavaScript:
$gamePlayer.center($gameMap._event[1].x,$gameMap._event[1].y)
I got confused because I usually use it like this:
$gameMap.event(1).x

Now that's right:
JavaScript:
$gamePlayer.center($gameMap._events[1]._x,$gameMap._events[1]._y)

Edit:
The problem is that the effect will skip 48 pixels at each step of the event, making the movement not look fluid.
So do it like this:
JavaScript:
$gamePlayer.center($gameMap.event(1)._realX,$gameMap.event(1)._realY)
If going to the NPC event itself:
JavaScript:
$gamePlayer.center($gameMap.event(this._eventId)._realX,$gameMap.event(this._eventId)._realY)

Even without putting frames on hold you may notice some jumps on the screen if you try to move the player at the same time.

Once again sorry for the wrong instruction.

Good luck!
 
Last edited:

Saireau

Veteran
Veteran
Joined
Dec 19, 2019
Messages
108
Reaction score
60
First Language
German
Primarily Uses
RMMV
Thanks, Dev_With_Coffee! But it still doesn't work properly.

So, I created a large map and put the player on it, a parallel process (ID: 1) which contains:

Script: $gamePlayer.center($gameMap.events(2)._realX,$gameMap.events(2)._realY);
Wait: 1 frame

… and a randomly moving event to focus the camera on (ID: 2).

'$gameMap.event()' didn't work in the script call, so I figured I'll try it with the plural, 'events'. Which at least did something: It turned the screen black. I suppose the camera jumps to some point outside the map? I also tried altering the event ID to 1, since, you know, sometimes functions start counting at 0. But the same thing happened.

Any ideas? :)
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,984
Reaction score
2,304
First Language
EN
Primarily Uses
RMMZ
:kaohi: This sort of thing works for me in a Script command in a Parallel event:
JavaScript:
$gamePlayer.center($gameMap.event(5)._realX, $gameMap.event(5)._realY);
Note that the camera will remain within the map borders. Maybe try testing on a map set to Scroll Type: Loop Both in its properties?

$gameMap.events() retrieves an array, which is why it bugged out when you tried that: the _realX and _realY properties were undefined. :kaoswt:

It is possible that it is conflicting with one or more plugins you have active. Turn off all your plugins (Plugin Manager -> select all -> right-click -> Turn OFF) and test to see if that helps.

(Wait 1 frame makes no difference at the end of a Parallel/Autorun event: it has to wait until next frame to trigger again anyway.)
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
966
Reaction score
470
First Language
PT-BR
Primarily Uses
RM2k3
… and a randomly moving event to focus the camera on (ID: 2).
I did the test on RMMZ, I had the trial version, but I don't believe that's the problem.

The "S" issue I had already solved, it was just my mistake, so I changed the method, the most correct is to use the "event(ID)" function.

This focusing on a dark place on the map is why you called variables with values larger or smaller than the map size.

I tested it on RMMV and it worked too:
RMMV-Focus_NPC_rz.png

You need to test on a new project, here's how it works:

It is possible that it is conflicting with one or more plugins you have active. Turn off all your plugins (Plugin Manager -> select all -> right-click -> Turn OFF) and test to see if that helps.
It's likely, it's always better to test on an empty project rather than on top of a game in production.
 

Saireau

Veteran
Veteran
Joined
Dec 19, 2019
Messages
108
Reaction score
60
First Language
German
Primarily Uses
RMMV
I've created a new project with the map attached. I got the same result when trying to refer to another event, but your version (with the self-referencing 'this._eventId') indeed works. :) How do I refer to another event if not by simply using the ID as a number?
 

Attachments

  • Map001.zip
    818 bytes · Views: 2

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
966
Reaction score
470
First Language
PT-BR
Primarily Uses
RM2k3
I had already done the test, but as I think it's more important to show the event itself controlling itself.
See screenshot of parallel process handling another event, it's working:
(Deleted Image)

As I'm a little busy today, I'll look at your map later.

Edit:
Hello again @Saireau, I couldn't reproduce the problem you showed, everything looks normal.
You could upload your new project with this map, if possible already distributed for Windows, as it could be something related to another problem.
 
Last edited:

Latest Threads

Latest Profile Posts

Took a long, long time, way longer than it should to be honest...but I've finally finished the big content update to my demo!
Lots of not good things happening IRL but I'm not gonna let this day end like this. Quote time:
"Success is not final, failure is not fatal: it is the courage to continue that counts." -Winston Churchill

So, keep going, lads. Whatever you do keep going. Until next time.

It's a Spanish devlog don't get scared!. (please)
Q:"Why don't you get a job?"
A: Posting statuses IS my job. It just so happens to not pay and happen periodically over the course of three months.

Forum statistics

Threads
117,239
Messages
1,105,796
Members
153,404
Latest member
Control_Studios
Top