Game Development Reference
In-Depth Information
event call, it would be processed before switching events. If you're using Autorun or Parallel Process events, you have
to be particularly careful of chaining common events in that way, as it could get messy really fast. Here's the second
common event called by the first:
@>Conditional Branch: Variable [0011:DungeonLocation] == 0
@>Text: -, -, Normal, Bottom
: : You cannot use that here!
@>
: Branch End
@>Conditional Branch: Variable [0011:DungeonLocation] == 1
@>Change Items: [Exit Scroll], -1
@>Control Variables: [0011:DungeonLocation] = 0
@>Transfer Player:[003:Field 3] (027,082), Left
@>
: Branch End
@>Conditional Branch: Variable [0011:DungeonLocation] == 2
@>Change Items: [Exit Scroll], -1
@>Control Variables: [0011:DungeonLocation] = 0
@>Transfer Player:[003:Field 3] (013,077), Down
@>
: Branch End
@>
DungeonLocation is equal to 0 at any time that the player is not within an applicable dungeon. If that is the case,
then the player will get an error message, and the event will end without consuming an item. When DungeonLocation
has a value, the player is transferred to the entrance of the dungeon equal to that value, but not before consuming an
Exit Scroll and setting DungeonLocation to 0. What if we wanted an item to allow the player to return to the last visited
town? We could have another variable to store the value of the last town visited by the player and then transport him/
her directly inside when the item is used. You could even combine the DungeonLocation and TownLocation variables
to make it so that you can only teleport to town if you are not inside a dungeon. That pretty much covers the use of
common events, but this wouldn't be much of a chapter if I ended it this quickly, right? Instead, I'm going to write up
some other ideas that I've created over time that involve the use of common events. But first, have a skill version of
Exit (Figure 9-3 ).
Figure 9-3. The Exit skill uses the same common event as the Exit item
 
Search WWH ::




Custom Search