The RPG Maker Resource Kit

RMRK RPG Maker Creation => XP => XP Event Systems => Topic started by: Punk on November 06, 2007, 10:55:05 PM

Title: [XP] Camera Pan 3
Post by: Punk on November 06, 2007, 10:55:05 PM
Camera Pan Control System
Version: 3


Introduction
The Camera Pan System allows you, the player, or creator to scroll through your map with the press of a button and arrow keys.

Features
Screenshots
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg360.imageshack.us%2Fimg360%2F3382%2Fcpcs1ve3.png&hash=7d31e4a7fbc1a2a63b4d33d958141a35c1056c43)
Standing there...

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg379.imageshack.us%2Fimg379%2F7882%2Fcpcs2kt0.png&hash=836844f0b8746636f8afd61d92ea3224eb6d4061)
Moving the camera around.

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg379.imageshack.us%2Fimg379%2F332%2Fcpcs3kh3.png&hash=a30ddc01efd5477cbec0fcf3d0f80d86a214ed5c)
Camera returning to me. (Although you may not see that happening since the picture's not in motion of course, that's what is happening.)

Demo
It's a bit complex so I'll have it up for download. Read the bulletin for more details on how to use this system in the demo.
Left click! Demo here. (http://rpgm.us/download.php?file=416Camera%20Pan%20Control%20System%203%20-%20Punkid89.zip)
System
[spoiler=Requires]
6 Common Events
2 Switches
3 Variables
[/spoiler]
[spoiler=The Variables]
1: Player Screen X (Keeping track of Player Screen X coordinate.)
2: Player Screen Y (Keeping track of Player Screen Y coordinate.)
3: Hold or Toggle (It's better than using some switch to do this imo.)
[/spoiler]
[spoiler=The Switches]
1: Camera Pan Control System (The trigger switch for all common events of this event system)
2: Camera Panning (Meant for camera pan.)
[/spoiler]
[spoiler=Coordinates]
This common event keeps track of the player's screen coordinates.
Trigger: Parallel
Switch: Camera Pan Control System
---------------------------------------------------------------

@>Control Variables: [Player Screen X] = Player's Screen X
@>Control Variables: [Player Screen Y] = Player's Screen Y
[/spoiler]
[spoiler=Activate Camera Pan]
Trigger: Parallel
Switch: Same as above.
------------------------------------------------------

@>Conditional Branch: Variable: [Hold or Toggle] == 0
@@>Conditional Branch: Script: Input.press?(Input::L)
@@@>Control Switches: [Camera Panning] = ON
@@>Else
@@@>Control Switches: [Camera Panning] = OFF
@@>Branch End
@>Branch End
@>Conditional Branch: Variable: [Hold or Toggle] == 1
@@>Conditional Branch: Script: Input.trigger?(Input::L)
@@@>Conditional Branch: Switch: [Camera Panning] == ON
@@@@>Control Switches: [Camera Panning] = OFF
@@@>Else
@@@@>Conditional Branch: Switch: [Camera Panning] == OFF
@@@@@>Control Switches: [Camera Panning] = ON
@@@@>Branch End
@@@>Branch End
@@>Branch End
@>Branch End
[/spoiler]
[spoiler=Stop Player Movement]
Trigger and switch: Same as above.

@>Conditional Branch: Switch: [Camera Panning] == ON
@@>Set Move Route: Player: Wait 1 Frames
@>Else
@>Branch End
[/spoiler]
[spoiler=Camera Pan]
Trigger and switch, same as above

@>Conditional Branch: Switch [Camera Panning] == ON
@@>Conditional Branch: Script: Input.press?(Input::LEFT)
@@@> Scroll Map: Direction Left, Space 1, Speed 5
@@>Branch End
@@>Conditional Branch: Script: Input.press?(Input::RIGHT)
@@@> Scroll Map: Direction Right, Space 1, Speed 5
@@>Branch End
@@>Conditional Branch: Script: Input.press?(Input::UP)
@@@> Scroll Map: Direction Up, Space 1, Speed 5
@@>Branch End
@@>Conditional Branch: Script: Input.press?(Input::DOWN)
@@@> Scroll Map: Direction Down, Space 1, Speed 5
@@>Branch End
@>Branch End
@>Conditional Branch: Switch: [Camera Panning] == OFF
@@>Conditional Branch: Variable: [Player Screen X] <= 300
@@@>Scroll Map: Direction Left, Space 1, Speed 6
@@>Else
@@@>Conditional Branch: Variable: [Player Screen X] >= 340
@@@@>Scroll Map: Direction Right, Space 1, Speed 6
@@@>Else
@@@@>Conditional Branch: Variable: [Player Screen Y] <= 220
@@@@@>Scroll Map: Direction Up, Space 1, Speed 6
@@@@>Else
@@@@@>Conditional Branch: Variable: [Player Screen Y] >= 260
@@@@@@>Scroll Map: Direction Down, Space 1, Speed 6
@@@@@>Branch End
@@@@>Branch End
@@@>Branch End
@@>Branch End
@>Branch End
[/spoiler]
[spoiler=Limit Camera Pan (This is just an add-on. Optional to include.)]
A feature members have requested for a long time. Check it out!

@>Conditional Branch: Switch: [Camera Panning] == ON
@@>Conditional Branch: Variable: [Player Screen X] <= 0
@@@>Scroll Map: Left, 1, 6
@@>Branch End
@@>Conditional Branch: Variable: [Player Screen X] >= 800
@@@>Scroll Map: Right, 1, 6
@@>Branch End
@@>Conditional Branch: Variable: [Player Screen Y] <= 0
@@@>Scroll Map: Up, 1, 6
@@>Branch End
@@>Conditional Branch: Variable: [Player Screen Y] >= 600
@@@>Scroll Map: Down, 1, 6
@@>Branch End
@>Branch End
[/spoiler]
[spoiler=Pictures (Optional but recommended.)]

@>Conditional Branch: Switch: [Camera Panning] = ON
@@>Show Picture: 'arrows.png' Upper Left, (0,0)
@>Else
@@>Erase Picture
@>Branch End
[/spoiler]

Instructions
Download this image below!
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg357.imageshack.us%2Fimg357%2F2554%2Farrowsgu5.png&hash=d59110518e0a91f4390ad1fd37edaa5daec74953)

FAQ
If you are looking for support for this event system then ask away in this thread or find me in a place where I can give better support.

Credits and Thanks
Twilight, Q-Man, Zero, Dorito, and ParkAvenger for putting their thoughts into this.

Terms and Conditions
Just credit Punk.
Title: Re: Camera Pan 3
Post by: bulls84 on November 07, 2007, 12:19:37 AM
This awesome! I was trying to make something like this for my game, and now here it is. Perfect timing. I noticed one glitch though. In the bottom left corner the camera doesn't come back down once you move it up.