%Q(
╔════╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═════╗
║ ╔══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╩═══╗ ║
╠─╣ Enhanced Camera ╠─╣
╠─╣ by RPG Maker Source. ╠─╣
╠─╣ www.rpgmakersource.com ╠─╣
║ ╚══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╦═══╝ ║
╠════╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═╤═╩═════╣
║ ┌────┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴─────┐ ║
╠─┤ Version 1.0.2 07/03/15 DD/MM/YY ├─╣
║ └────┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬─────┘ ║
╠══════╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══╧═══════╣
║ ║
║ This work is protected by the following license: ║
║ ╔══════════════════════════════════════════════════════════════════╗ ║
║ │ │ ║
║ │ Copyright © 2014 Maker Systems. │ ║
║ │ │ ║
║ │ This software is provided 'as-is', without any kind of │ ║
║ │ warranty. Under no circumstances will the author be held │ ║
║ │ liable for any damages arising from the use of this software. │ ║
║ │ │ ║
║ │ Permission is granted to anyone to use this software on their │ ║
║ │ free or commercial games made with a legal copy of RPG Maker │ ║
║ │ VX Ace, as long as Maker Systems - RPG Maker Source is │ ║
║ │ credited within the game. │ ║
║ │ │ ║
║ │ Selling this code or any portions of it 'as-is' or as part of │ ║
║ │ another code, is not allowed. │ ║
║ │ │ ║
║ │ The original header, which includes this copyright notice, │ ║
║ │ must not be edited or removed from any verbatim copy of the │ ║
║ │ sotware nor from any edited version. │ ║
║ │ │ ║
║ ╚══════════════════════════════════════════════════════════════════╝ ║
║ ║
║ ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ 1. VERSION HISTORY. ▼ ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ ║
║ • Version 1.0.0, 08/12/14 - (DD/MM/YY). ║
║ ║
║ • Version 1.0.1, 13/12/14 - (DD/MM/YY). ║
║ ║
║ • Version 1.0.2, 07/03/15 - (DD/MM/YY). ║
║ - Camera will now behave like default when strength is set to 1. ║
║ ║
╠══════════════════════════════════════════════════════════════════════════════╣
╠══════════════════════════════════════════════════════════════════════════════╣
║ 2. USER MANUAL. ▼ ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ ║
║ ┌──────────────────────────────────────────────────────────────────────────┐ ║
║ │ ■ Introduction. │ ║
║ └┬┬┬┬──────────────────────────────────────────────────────────────────┬┬┬┬┘ ║
║ ║
║ Hello there! This script is "plug and play", you can simply insert it into ║
║ your project and it will perform flawlessly. ║
║ ║
║ This script greatly improves the appearence of your games. Once you see it ║
║ in action, you will love it. ║
║ ║
║ It makes the camera smoothly follow the player with a nice deceleration ║
║ effect, and provides new functions that makes it more versatile. ║
║ ║
║ Although it will work as soon as you insert it, we included some ║
║ instructions in the next section for you to take advantage of some of the ║
║ new features provided and to create awesome scenes and mechanics. ║
║ ║
║ We hope you enjoy it. ║
║ ║
║ Thanks for choosing our products. ║
║ ║
║ ┌──────────────────────────────────────────────────────────────────────────┐ ║
║ │ ■ Configuration. │ ║
║ └┬┬┬┬──────────────────────────────────────────────────────────────────┬┬┬┬┘ ║
║ ║
║ "How do I change the strength of the deceleration effect?" ║
║ Right click anywhere in the script editor and select "Find" (or CTRL + F) ║
║ search for "DECELERATION_VALUE" (without quotation marks). ║
║ ║
║ You will see something like "DECELERATION_VALUE = 22" ║
║ ║
║ Set the number after the equality sign to any numer you like, bigger or ║
║ equal than 1. The bigger the number, the stronger the deceleration effect ║
║ and thus the slower the camera movement when following the player. Small ║
║ numbers result in a faster deceleration, default value is 22. ║
║ ║
║ ┌──────────────────────────────────────────────────────────────────────────┐ ║
║ │ ■ Feature Documentation. │ ║
║ └┬┬┬┬──────────────────────────────────────────────────────────────────┬┬┬┬┘ ║
║ ║
║ There are several commands that you can use inside a Script Call (Event ║
║ Command) to create awesome scenes and mechanics. Although they are easy to ║
║ use and understand, it is useful to have a reference to check in case you ║
║ forget something about them. ║
║ ║
║ The script commands that you can use inside a Script Call (Event Command) ║
║ are displayed inside the following chart, followed by their description ║
║ and, if needed, usage details and examples. ║
║ ║
║ ┌───────────────────────────────┐ ║
║ │ ms_pro_cam_wait_for_scrolling │ ║
║ ├───────────────────────────────┴────────────────────────────────────────┐ ║
║ │ Waits until screen scrolling is completed before executing the next │ ║
║ │ event command. This works for both the event command default scrolling │ ║
║ │ and for the new "scroll to position" (ms_pro_cam_center_at) function │ ║
║ │ of Enhanced Camera. │ ║
║ └────────────────────────────────────────────────────────────────────────┘ ║
║ ┌────────────────────────────────────┐ ║
║ │ ms_pro_cam_center_at(x, y, frames) │ ║
║ ├────────────────────────────────────┴───────────────────────────────────┐ ║
║ │ Smoothly centers the camera at the desired coordinates in the exact │ ║
║ │ desired number of frames. │ ║
║ │ │ ║
║ │ In other words, this command allows you to tell the camera to move to │ ║
║ │ a point, center the view on that point, and do so exactly in the time │ ║
║ │ you desire. │ ║
║ │ │ ║
║ │ The speed of the camera movement is automatically adjusted to arrive │ ║
║ │ at its destination exactly when its time is up. │ ║
║ │ │ ║
║ │ NOTE: Compatible with looped maps. Normally, if the camera is at the │ ║
║ │ upper left corner of the map and you use this command to move it to │ ║
║ │ ther lower right corner, the camera will go through the map center. │ ║
║ │ But when you have horizontal, vertical or both loops in your maps, it │ ║
║ │ will go through the shortest path, which in the case of the above │ ║
║ │ example, is a short movement in the upper left direction (to just │ ║
║ │ cross the map border). When you call ms_pro_cam_center_at, you have to │ ║
║ │ add three "parameters" to it, those parameters are x (target x │ ║
║ │ position) y (target y position) and frames (time that the movement │ ║
║ │ must take) │ ║
║ │ │ ║
║ │ As an example, if you want the camera to center at x44 y44 and to do │ ║
║ │ so in 6 seconds (360 frames at normal 60FPS rate), you should use: │ ║
║ │ │ ║
║ │ ms_pro_cam_center_at(44, 44, 360) │ ║
║ └────────────────────────────────────────────────────────────────────────┘ ║
║ ┌───────────────────────────────────────┐ ║
║ │ ms_pro_cam_center_at_char(id, frames) │ ║
║ ├───────────────────────────────────────┴────────────────────────────────┐ ║
║ │ Similar as ms_pro_cam_center_at but instead of using an X and Y value, │ ║
║ │ uses an id of the character whose position is the target. │ ║
║ │ │ ║
║ │ (*) What is "id"? │ ║
║ │ id is a number representing the character, -1 is for player, 0 for the │ ║
║ │ calling event and 1 and up for event id. │ ║
║ └────────────────────────────────────────────────────────────────────────┘ ║
║ ┌──────────────────────────────────────────┐ ║
║ │ ms_pro_cam_focus_on(id, can_cancel, key) │ ║
║ ├──────────────────────────────────────────┴─────────────────────────────┐ ║
║ │ Tells the camera to follow the desired character as if it would │ ║
║ │ normally do for the player. In other words, tells the system to stop │ ║
║ │ following the player and start following the desired character │ ║
║ │ (determined by the parameter "id") │ ║
║ │ │ ║
║ │ (*) What is "id"? │ ║
║ │ id is a number representing the character, -1 is for player, 0 for the │ ║
║ │ calling event and 1 and up for event id. │ ║
║ │ │ ║
║ │ As an example, if you want to focus the camera on an event and its ID │ ║
║ │ is 22, use: ms_pro_cam_focus_on(22) │ ║
║ │ │ ║
║ │ And if you later want to center it back to the player: │ ║
║ │ ms_pro_cam_focus_on(-1) │ ║
║ │ │ ║
║ │ (*) What is "can_cancel"? │ ║
║ │ can_cancel is either true or false and it is not necessary to include │ ║
║ │ it in the command call unless you want the player to be able to focus │ ║
║ │ the camera back on the playing character by pressing a key. Default is │ ║
║ │ false. │ ║
║ │ │ ║
║ │ (*) What is "key"? │ ║
║ │ key is the symbol that represents the aforementioned key. It is not │ ║
║ │ necessary to include it. Check RPG Maker Ace's help file for all the │ ║
║ │ Input keys supported by the program. Keep in mind that if you use a │ ║
║ │ custom or expanded input module (script) you can use more keys. │ ║
║ │ Default is :CTRL (CONTROL) key (always put a double colon before the │ ║
║ │ name of the key). │ ║
║ │ │ ║
║ │ This are the keys supported by default in Ace: │ ║
║ │ │ ║
║ │ :DOWN :LEFT :RIGHT :UP (Arrow Keys) │ ║
║ │ :A :B :C :X :Y :Z :L :R (These do no represent keyboard letters) │ ║
║ │ :SHIFT :CTRL :ALT │ ║
║ │ :F5 :F6 :F7 :F8 :F9 │ ║
║ └────────────────────────────────────────────────────────────────────────┘ ║
║ ┌─────────────────────────────────────┐ ║
║ │ ms_pro_cam_character_on_screen?(id) │ ║
║ ├─────────────────────────────────────┴──────────────────────────────────┐ ║
║ │ Checks if character is visible on screen. │ ║
║ │ │ ║
║ │ This one is a slightly different than the others, since it will return │ ║
║ │ either true or false, you could use it in an Event Conditional Branch │ ║
║ │ Command, fourth tab, last option (Script). You simply insert the │ ║
║ │ command with the desired id that represents the character to check, │ ║
║ │ and it will act as a normal conditional branch. │ ║
║ │ │ ║
║ │ Why would you want to use something like that? Imagine the player has │ ║
║ │ to chase a thief down the street, you could center the camera at the │ ║
║ │ running thief and tell the player to chase it closely or otherwise the │ ║
║ │ thief will run away. You can use this command to check if the player │ ║
║ │ is "keeping up", if the player is not visible on screen, the thief │ ║
║ │ escaped. │ ║
║ │ │ ║
║ │ This is just one example, you can use it for any mechanic that you can │ ║
║ │ think of. │ ║
║ │ │ ║
║ │ The "id" parameter works exactly like described above. │ ║
║ └────────────────────────────────────────────────────────────────────────┘ ║
║ ┌──────────────────────┐ ║
║ │ ms_pro_cam_reset_str │ ║
║ ├──────────────────────┴─────────────────────────────────────────────────┐ ║
║ │ Sets the deceleration strength to the number defined in │ ║
║ │ DECELERATION_VALUE. │ ║
║ │ │ ║
║ │ You can use this command to set back the deceleration strength to its │ ║
║ │ default value. This affects only the "following" feature of the │ ║
║ │ camera, like normal player focus/following and event focus/following. │ ║
║ └────────────────────────────────────────────────────────────────────────┘ ║
║ ┌───────────────────────┐ ║
║ │ ms_pro_cam_str(value) │ ║
║ ├───────────────────────┴────────────────────────────────────────────────┐ ║
║ │ Sets the deceleration strength to the desired value. │ ║
║ │ │ ║
║ │ This command sets the deceleration strength of the focus/following │ ║
║ │ feature of the camera to any number you insert as the "value" │ ║
║ │ parameter. │ ║
║ │ │ ║
║ │ Keep in mind that the lower the number, the faster the camera will │ ║
║ │ focus/follow (1 will result in something similar to RPG Maker Ace's │ ║
║ │ default) and the bigger the number, the stronger the deceleration and │ ║
║ │ thus the slower the speed. │ ║
║ │ │ ║
║ │ You can use ms_pro_cam_reset_str, described above, to reset back the │ ║
║ │ strength to its default setting. │ ║
║ └────────────────────────────────────────────────────────────────────────┘ ║
║ ┌──────────────────────────────────────┐ ║
║ │ ms_pro_cam_ignore_player(true/false) │ ║
║ ├──────────────────────────────────────┴─────────────────────────────────┐ ║
║ │ If set to true, it won't follow the player, but it will scroll as │ ║
║ │ usual when using scroll event commands or when using │ ║
║ │ ms_pro_cam_center_at. │ ║
║ │ If set to false, it will follow the player as usual when neeeded. │ ║
║ │ │ ║
║ │ Why would you want to use it? │ ║
║ │ In case you want to make some camera movement across the map without │ ║
║ │ focusing on any particular character, and you don't want the camera to │ ║
║ │ jump back to the player as soon as the scrolling is finished and the │ ║
║ │ player moves. │ ║
║ │ │ ║
║ │ By having this set to true (and thus "ignoring" the player) the camera │ ║
║ │ can be set still (it can be moving too) to any map location and it │ ║
║ │ won't focus back on the player even if the player is moving. │ ║
║ │ │ ║
║ │ Use true to ignore the player and false to acknowledge it back. │ ║
║ └────────────────────────────────────────────────────────────────────────┘ ║
║ ┌────────────────────────┐ ║
║ │ ms_pro_cam_lock_camera │ ║
║ ├────────────────────────┴───────────────────────────────────────────────┐ ║
║ │ Prevents the camera movement until ms_pro_cam_unlock_camera is called. │ ║
║ │ │ ║
║ │ This one is pretty simple, when you call it, the camera won't move │ ║
║ │ anymore until you "unlock" it again. Nothing will move it, not even │ ║
║ │ zombie vampires. │ ║
║ │ │ ║
║ │ Keep in mind that the player can still move freely and everything will │ ║
║ │ work as usual. │ ║
║ └────────────────────────────────────────────────────────────────────────┘ ║
║ ┌──────────────────────────┐ ║
║ │ ms_pro_cam_unlock_camera │ ║
║ ├──────────────────────────┴─────────────────────────────────────────────┐ ║
║ │ Allows normal camera movement. │ ║
║ │ │ ║
║ │ This one is to reverse the locking caused by the above command. The │ ║
║ │ camera will "go back to life" and perform as usual. │ ║
║ └────────────────────────────────────────────────────────────────────────┘ ║
║ ║
╠══════════════════════════════════════════════════════════════════════════════╣
╠══════════════════════════════════════════════════════════════════════════════╣
║ 3. NOTES. ▼ ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ ║
║ Have fun and enjoy! ║
║ ║
╠══════════════════════════════════════════════════════════════════════════════╣
╠══════════════════════════════════════════════════════════════════════════════╣
║ 4. CONTACT. ▼ ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ ║
║ Keep in touch with us and be the first to know about new releases: ║
║ ║
║ www.rpgmakersource.com ║
║ www.facebook.com/RPGMakerSource ║
║ www.twitter.com/RPGMakerSource ║
║ www.youtube.com/user/RPGMakerSource ║
║ ║
║ Get involved! Have an idea for a system? Let us know. ║
║ ║
║ Spread the word and help us reach more people so we can continue creating ║
║ awesome resources for you! ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝)