Layout Navigation dilemma

Get help using Construct 2

Post » Wed Jan 29, 2014 9:38 pm

Hi,

here's my situation:
I have two layouts A & B,

A being the default one.

Layout A has event that will trigger 'Go to layout B' and
layout B has event that will trigger 'Go to layout A'.

And when I get back to layout A from B, layout A is not in its initial state. All I wish is that Layout A has been reset as if it was the first time am on it. I have tried 'Restart layout' and 'Reset Global variables' but none seems to work (or I don't know the right place to use them).

and it definitely doesn't run through the 'on start of layout' condition when I get back to layout A..

All I wish is a complete reset of Layout A when I get back to it from Layout B..

Anybody?.. Please help.. it seems trivial but am stuck on it..
B
7
G
1
Posts: 6
Reputation: 412

Post » Wed Jan 29, 2014 9:51 pm

You must use the behavior "persist" on objects so they'll stay in the same place when you switch layouts.

Edit- Oops, read it wrong. You actually want layout A to be reseted? That's weird, it should be when you start it again. andreyin2014-01-29 21:52:38
B
123
S
43
G
41
Posts: 847
Reputation: 28,206

Post » Wed Jan 29, 2014 9:58 pm

Strange, I remember using "Restart Layout" before and it did trigger the "on start of layout". I recall creating an infinite loop this way.
B
11
S
3
G
1
Posts: 98
Reputation: 1,062

Post » Wed Jan 29, 2014 10:03 pm

Yep.. that's the dilemma..

when you get back to layout A from layout B, things have changed.. the 'on start of layout' triggers only once (at the very first opening of a layout) and not every time you get back to it.. But am still gonna try the 'persist' thingy Andre..

Thanks dude, much appreciated.. will let you know what happens..

Anyone else came across this?
B
7
G
1
Posts: 6
Reputation: 412

Post » Wed Jan 29, 2014 10:12 pm

Yo Robsta,

the restart layout action always triggers the on start of layout condition.. but.. provided you stayed on the same layout..

but when you coming from another layout..

I can't seem to find a sweet spot to trigger the restart layout action in my event sheet..

Have you tried anything like that before?

Yuv
B
7
G
1
Posts: 6
Reputation: 412

Post » Wed Jan 29, 2014 11:22 pm

I'm leaning that this is coding problem. Without knowing more about your code we can't determine the problem.

There is of course the persist behaviour that you don't want to use, but are your objects set to global?. How about creating a simple capx that we can take a look at.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018


Return to How do I....?

Who is online

Users browsing this forum: ChesVCF, LaDestitute, OBLIVION, Solomon and 16 guests