This script automatically updates a set of “common event variables” throughout the game. The purpose is to make it easier for developers to design events that rely on information such as who used a skill.
The main purpose of this script is to provide a way to specify common event arguments. These arguments are stored in game variables, which makes it easy to use for the event editor and some script calls when necessary.
The variables will be updated automatically whenever a skill or item is used, on the map or in a battle.
Script: download here
Place this script below Materials and above Main
The following objects are automatically set when a common event is used
$game_temp.common_event_user - stores the user $game_temp.common_event_target - stores the target $game_temp.common_event_item - stores the item used. $game_temp.common_event_skill - stores the skill used
You can access them in your common event script calls as needed. All values are
nil if no data is available.
In the configuration, set the ID of the game variables to store the common event variables. The game automatically tracks the following data upon item or skill use:
- the user (actor or enemy ID)
- the target (actor or enemy ID)
- the skill (skill ID)
- the item (item ID)
Note that the skill and item are stored in separate variables.
You can reference these variables in your events or script calls.
For common event effects, only the first common event will have this
information available. The data is lost after the first common event
finishes running. I have not figured out when is a good time to clear out