Problem with navigating layouts - Map Transitions

Get help using Construct 2

Post » Sun Sep 15, 2013 4:45 am

Hello everyone, I've been banging my head against this particular problem all afternoon, so I've turned to you all for assistance.

Essentially, I'm making a exploration/metroidvania style prototype, and I'm trying to initialize going between layouts when the player hits any of the borders on screen. The camera is currently fixed.

I'm attempting to arrange them on a sort of 'grid' formation by using the layout name to represent it's X and Y in relation to other layouts. Like so,



I'm attempting trying to design it in such a way that I don't have to type the exact layout name each time, but have it run a small script to determine the change in layout name (-x for right, +y for down, etc...) to arrive at the correct layout in relation to the one it was previously on.

However, it seems that when it transfers over to an alternate layout, it locks up, and won't go back as needed. I have it triggered on collision with 'layout change' sprites, and I have it navigating to the next layout like so,



The layoutTag object is an object on each layout that I use to establish the current layout name as instance variables, rather than characters.

Currently my thoughts of what might be going wrong are either,
a) It's not reseting the layoutTag object properly when the layout changes, so it arrives on the same number. This doesn't seem to be the case however, because debug texts have shown it reporting correctly on layout transition/start.

b) Since my layout name has negative numbers in it, perhaps that is locking it up somehow.

c) Or, option c, my personal favorite, my computer is possessed by devils and it's entirely borked.

I've looked on other posts for layout transitions, but all that I've seen so far are advancing layouts linearly, (1,2,3,4, etc) and not in a more nebulous 'coordinate' based system that I'm trying to create.

If anyone has any pointers I would appreciate it greatly. This little bit is the last of the 'engine' coding I have to do, after that it's all content creation and layout specific puzzles, objects, or bosses. :)

B
1
Posts: 1
Reputation: 127

Post » Sun Sep 15, 2013 5:42 am

Hello!
Surely the co-ordinates are for your benefit only, or possibly for a player map of some kind. I don't see an issue with using 'GoToLayout <name>' here instead of the complex variable method. Is there any real reason to keep in the layout direction and destination stuff?

If you still require help, a cut-down version in .capx format would be good. It could be many things but I would take a guess that it's the layouttag stuff causing an issue.plinkie2013-09-15 05:47:16
B
47
S
17
G
81
Posts: 2,221
Reputation: 48,089


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests