Door to Door transportation

Get help using Construct 2

Post » Wed Jun 24, 2015 6:11 pm

I'm currently working on a puzzle games that take place inside a house with a bunch of doors. I was able to connect Door1 to Door2 with:

1rst Event
+Player is overlapping Door 1 and Presses X ----------> Player Set Position (X,Y) Note: (X,Y) is the position of Door 2.

Now I test it, and it worked. I press X and I get transported from Door 1 to Door 2. Perfect!

BUT, when I try to repeat the same Event (2nd) but in reverse in order to go back from Door 2 to Door 1, here is when things gets messed up.
I test it and when I press X in front of Door 2, and I get transported to Door 1, cool so far! But when I press X on Door 1 to go back to Door 2, my Player starts humping the door without going anywhere.

I really need to advise if I'm doing something wrong or if there's a better way to do a door to door transportation.

NOTE: All the doors are in the same layout.
B
3
Posts: 6
Reputation: 187

Post » Wed Jun 24, 2015 8:21 pm

Is overlapping 1 and press x, set position to (door2.x, door2.y) and vice versa. Is that it? It should be working o-o
Try uploading your .capx or a print screen with you code so we can have a better understandingo of what's going on.

Sorry for not being able to help any further
B
17
S
7
Posts: 280
Reputation: 2,522

Post » Wed Jun 24, 2015 9:05 pm

Edit: I can't post pictures nor links cuz I don't have rep enough.

Anyhow, here is exactly how it's written:

Keyboard - On X Pressed----------------------- Player Set Position to (door2.X, door2.Y)
Player - Is Overlapping door1


Keyboard - On X Pressed------------------------ Player Set Position to (door1.X, door1.Y)
Player - Is Overlapping door2
B
3
Posts: 6
Reputation: 187

Post » Wed Jun 24, 2015 9:15 pm

I solve it and it's still strange. The problem was to assign the same key, in this case "X", to both events. What I did was to assign different keys and it worked.

Still, I'd want to assign just one key to that action because you are just entering a door. :(
B
3
Posts: 6
Reputation: 187

Post » Wed Jun 24, 2015 10:16 pm

If you haven't, I would arrange the events like so

(Main Event) Press X
(Sub Event 1) Player overlapping door 1 > [player set position to door2]

(Sub Event 2) Player overlapping door 2 > [player set position to door1]

You'll probably want to tweak this because this won't work if you have multiple doors that you are pressing "X" over (use instance variables or something).
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
9
S
3
G
2
Posts: 194
Reputation: 1,713

Post » Wed Jun 24, 2015 11:03 pm

The events fire so fast so it's like you are at both doors at the same time when you press x. So if you press x at door one you immediatly teleports to door two and the x trigger is still active and you teleport back to door 1 so fast it looks like a glitch

try this
Is overlapping and press x > wait 0.05sek > move to other door

That should work

And the press part should be a trigger not a condition off course :)
B
55
S
24
G
13
Posts: 766
Reputation: 12,573

Post » Thu Jun 25, 2015 12:46 am

OMG! You did it, Anonnymitet! That was the solution. Thank you very much! :D
B
3
Posts: 6
Reputation: 187

Post » Thu Jun 25, 2015 12:50 am

BTW, maybe you can help me on this problem I have.

I have set an event that makes my Player set a CRAWLING animation when he overlaps an invisible wall. So every time my Player overlap it, my Player switches from Standing animation to Crawling animation so he can pass through a tunnel. However, if I press up during this animation my Player still jumps. Is there a way for me to disable to "up" key during the crawling animation?
B
3
Posts: 6
Reputation: 187

Post » Thu Jun 25, 2015 7:14 am

Glad it worked.

For the crawling. Just put conditions on the jump event.

On up key pressed and is not playing crawling animation as a condition > then jump

Put the condition "is playing" animation crawling there and right click and inverse it to make it "is not playing" the crawling animation
B
55
S
24
G
13
Posts: 766
Reputation: 12,573

Post » Thu Jun 25, 2015 3:52 pm

Makes total sense. I'll try it as soon as I get home.

This is the last favor, I don't want to take much of your time. Do you know of any tutorial that teaches picking objects from the floor and grabbing them, running around the house with them and droping the object on the floor if you want so you can grab another one?
B
3
Posts: 6
Reputation: 187

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 41 guests