Camera locking

In Archeia's list on top of this forum I found a scriptcall to lock the camera on either the player or an event. The thread is no longer open for replies so I figured this would be the best place to ask (correct me if I'm wrong).

It's this little piece of code: $game_player.center($game_player.x, $game_player.y)

Which I get to work fine with a litteral copy, but now I want to set it to follow an event. I've tried map_event[x] (where x is ofcourse the eventnumber on the map). But I think I have the wording off for ruby. Could anyone shine a light on it for me please.

Kind regards.
To check event coordinate, It's $game_map.events[id].x, $game_map.events[id].y
... CMIIW, I'm not sure myself
Awesome that works! Thanks.

Any idea how to make it scroll along with that event when moving as well? I want to lock the player on his spot by closing a spike square around him and make the event move by player movement so scroll map may be an option, but maybe a script gives a better visual effect.
I believe the script only target coordinate. Not target the character. Even if you keep updating the command, it will only scroll for each time the character move a tile.
Thanks for your replies.

For future reference. I've tried to refresh the command, but it jumps instead of scrolls and gives a nasty visual effect.
Best way to solve it (as far as I found) is by doing it as I said, make event move by player movement so you can add a scroll map command.
Or have a parallel process keep track of the event x and y on the map and scroll accordingly.

This topic may be closed I think
You could try $game_player.center($game_map.events[id].x, $game_map.events[id].y) in a parallel process event that has a Wait 2 Frames before or after the command. I don't know if it'll still jump - looks to use the grid, so it might do.

To have a topic closed, you need to report your first post and let the mods know it's resolved.
Thanks Shaz. I will try that 👍
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/camera-locking.112055/