Jump to content

[Tutorial] Simple Puzzle


Weylon Santana
 Share

Recommended Posts

Hello everyone, I want to introduce a simple system, simply to teach how to use more events parameters and string variables for beginners

 

The goal is to create a gate that will open when where 4 switches are active. There are 4 switches in your world and their activation form will be in two different ways.

 

When the order of switches doesn't matter

Spoiler

Create a global variable and put it as a string

fa5bb5e7f00377b79a379ad09cee9555.png

 

Make your gate event on map - no spawn condition - just with a message - choose your graphic
3cf7d433faf4ba212fdcb0949ed56dee.png

Okay, now our gate is always locked, let's create a switch to unlock it. Create an event on a map, choose your graphic and put a UNIQUE NAME --> this is very necessary,

and as a first command let's create a conditional branch


If our variable DOES NOT contain the event name (--> \evtparam{evtName} <--).
681720bbe396da597100cd5b2b936b2e.png

 

Logically, if it does not contain, it means that this switch is not active, so let's add, inside the conditional branch (right on the line below), create a command to set variable

a9d061fbd878ed2a3bbd0c56b36db211.png

 

Copy everything inside the arrow -->\pv{Gate}\evtparam{evtName} - <--

don't be scared we'll understand


\pv{Gate} = It will get the value of the current variable, we are taking whatever value it has, if the player has activated another switch
\evtparam{evtName} = It will add the name of this event to the value of the variable, so the event name must be unique

 

For the else (when the variable contains the event name), just shows a message that the switch has been activated. This is the final event

aa8584929ec7135b57a53e476cd3c331.png

Save him, and save the map. Copy it and paste as many times as you need in the places in the world you need, when pasting make sure you change the event name. I will paste three more times:

b2587975fe44c9af89d0acfc79a0eb98.png

 

Now that the switches are ready, we need to get the gate to open

In the event of the gate, create a new page, I put another graphic for and on conditions Let's check if the variable contains the 4 switches

7c1aaddd69b9233ef8d6e2a865454bb0.png

 

and it's ready!
When interacting once, apparently nothing will happen, but the switch name has already been added to the gate variable.
if you interact again:

8054798ebafc1d0111cc3857dcbb9161.png

 

Before interacting with the last one look at the gate

4a16a30e11d2f37db2157e9d9b1edc10.png

 

After interacting with the switch

04b5441ec0cca495e1616581179b585c.png

 

If you got this far, and did all correct, and tested it, everything worked normally. Just remember to teleport the player on the second page of the gate event, or make the event passable, etc.

 

When the order of switches matter

Spoiler

Which is when you want events to fire in specific order

Here we are going to use an integer variable

9787f89b8c96046596239c1bbaf8b18e.png

 

On the first switch, check that the variable's value is 0, if is then add+1 on value, on else, send a message warning the player that it's the wrong switch

2e4ea2cd6e60524c1a75411ed42510dc.png708c5adb7e71f13c4bf5fc7edd757b8c.png

this is our event

ca1c7b8e58f5dea74b1cf212db43d534.png

 

Copy and paste, and every time you paste change the conditional branch (right click and then edit)
if it is 1 on 2th switch event
if it is 2 on 3th switch event
if it is 3 on 4th switch event
and so on

 

For the gate on the first page of event, it doesn't need a condition, just a message that it's locked

24ed6b2eebb66a25be6a714c2da27ea0.png

 

For the second page, just check when the value is equal to the last activated switch

b2758c20e008905bbb173b52f701b64a.png

 

If you interact with any switch other than the one that checks to see if the variable is 0, you will have this

6bea9a43e72fc7d4da90c2718196f412.png

 

When you interact in the right order, you'll see this

f6021b7d53ccabd38a2fc05eb8b41852.png

 

And when to interact with the last
51ccabdfcf916cd12694c9ca9ca2f747.png

 

Redo all the steps in the two ways I showed you to learn more about how events work. Any questions you can send that I will respond as soon as possible. <3

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...