How do I give a condition for an event in different layout

Get help using Construct 2

Post » Fri Feb 12, 2016 11:49 pm

I'm trying to give a condition for an event to happen in another layout.

I tried "include" but didn't work!

SOS
B
9
S
1
Posts: 17
Reputation: 521

Post » Sat Feb 13, 2016 12:16 am

You would need to use a global variable to do that.. or maybe call a function, haven't used Construct2 functions across multiple sheets yet but it "should" work...
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
66
S
17
G
8
Posts: 637
Reputation: 9,370

Post » Sat Feb 13, 2016 12:22 am

chrisinfinger wrote:You would need to use a global variable to do that.. or maybe call a function, haven't used Construct2 functions across multiple sheets yet but it "should" work...



Thanks! How can I call a function though?
B
9
S
1
Posts: 17
Reputation: 521

Post » Sat Feb 13, 2016 12:28 am

Add function object by double clicking layout white space and selecting it (like you would add keyboard or mouse, etc). Then you can use function events and actions.

You will need a basic scripting understanding of what functions are/do though.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
66
S
17
G
8
Posts: 637
Reputation: 9,370

Post » Sat Feb 13, 2016 12:31 am

A function isn't going to help. Only one Layout exists at a time, so you need to store the data, in a global, for example, and grab it when the new layout starts-up.
ImageImageImage
B
71
S
21
G
231
Posts: 3,688
Reputation: 129,352

Post » Sat Feb 13, 2016 1:14 am

chrisinfinger wrote:Add function object by double clicking layout white space and selecting it (like you would add keyboard or mouse, etc). Then you can use function events and actions.

You will need a basic scripting understanding of what functions are/do though.


blackhornet wrote:A function isn't going to help. Only one Layout exists at a time, so you need to store the data, in a global, for example, and grab it when the new layout starts-up.


I will try the global variables approach.

Thanks both of you
B
9
S
1
Posts: 17
Reputation: 521


Return to How do I....?

Who is online

Users browsing this forum: namaewayukidesu, ultrafop and 13 guests