18 March 2010

Chapter 8: Items by Level (Hero Level) - The Complete Chests Tutorial

Chests can contain higher-level items, such as weapons, which are only accessible when a character reaches a certain level. If the character is the required level, they can open the chest, otherwise it remains closed. This is easy to do, thus:

Set up the basic chest (from Part 1), setting the chest name to "Chest 8" and the switch precondition on Page 2 to "Chest 8 Opened" also.

In the Events Commands, we need to set up a Branch Condition to check the Hero's level. If it's the required level, the chest is opened as usual. If not, a message is displayed stating the you are not a high enough level to receive the item.

The complete code is:
<>Branch if Zack Level is 2 or more
  <>Play Sound: open1
  <>Move Event: This Event, Face Right
  <>Wait: 0.2 Sec
  <>Move Event: This Event, Face Up
  <>Wait: 0.2 Sec
  <>Move Event: This Event, Face Left
  <>Wait: 0.2 Sec
  <>Change Items: Potion 1 Add
  <>Message: Potion received.
  <>Switch Operation: [0009:Chest 8 Opened] ON
: Else Handler
  <>Message: You are not a high enough level to
  :               receive the item.
: End
To increase the level required, simply change the value in the Branch Condition, and the item accordingly. Additional Branch Conditions and items can be added (in the Else Handlers) for additional levels.

0 Comments So Far:

Post a Comment

Related Posts with Thumbnails
Template Design "Perfect World" by SkinCorner