How do I reuse array from Sheet event not include it?

Get help using Construct 2

Post » Mon Sep 05, 2016 2:42 pm

Hi, guys

I have a "Sheet Event 1" , I want to reuse the arrays from "Sheet Event 1" to other Sheet Event

I read and follow a document here https://www.scirra.com/manual/121/event-sheets

Include Sheet event will run all code in the "Sheet Event 1" once again, but I have the random shuffling of an array at "On start of layout" event in "Sheet Event 1" . this means it will run once again and change the value in my array

I want to only reuse array, keep all values in array, not run all code in "Sheet Event1" once again


Please excuse my poor English :)
Last edited by gameba on Tue Sep 06, 2016 1:50 am, edited 3 times in total.
B
37
S
18
G
18
Posts: 66
Reputation: 12,003

Post » Tue Sep 06, 2016 1:35 am

Any thoughts on this are highly appreciated.
B
37
S
18
G
18
Posts: 66
Reputation: 12,003

Post » Tue Sep 06, 2016 1:53 am

Use a different event sheet for each layout. The Array will stay in tact unless you change it.
B
56
S
15
G
13
Posts: 826
Reputation: 17,675

Post » Tue Sep 06, 2016 3:08 am

or if you like you can use group for disabling certain event block from firing if you plan on returning to the specific event.
B
52
S
24
G
6
Posts: 391
Reputation: 7,845

Post » Tue Sep 06, 2016 9:04 am

The array object is global by default.
It means that it is usable through the whole project.

If, in the execution of your game's logic, you already go through Event sheet 1, fill the array with values and then go to another layout/event sheet, from this new layout/event sheet you can still access the array and use the currently filled in values/modify them, etc...
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
293
S
117
G
96
Posts: 7,310
Reputation: 71,069


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests