Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Eclipse Event System 2.3] How to make treasure chests!


MCADAMS
 Share

Recommended Posts

Hello! Today I am going to explain a pretty simple process which allows you to make a one-time use treasure chest.

First, you'll want to open your Map Editor and select "Events" near the Layers, Attributes and Block. Pick a spot on your map to put your chest. I decided right against this tree.

![](http://i.imgur.com/wYTE4.png)

Now, once you click, a large GUI will prompt. Don't be overwhelmed! There's a lot of information but it's simple once you learn it.

Click on the white box under the words "Graphic". Click on the dropdown bar and pick where your chest tile is, and then press OK.

![](http://i.imgur.com/DyDVt.png)

Now, we want the player to only be able to open the chest once. So we'll need to make a 'variable'. I'll name it "HasOpenedChest1", meaning the player has opened the chest. In this case, the variable name doesn't matter, but it's good to name as something that describes what it is/does.

Go to the bottom left-hand corner and click 'Label Variables/Switches' and make a Player Variable called "HasOpenedChest1" and press OK.

![](http://i.imgur.com/3oyYM.png)

Now to your right, there will be a BIG white blox with a **@>** in it. Click on the @> and press "Add" at the bottom of the white box. You'll get a lot of options to chose from. Click "Conditional Branch"

![](http://i.imgur.com/yOjgx.png)

Once that opens, check off/click the dot next to "Player Variable". From the first dropdown bar, click the variable we just made (HasOpenedChest1). From the next one, pick "Equal To". To the right of that, change the 0 to 1\. It should look like this when you're done:

![](http://i.imgur.com/KH6b2.png)

Press OK. Now where the @> was earlier, you'll get this:

![](http://i.imgur.com/Kfq1r.png)

What this will do now is when you press CTRL near the chest, it will check what your HasOpenedChest1 variable is. If you've never opened it before, it will be 0\. Click the first @> and press Add, and then press "Show Text." What this will do is show text if you've already opened the chest, so you can put in whatever you like. I put in "This chest is empty", but you can do whatever you like.

Now that that is done, click the @> under 'Else'. The 'Else' means that if the players HasOpenedChest1 equals anything besides 1, this will happen instead. Click Add and press 'Change Items.' From the drop down menu, click the item you want to give to the player. I'm going to give them 100 gold. From the three dots, click the one that says "Give", because we want to give them 100 gold, not make them have 100 gold total or take away 100\. It should look like this when you're done.

![](http://i.imgur.com/1c3By.png)

_"But McAdams!"_ you might be saying. _"The players HasOpenedChest1 will always equal 0! They can open the chest forever!"_

Right, we don't want that. So click the @> under the one you just clicked. Press Add once again, and then click "Player Variable". From the dropdown menu, click "HasOpenedChest1" and where it says Set to:, put a 1.

What this does is after you get the gold for the first time, it will set our variable to 1\. Next time you go to open the chest, the event will notice your HasOpenedChest1 now equals 1 instead of 0, and will give you the "This chest is empty." chat box instead! If you've done everything correct, your event setup should look like this.

![](http://i.imgur.com/HAMu3.png)

…and that's it! You can make chests in your game thanks to the powerful event system. Let's see how it works...

Walking up to the chest...
![](http://i.imgur.com/85ZYz.png)

Press CTRL…
![](http://i.imgur.com/G0YJJ.png)

and press it again to get another 100 gold?
![](http://i.imgur.com/WlsJR.png)

Nope!

–---
I hope my guide helps out some people with the event system. If people like this and find it useful I'll take some request and make some more in the future. Feel free to leave comments below.
Link to comment
Share on other sites

Here is a way to make it so it shows chest is open.  :cheesy:

Up at the top hit new page
![](http://i46.tinypic.com/ej8jlu.png)

If you know how pages work don't switch pages, hit Copy Page.
![](http://i45.tinypic.com/711svm.png)

Now switch to your new page.
![](http://i50.tinypic.com/nw0to3.png)

Next hit paste page at the top to paste your first page.
![](http://i46.tinypic.com/33nfghy.png)

Now so that its not the same change it so you need the variable set to 1.
![](http://i47.tinypic.com/v7zkec.png)

Now just change the graphic to your open chest
![](http://i48.tinypic.com/akykhw.png)

Just save it all and go back to your map and its done.  :cheesy:
![](http://i47.tinypic.com/25f57bs.png)
Link to comment
Share on other sites

Haha, it's not the biggest issue ever. It's just a personal thing I have, where I hate it when games don't notify me of changes. :P

Oh, and another thing that springs to mind, not everyone understands what a Variable is, so might want to emphasize that every chest(If they have different loot in them, anyway) needs it's own seperate variable.
Link to comment
Share on other sites

Nice contribution McAdams, my only suggestion is to use a Player Switch instead of a Player Variable. This is because your chest only has two states (open/close). You can also use a Self Switch to have the chest reset each time you enter the map again.

@ Niffler you're correct in using a Player Switch in this instance. Although you can either do a Player Switch or a Player Variable for the chest, it makes more sense to use a Player Switch, because it has only two states. Player Variables should be used if you have more than two states that are needed.
Link to comment
Share on other sites

> Since there are only two states that the chest can be in (filled or empty) wouldn't it be more simple to use switches instead? Or am I misunderstanding the difference between switches and variables.

You're correct. At the time I thought all switches would restart if the server restarted so I didn't use that, but yes, variables still work.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...