Inserting Condition

Get help using Construct 2

Post » Fri Aug 16, 2013 12:34 am

I have a "Save" button and when the HUD is visible, the user can press it to save. Then they make the HUD invisible again. But if you press where the save button is it will still save even when the image is invisible.

I'm trying to add the condition if "Save" is visible - but I can't because it's an "or" block. If I try to add another condition it adds another "or" block. Here is the code:



This is what happens when I try...



B
18
S
2
Posts: 61
Reputation: 902

Post » Fri Aug 16, 2013 12:36 am

OR blocks will be put in between every condition. Use a sub-event (press S)
B
47
S
14
G
7
Posts: 603
Reputation: 8,141

Post » Fri Aug 16, 2013 1:44 am

Thanks I did that but now it saves and loads just if they're visible. They should wait until they're touched... ?

B
18
S
2
Posts: 61
Reputation: 902

Post » Fri Aug 16, 2013 1:54 am


Split them up to :
-----
On S pressed AND Save is visible > Save game
Is touching Save AND Save is visible > Save game
-----
Also am I missing something here, when does Save get set to invisible? : Splinkie2013-08-16 01:55:53
B
46
S
16
G
79
Posts: 2,170
Reputation: 46,857

Post » Fri Aug 16, 2013 2:17 am

Thanks I don't know why I didn't think to split them up. Now it works well. The save button gets to invisible when the user chooses to "hide" the HUD. I have a HUD button so they can hide it if they want to get more viewing area during gameplay.

Here's the working code

B
18
S
2
Posts: 61
Reputation: 902

Post » Fri Aug 16, 2013 2:31 am

Cool, glad that it works!
B
46
S
16
G
79
Posts: 2,170
Reputation: 46,857


Return to How do I....?

Who is online

Users browsing this forum: Resslx and 30 guests