RPG Maker XP: How to use Common Events
If you need an event that's repeated multiple times in your game (for example screen transition), you can spare yourself some extra work by creating a Common Event instead of creating multiple individual events with indentical content.
To call a Common Event, create a new Event and Insert "Call Common Event..." command to its "List of Event". Choose a number (range 001-999) from a list, click OK and you are ready. Next launch Database and open Common Events sheet. Pick the event number you chose to call previously from the column on the left side of the window. You can assign name to your common event by typing it to the "Name" field. In this case, when you have created a Common Event that will only activate when called by an Event on a map, you can just ignore "Trigger" and "Condition" fields. Below these fields there is a "List of Event" field that looks similar to one in any Event. It also works like that. The Event Commands you assign here get called every time you use "Call Common Event..." to call this Event.
You can create custom screen transitions simply with "Change Screen Color Tone..." and "Wait..." commands. By creating all your transitions as Common Events, you save a lot of time and make it easier to edit them later. A fade to black screen transition can be created by reducing the color tone to -255,-255,-255 in certain amount of time, for example 10 frames. You should call this Common Event when you want to fade the screen black, for example when an Event with "Transfer Player..." command gets activated. Now you can create a 4-line event with only 3 lines and you have ensured that a fade out effect looks the same each time. Most importantly, you don't need to go searching for all the individual Transfer events in your game, if you for example decide to reduce the fading time from 10 frames to 5 in a nearly finished game. Just edit one Common Event.
You can use Fade In type Common Events to alter map settings such as fog and weather. One way to achieve this is to create separate Fade In events for different weather patterns. You can also start or stop a background sound or music with a Common Event. The more complex your transition effects get the more thankful you'll be for mastering the simple art of Common Events.
In RPG game world, inns are places where characters can rest and heal themselves. RGP Maker XP doesn't have a default inn command, but it's easy to create one with Common Events. First create a Common Event for Rest command which stops background sound and music, fades to black, heals the party and fades back in. You can use Fade In Common Events created previously or even create a Conditional Branch to choose a correct Fade In depending on weather (you need a variable to store the weather state), but for the sake of simplicity, I used just the Change Screen Tone command here. Second Common Event contains a dialog asking player whether he/she wants to rest. If player chooses to rest, the Common Event tests whether player has enough money, in which case it calls the resting Common Event created previously. After this it shows a dialog asking player whether he/she wants to save. With the two Common Events created previously, you can create Inn Events in the map editor just with 2 lines, first containing the Inn Keeper's introduction message and the second calling the Common Event for Inn.
You can also use Common Events during battle. To create a custom Flee skill, create a Common Event to count flee propability and abort the battle if conditions are met. Success of flee depends on a level of character who uses the skill, party size and random number generator. If a score reaches high enough, the battle gets terminated. Create a skill that activates the Common Event. Finally assign the skill to a character. Note: The propability variable is character specific. In this example it reads the level of character 004 (Dorothy). If you want to assign this skill to other characters, you need to edit the Common Event.
RPG Maker XP has a Thief class, but lacks the basic skill for them, Steal. Common Event is a way to create one. First create 3 variables: Steal Propability, Steal Item and Steal Special. Steal Propability will be calculated based on level of the character, Steal Item is a random number that defines which item player will get and finally Steal Special is a flag that determines whether special items can be stolen in a particular battle. After calculating Steal Propability, the Common Event will assign a random number to Steal Item variable. After generating the number, a Conditional Branch checks if Steal Special flag is set to 0 (regular battle). If so, the stolen item will be either Potion (common, 70 %), Perfume (intermediate, 25 %) or Elixir (rare, 5%), based on Steal Item variable. If Steal Special flag is set to other than 0, player will get different set of items with different propabilities. In this example, if Steal Special is set to 1, player will always get Tonic. Steal Special variable is operated outside the Common Event, for example by an Event before initiating a battle. The value should be returned to 0 after the battle in order to continue getting regular items from regular battles. Create a skill that activates the Common Event. Assign the skill to a character. Note: The propability variable is character specific. In this example it reads the level of character 004 (Dorothy). If you want to assign this skill to other characters, you need to edit the Common Event.