Lock Screen Scrolling By Axis

Hello!

I'm in need of either an add-on to Galv's Cam Control or a compatible snippet that allows me to independently lock screen scrolling per axis. For example: a designated game switch or a script call that keeps the screen locked on the current x coordinate, regardless if the player changes his x value, yet preserves scrolling of the screen on the y axis as the player changes his y value. And vise versa for the axes.

Thank you!
why dont you lock the camera to an event, you could control the movement of the event to left or right depending on char position.
Atleast in theory this sounds good.
That's actually proved trickier in practice, especially since I can't always have the camera centered on the separate event. I have to have a region where the camera changes who it's following and it's very hard to get that to look inconspicuous.
Than keep the focus of that camera always on that Event.
You could later on activate an Event that Moves the Camera Event alongside with the player if needed or changes to other behaviors.
Its all about conditions and set move routes. If we know all details we can maybe help with a evented workaround?

The problem with moving the Event Synchron with the player is that its not obvious that paralell events dont reexecute every frame,
therfor we need a loop to achieve that. Normaly used for button input, or for movement update stuff like you want to do.
Pseudocode for focusing camera Event on player and moving it with it:
Paralell Eventpage:
Code for teleporting this event to the player (control variables for player and teleport event acordingly)
Loop
Control Variables 1 and 2 to player X and Y and minus em Camera X and Y (map coordinates)
conditional branch
var1 = -1 or less
Camera Move left
var1 = 1 or more
Camera Move right
var2 = -1 less
Camera Move up
var2 = 1 or more
Camera Move down (no wait for completion, and the camera event needs to be on "through" on the eventpage settings)
Wait 1 Frame
repeat above.

This camera follows the player to everywhere in the same speed as the player. if the player can use the dash button than we need to change the code like this. (make sure you allready set the highest frequency and the according speed to the camera event)
It should make no big difference if another event moves the camera event, or if the camera event itself is on paralell and moving around (atleast in theory)
Spoiler: Pseudo Eventcode
Loop
Control Variables 1 and 2 to player X and Y and minus em Camera X and Y (map coordinates)

Conditional Branch Dash button pressed?
if yes
-conditional branch switch1 is Off
-if yes
--turn switch1 on (this makes the speed only change one time, which prevents stuff)
--set move route change camera event speed (mark wait for completion, atleast in theory else the below moveroute could overwrite this --command)
-if no
--do nothing
if no
Conditional Branch Switch1 is On?
if yes
- Turn OFF Switch1
- Change Camera Speed back to normal


conditional branch
var1 = -1 or less
Camera Move left
var1 = 1 or more
Camera Move right
var2 = -1 or less
Camera Move up
var2 = 1 or more
Camera Move down (no wait for completion, and the camera event needs to be on "through" on the eventpage settings)
Wait 1 Frame
repeat above.

Edit: If you have 8dir Movement in your Game it would be possible to even work around that in this case if needed.
Edit2: Even if somehow through a miracle the player is able to outrun camera, the camera will follow until its back ontop of the player.
Edit3: If this dont help please explain more detailed.
Okay, so this works great in theory. What I currently need is when the player is in the top right area of the map, the camera stops scrolling along the x axis (to hide a part of the map from view). So, I followed your guide and then added a conditional branch to check if the player is within the designated area, and if so, skip the left/right movement of the Camera Event. It all works as intended, but the trouble is that there IS slight lag, and especially if the player is walking for several seconds at a time, the tiny delay from each step adds up and the camera gets quite behind. You were right about it catching up; it always does, but it's very visually noticeable. Also, the dash checking is not very effective, and has a hard time keeping up if the player rapidly dashes and stops.
This is an impressive eventing job; but overall it is less effective and more work than if screen scrolling could just be disable with a switch. Hopefully I can eventually tinker with the code enough to figure out how to do that, or someone will eventually make a snippet for me.
Thank you for your help though! It was a clever solution.
I wonder if the script 'Enhanced Camera Movement' might help. You'll have to search for it as I'm on my phone so can't do links.
-Did you make sure to implement the LOOP Eventcommand in that Paralell Eventpage?
-Maybe deleting the the wait inside set move route change speed command.

I just ask because i had a testbuild with self evented visual equipment in vx-ace, and i had 4 events ontop of the player moving synchron with him.
And it realy worked well. I sadly dont have that testbuild anymore.

Can you make Picture of your Eventpage and show it to us?
Maybe its a simple Error that can be fixed.
@Kes, I don't think Source's Enhanced Camera script offers this function either, though it does seem like a better camera script that the one I'm using. D:

@Bex, Actually, anytime I put a loop within a parallel process event, the game freezes.
Wrong:
Loop
code
repeat above
= Game Crash because of an endless loop.

Correct:
Loop
code
1frame wait
repeat above
= No Game crash, and fastest possible update rate achieved.

Problem:
Without the Loop the paralell event isnt updated often enough and thats why the movement probably bugs around in your case.
@Bex
Actually, you don't need a loop at all in any parallel process events, they are already looping.
@Bex
Actually, you don't need a loop at all in any parallel process events, they are already looping.
Yes and No, i explained it above.
Without the loop, you can get rid of the wait command too, and it will be the same update speed (which is 1 per frame, and I see no point of updating it faster).

This is how the code works for the 2 versions:

You made an endless loop which normally doesn't update the scene at all, which would freeze the game indeed, but you called a wait command, which will update the game constantly (that is what the wait command does), since the event runs constantly.
So, you created a problem, and kinda solved it in the same event.

On the other hand, doing it without the loop command will let the game update itself normally, while still updating the event constantly too.

While both methods work and produce the same outcome, doing any unnecessary things is just, well, unnecessary, such as the loop and wait command you used.
Here is the problem, you are asuming that a paralel eventpage updates every frame, that was true in rmVX but isnt true in rmVX-Ace.
We made builds to Test this, so i know for sure, if you like i can share the info on how to make experiment to proof and expierience it visibly.
I actually know that bug you mentioned now.
That bug was found and fixed by Source a very long time ago.
https://forums.rpgmakerweb.com/index.php?threads/parallel-process-events-execution-bug-fix.36786/
Install that fix (everyone using Ace should install it, really), and viola, no more update bug.

You are right, I assumed that everyone using Ace know about this bug and the bugfix posted by Source.
Honestly, this update fix snippet should have been pinned somewhere, or linked in a pinned topic with bugfixes already. No wonder that some people never heard about it.
This is a Bug? I thought its a Feature. In the past i read it updates around every 4Frames to Safe performance because normaly events dont need update every frame, and it could be worked around with the loop command.

I will read the Link further, thanks for Linking.

Edit:
I will take a closer look at all the Bugfixes again, maybe i missed some.
But interesting to read that its actualy a Bug and not an Engine change like i got told in the past. Thanks for sharing.
I guess I hadn't put the wait command inside the loop, because that definitely fixed the freeze. But it didn't make any noticeable difference with the lag. I've doublechecked the event coding and everything is as you instructed it; the system does work as intended, just with a slight delay that may have something to do with my hardware or who knows what.

Original thread: https://forums.rpgmakerweb.com/threads/lock-screen-scrolling-by-axis.86731/