LOCKED CHESTS
A tutorial on how to make locked Treasure Chests with random items inside
Aten- 07/29/2010 07:19 PM
- 1689 views
Written by Gemin-Eye
Here we will make another chest, but it will be locked. It will require a key to open and the chest will have a random item within. When the hero first checks the chest, they will get a message that it is locked. When they get the key, it will open and a message saying he used the key will pop up and the hero will get a random item (with a message). Then this chest will offer no further items. You will need to be familiar with making events.
1. First you need to make the key that will open the chest. Press the key to open the Database. Click the Items tab. Scroll down the Items/Weapons List until you find a blank column, if you don't find one, make one by increasing the Max Number Of Items.
Type in the Name as "IRON KEY". Make the 'Classification' as "Common Goods", Set the 'Price' to "0" (so the player can't sell the key), then type in a short Explanation describing the appearance of the key in 'Explanation'. Click 'Ok' to exit the Database.
2. Next we make the chest event, as above. The FIRST PAGE will be as such: 'Event Conditions" - all blank, 'Graphic' = A closed chest, 'Event Start Conditions' = Push Key, 'Position' = Same Level as Hero, 'Animation Type' = Without Stepping, (so it does not open when you check it the first time) 'Movement Type' Stay Still, 'Movement Speed' = 3: 2x slower. The 'Event Commands' = 'Message' 'LOCKED'. Now make a New Page.
3. On the SECOND PAGE leave the 'Graphics and 'Event Start Condition' stuff as is. Except here we place a check in the Item Event Condition. Put a check in 'Item' click the v (pull-down-list) and select the Iron Key we made above. Now in the 'Events Commands' we put:
Just like the simple chest: <>Move Event: This Event , Turn Left 90, Wait, Face Up, Wait, Face Left, Wait <>
Now for the randomization: What this all does is add an item that will be determined by a randomly generated variable.
4. Click 'OK' to store your work so far on the locked chest event. Open your 'Database' (F8) and click the 'Items' tab. See how all the items have numbers assigned to them? Numbers are what Variables hold. (Anything clicking?). Thats right you can assign an item to a variable by using the number of the item. So when you make your items, any items you want to give out randomly must be all beside each other, like from 0001 to 0010 or 0008 to 0030. Why? Because the randomness in variables is determined by a number from x to x. 1 to 10 includes all the numbers from 1 to 10. (Did I need to tell you that?) What the actual random variable number is, will be set from a different event. Like when they get the Iron Key. (see below 'Npcs and the Key' step8). Click 'Ok'.
Open your chest event made in step 2. On PAGE TWO- Double click in the 'Events Commands' window and select 'Add Item'. Adjust it as follows:
'Operation': "Add Item",
'Add/Drop Item': select "Variable",
'Operand': select "Set" - "1". Click on the button to open the Select Variable dialog and make a new variable and name it. "Chest-Rand-Item". . Click 'Ok', twice.
5. Now to add a message " Found ". Then we will need to make a Common Event. This common event will check the variable and what item it is and insert the items name into the message. Also we need to turn on the common event with a Switch here in this page of the event. Place a 'Change Switch' (The one that turns on the Common Event in the Database) - ON.
You will need to understand what Common Events are, and how to use Fork Conditions. Go here to see what Common Events are. Go here for the Tutorial on Displaying the Items Name with Fork Conditions. Use the Back button to return to here.
6. Now we need another 'Change Switch' in the 'Events Commands' so this chest will stop giving items. You know how to do this. Do it. Then make a new page. If you need help go back up to (Chests step 11).
7. In PAGE THREE we put a check in the 'Switch' and make it the switch we just made on PAGE TWO . Change the 'Graphic' to an open chest. Then put an "EMPTY" message in the 'Events Commands' box. Click 'Ok' this event is done.
Now on to the NPC who has the KEY. Read the "NPC's and the key" tutorial to find out.
Here we will make another chest, but it will be locked. It will require a key to open and the chest will have a random item within. When the hero first checks the chest, they will get a message that it is locked. When they get the key, it will open and a message saying he used the key will pop up and the hero will get a random item (with a message). Then this chest will offer no further items. You will need to be familiar with making events.
1. First you need to make the key that will open the chest. Press the key to open the Database. Click the Items tab. Scroll down the Items/Weapons List until you find a blank column, if you don't find one, make one by increasing the Max Number Of Items.
Type in the Name as "IRON KEY". Make the 'Classification' as "Common Goods", Set the 'Price' to "0" (so the player can't sell the key), then type in a short Explanation describing the appearance of the key in 'Explanation'. Click 'Ok' to exit the Database.
2. Next we make the chest event, as above. The FIRST PAGE will be as such: 'Event Conditions" - all blank, 'Graphic' = A closed chest, 'Event Start Conditions' = Push Key, 'Position' = Same Level as Hero, 'Animation Type' = Without Stepping, (so it does not open when you check it the first time) 'Movement Type' Stay Still, 'Movement Speed' = 3: 2x slower. The 'Event Commands' = 'Message' 'LOCKED'. Now make a New Page.
3. On the SECOND PAGE leave the 'Graphics and 'Event Start Condition' stuff as is. Except here we place a check in the Item Event Condition. Put a check in 'Item' click the v (pull-down-list) and select the Iron Key we made above. Now in the 'Events Commands' we put:
Just like the simple chest: <>Move Event: This Event , Turn Left 90, Wait, Face Up, Wait, Face Left, Wait <>
Now for the randomization: What this all does is add an item that will be determined by a randomly generated variable.
4. Click 'OK' to store your work so far on the locked chest event. Open your 'Database' (F8) and click the 'Items' tab. See how all the items have numbers assigned to them? Numbers are what Variables hold. (Anything clicking?). Thats right you can assign an item to a variable by using the number of the item. So when you make your items, any items you want to give out randomly must be all beside each other, like from 0001 to 0010 or 0008 to 0030. Why? Because the randomness in variables is determined by a number from x to x. 1 to 10 includes all the numbers from 1 to 10. (Did I need to tell you that?) What the actual random variable number is, will be set from a different event. Like when they get the Iron Key. (see below 'Npcs and the Key' step8). Click 'Ok'.
Open your chest event made in step 2. On PAGE TWO- Double click in the 'Events Commands' window and select 'Add Item'. Adjust it as follows:
'Operation': "Add Item",
'Add/Drop Item': select "Variable",
'Operand': select "Set" - "1". Click on the button to open the Select Variable dialog and make a new variable and name it. "Chest-Rand-Item". . Click 'Ok', twice.
5. Now to add a message " Found ". Then we will need to make a Common Event. This common event will check the variable and what item it is and insert the items name into the message. Also we need to turn on the common event with a Switch here in this page of the event. Place a 'Change Switch' (The one that turns on the Common Event in the Database) - ON.
You will need to understand what Common Events are, and how to use Fork Conditions. Go here to see what Common Events are. Go here for the Tutorial on Displaying the Items Name with Fork Conditions. Use the Back button to return to here.
6. Now we need another 'Change Switch' in the 'Events Commands' so this chest will stop giving items. You know how to do this. Do it. Then make a new page. If you need help go back up to (Chests step 11).
7. In PAGE THREE we put a check in the 'Switch' and make it the switch we just made on PAGE TWO . Change the 'Graphic' to an open chest. Then put an "EMPTY" message in the 'Events Commands' box. Click 'Ok' this event is done.
Now on to the NPC who has the KEY. Read the "NPC's and the key" tutorial to find out.













