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
Posts: 17
Reputation: 371

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
60
S
15
G
8
Posts: 621
Reputation: 8,974

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
Posts: 17
Reputation: 371

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
60
S
15
G
8
Posts: 621
Reputation: 8,974

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
204
Posts: 3,586
Reputation: 115,576

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
Posts: 17
Reputation: 371


Return to How do I....?

Who is online

Users browsing this forum: NN81, Sumyjkl, Yahoo [Bot] and 2 guests