How do I travel in and out of layouts?

Get help using Construct 2

Post » Mon Aug 22, 2016 3:03 am

Help! I'm in the process of designing an RPG, but cannot seem to program the simplest thing. I would like for my player to move to one layout, and upon going back, return to the first layout from where it came. Whatever I do, the same problem persists; both layouts rapidly switch back and forth, and I'm breaking my head trying to figure this out. :(

If it helps to note, the first room has two different paths; therefore, there would potentially be three different spawning points: the initial, the first path, and the second path. If anyone has any solutions, please let me know! :oops:
B
13
S
2
Posts: 11
Reputation: 647

Post » Mon Aug 22, 2016 3:54 am

Hey Spy,

How do you have things connected up? It sounds like when you go to the new layout you are spawned on the door which is why you are constantly going back and forth between layouts.

Post up an example of the problem if you can.
ImageImage
B
122
S
23
G
7
Posts: 1,071
Reputation: 13,066

Post » Mon Aug 22, 2016 5:16 am

https://www.dropbox.com/s/dkqrwnwdz75qh ... .capx?dl=0

As mentioned above, don't spawn on your exit, or you will collide immediately and trigger the exit on the new layout. Otherwise, you'll need a state variable that keeps track of if you just entered a layout, and add a condition to check that it is false before exiting again.
Mistakes were made.
B
52
S
26
G
108
Posts: 1,605
Reputation: 61,131

Post » Mon Aug 22, 2016 11:49 am

GenkiGenga wrote:Hey Spy,

How do you have things connected up? It sounds like when you go to the new layout you are spawned on the door which is why you are constantly going back and forth between layouts.

Post up an example of the problem if you can.


Hey, Genki! The issue I was having was the fact that I had the player always set up to the initial spawn of the first room, when the initial spawn didn't even have to be there in the first place. Kind of hard to explain but basically I had everything wrong. Thankfully oosyrag helped me out! I feel like such an idiot because the process was so simple, hah! :lol:
B
13
S
2
Posts: 11
Reputation: 647

Post » Mon Aug 22, 2016 11:50 am

oosyrag wrote:https://www.dropbox.com/s/dkqrwnwdz75qhxm/layoutrooms.capx?dl=0

As mentioned above, don't spawn on your exit, or you will collide immediately and trigger the exit on the new layout. Otherwise, you'll need a state variable that keeps track of if you just entered a layout, and add a condition to check that it is false before exiting again.


Hey, Oosyrag! Your solution worked! It took me a bit to figure out, but it works wonderfully. Thanks so much for the help! Cheers! :mrgreen:
B
13
S
2
Posts: 11
Reputation: 647

Post » Tue Aug 23, 2016 2:42 am

Ha we all make mistakes :) glad your on the right track now. Good job Oosy.
ImageImage
B
122
S
23
G
7
Posts: 1,071
Reputation: 13,066


Return to How do I....?

Who is online

Users browsing this forum: adventurist, Blendi1223, dop2000, PROxMTswatTR, ST314 and 32 guests