Swap Screen Focus between Player and Event?

pkdarmstrong

Villager
Member
Joined
Feb 19, 2015
Messages
27
Reaction score
1
First Language
English
I'm looking to control two players (the player and a separate event), and when the two of them separate across the map, the camera will focus on the player, leaving the event to wander blind. I'm looking to figure out an event where I can press a key (in this case, Q) and it will focus on the player or the event indefinitely until it is pressed again, swapping between the player and event.

I'm currently using these commands:

  • (Input.isTriggered('q')) (IF the player triggers the Q key.)
  • $gamePlayer.center($gamePlayer.x, $gamePlayer.y) (Centers the screen on the player.)
  • $gamePlayer.center($gameMap.event(2).x, $gameMap.event(2).y) (Centers the screen on Event ID 2, which in this case is the other event that is under the player's control).
What would be a proper event (even better if applicable to a common event) that would let me:

  1. Be able to toggle between the screen focus of the player and the event using a single key?
  2. Be able to keep the focus on the player or event until toggled again?
As always, thank you for taking the time to read this post and potentially provide a solution!  :)
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,696
Reaction score
935
First Language
English
Primarily Uses
N/A
Well, since you're just going between the player and one other event, you should be able to just use two switches. One switch will be the control, meaning that if the switch is OFF, you can't toggle between the player and the event. The other switch would be an indicator of what the camera is currently following, the player or the event. Then you just need to have a common event check if the control switch is on and the player presses the Q key. If both conditions are true, check the indicator switch to find out what you're currently centered on, and then center on the other one and toggle the switch.
 

pkdarmstrong

Villager
Member
Joined
Feb 19, 2015
Messages
27
Reaction score
1
First Language
English
Well, since you're just going between the player and one other event, you should be able to just use two switches. One switch will be the control, meaning that if the switch is OFF, you can't toggle between the player and the event. The other switch would be an indicator of what the camera is currently following, the player or the event. Then you just need to have a common event check if the control switch is on and the player presses the Q key. If both conditions are true, check the indicator switch to find out what you're currently centered on, and then center on the other one and toggle the switch.
So this may just be a constraint of the $gamePlayer.center($gameMap.event(2).x, $gameMap.event(2).y)  command, but when I trigger the switch to focus it on to Event ID 2, it will focus to the event for a moment, but then return to the control of the player when the player decides to leave the screen OR if the event moves outside the focused screen @ the time of the script call.
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,696
Reaction score
935
First Language
English
Primarily Uses
N/A
So this may just be a constraint of the $gamePlayer.center($gameMap.event(2).x, $gameMap.event(2).y)  command, but when I trigger the switch to focus it on to Event ID 2, it will focus to the event for a moment, but then return to the control of the player when the player decides to leave the screen OR if the event moves outside the focused screen @ the time of the script call.
If that's the case, consider using a camera control plugin. I know for a fact Galv just released his for MV.
 

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,547
Members
137,835
Latest member
yetisteven
Top