Need help with a switch event

drakii

Villager
Hello everyone!
I was trying to follow a tutorial in how to make a switch that turns on or off, when there's something on top of it, to activate a bridge. I'm very unexperienced when it comes to events so I've been lost for some hours, I hope I can follow up quickly with your suggestions!
I followed the whole tutorial as best as I could but I probably messed something up, can you guys help me determine what I did wrong?

I posted a video on youtube to make it easier to see all the events, to see how it playtested for me.
(I made it 1080p to be better to read and tried to show every one of the events, variables, if I missed something I'll post a screenshot asap)
I also apologise if I posted on the wrong section of the forum
Thank you all for the help!

Edit: don't know if this is important but the coordinates of the switch are: 9,20

Veteran
1 mistake i see is, you use variable player X = map X for boulder.

you need variable Player X, variable player Y
you also need variable rock X and variable rock Y..

than you check when the rockX and rock Y on the switch.
if both are true, turn the bridge switch ON, if not, turn it OFF
(same with character)

I hope this make sense

EDIT:
Switch event (page 1)
control variable 1 = switch X of Map X of this Event
control variable 2 = switch Y of Map Y of this Event
if: Rock X = Switch X
if: Rock Y = Switch Y
sound effect if desired
control switch 2 bridge = ON
control SelfSwitch B is ON
end
end
control variable 1 = switch X of Map X of this Event
control variable 2 = switch Y of Map Y of this Event
if: player X = Switch X
if: player Y = Switch Y
sound effect if desired
control switch 2 bridge = ON
control SelfSwitch A is ON
end
end

Page 2 on the switch event:
check selfswitch A is ON

if player X is not equil to map switch X
controll switch bridge = OFF
controll selfswitch A = OFF
end
(do the same with Y)

Page 3 is the same as page 2, but than, change player to rock and turn selfswitch B = OFF

Last edited:

pasunna

Veteran
maybe just capture the full event page
and some critical point
for me video is too much time consume for me to look at
I don't even like the video tutorial that popular these later year
It's hard to track down the important part and many times waste...
but I understand youtube is other source of income making...

but for asking I think if it is not necessary
you better go with image

I see the end of the video
you better make variable name more accurate with what it is refer too
unless it will confuse your self

and better test it with easy method when you find it not work
like step by step
just check event(rock) on event(switch) location
maybe just use move route move right move right for rock to quick test
when it work then move on
making everything in one roll is not a good way for beginner

MightyEgg

Villager
at 0:39 you have playerX=boulderX and playerY=BoulderX.

The right is PlayerY=BoulderY because you have 2 diferent variables doing the same thing.

At 2:19 you need to check trought.
Checking trought let you walk in that sprite is a good option to do ghosts .

And to make more professional and clean you could use "else" in your IF.

Exemple: IF player looking up (do stuff) else IF player looking down(do stuff).

If that do not work you can message me with that map project and I will try to fix that and then I will tell you what I fixed and how...

drakii

Villager
Thank you guys for the help! I did what was recommended here and now it works
I got a bit confused at first with all the variables, but now this will serve as a template for me learning a bit more about events. Since I'm mostly mapping or writing dialogue and the storyline.

Two quick questions:
1. If I want to make it so that after this puzzle would trigger a staircase shortcut on the mountain on the other side of the bridge (So that I'm no longer dependent on the boulder to go there) and it triggering a hole on the ground so that I push that same boulder down to a different floor to re-use it on other puzzle.

*Would add a two page event, with the switch making the staircase appear.

*I'd have to add another page on the boulder with a switch to make it disappear when it goes down the hole (And a switch with two pages on the other room for it to appear once triggered)

*A hole event too, that triggers once I finish the bridge puzzle.
Basically I can copy some parts of the bridge/switch event to make this work out right? (The switch part, but just switch it with a hole) And maybe a switch at the end to make it so that the puzzle doesn't reset anymore when I re-enter the room.

2. How do you make sure a boulder doesn't get stuck on a wall in a puzzle room?
Maybe making so it's possible to pull it back or use a reset button?

Thank you once more!

Last edited:

MightyEgg

Villager
All of this is controlable by variables, 99,99% of times is what we use.

To the first question...

When something in this puzzle event triggers you can tell to the staircase´s one to appear.
You simple need to think like this...
I want a ball and I have the money to buy it after I bought it what I should do?

At the code is the same thing.

After something is complete or the player have a item, something happens.

For that you need to use variables lets say
After the puzzle is complete the variable turns off and if that variable its off other puzzle actives else the variable still on.

If you dont have a variable who turns off at the first puzzle just create one
Tip: Create the stair event and use
If variable bridge = off then (do stuff) else variable bridge= on

You dont need to use else here but I like to use almost the time to not let wierd things happen.

For the boulder: If you search how to make teleportation you will find a video.
Is super easy and you will learn how to do it.

Second

You can do it (If click ok button pull of back) this will use the player x and y again and some set mouviment route but for you is better to make a button sprite or something.

When player interact with the button the boulder teleports at specific spot.

Super tip: If you use the same code for others events at the map you could to create your code at coomon events.

Coomon events is like global code and its a time saver.

Good luck

Last edited:

MightyEgg

Villager
Something happened here
Bump clone post....

drakii

Villager
Thank you for the help and answering my last questions!
The more I delve into events the more it peaks my interest.

Latest Profile Posts

It's weird I actually have MORE work to do when stuck at home than before.
The No Travel Game Jam is here! Jump in to make a game in the month of April that takes place all in one town!

EVEN

Decided to take a stab at video editing.... Even made a clickbait screen. I'm so proud of my sellout ways.