Help: Go to layout + Button.Text

For questions about using Classic.

Post » Fri Jan 01, 2010 9:52 pm

Hi, all! I'm trying to learn Construct and make simple game. So, here's my .cap file:

http://rapidshare.com/files/328948252/BakeTheCake.cap

What I'm trying to do is to switch layout from Main menu layout to one of three others depending on button clicked. I first made it using three separate conditions, but I'm now trying to do it in more general way (in case I add more buttons). Note that button texts and layout names are same. Escape switches back from other layouts to Main menu.

The problem is that all three buttons (Gathering, Splitting, Mixing) switch to Gathering layout.

I thought that using object-type inside action (in this case Button through Button.Text) refers to the instance of that object-type which is used in the condition (in this case Button.on_button_clicked), but it seems that Button inside action always refers to the first instance (Gathering in this case).

Does anyone have an idea what's the problem (if there is problem at all!)? Note: I'm using Construct 0.99.62

Thanks in advance for any help!
B
5
S
1
G
4
Posts: 8
Reputation: 1,541

Post » Sat Jan 02, 2010 12:20 am

Unfortunately, the "Else" condtion doesn't work in some cases, and that's what's messing things up here. Just replace it with an inverted copy of the "Text is "Exit" (case: Yes)" condition(right click the condition, then click "Invert condition").
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Sat Jan 02, 2010 12:44 am

Yes, that solved it. Thanks again!

P.S. Is this known issue, or should I make bug report?
B
5
S
1
G
4
Posts: 8
Reputation: 1,541

Post » Sat Jan 02, 2010 8:20 pm

It's very much known, but I'm unsure if it's already in the tracker.
Search for it and if you don't see it, put it in there.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests