Can the system randomly select the next layout?

Discussion and feedback on Construct 2

Post » Tue Aug 09, 2011 1:57 am

Hello,

I have another few questions I've had trouble finding the answer to:

1) How do I copy and paste a layout and event sheet?
2) Is it possible to have the system randomly select the next layout?

I would like to have it randomly pick the very first layout, and then have it randomly select the next layout is this possible, if so how do I go about it?

Thanks again,
Dave
B
6
S
1
G
1
Posts: 52
Reputation: 829

Post » Tue Aug 09, 2011 3:17 am

Go to layout random(number of layouts)
if index is 0 otherwise you know what to do
B
18
S
4
G
1
Posts: 413
Reputation: 2,512

Post » Tue Aug 09, 2011 3:21 am

Hi,

1.
i guess there is no way to copy all parameters of a layout into another one. would be a nice feature.

but as solo layers click into the layout when all layers selectable -> ctrl+A ctrl+C
new layout -> ctrl+V

same for sheet.

2.
try
+ Every X Second
-> Go To Layout ("layout"&random(3)) if you have layouts named layout2,3 etc.

dont know if it works, but have fun trying
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Tue Aug 09, 2011 7:44 am

I guess that was what my problem is, I don't see where to make a new layout. I went to file,new, but it just opened a new project and the system events only shows layout 1
B
6
S
1
G
1
Posts: 52
Reputation: 829

Post » Tue Aug 09, 2011 7:52 am

Just press the right mouse on the 'Layouts' folder icon on the right window and select 'Add Layout'.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,844
Reputation: 48,289

Post » Tue Aug 09, 2011 3:26 pm

We haven't done copy-pasting for some things yet (layouts is one of them) - it's surprisingly complicated to get working, since you can copy paste between projects and such. Should be fixed in a future build.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Tue Aug 09, 2011 9:17 pm

[QUOTE=Urled] Go to layout random(number of layouts)
if index is 0 otherwise you know what to do[/QUOTE]
e
I don't know where to find this. When I go to system -> go to layout, I just get a pulldown menu that show my layouts, and then I am only able to select one.
B
6
S
1
G
1
Posts: 52
Reputation: 829

Post » Tue Aug 09, 2011 9:54 pm

Indeed, you can't directly type a layout name, you have to choose it from the dropdown.
Then do a little workaround.

Randomize a number and test it.
[code]Global variable rd as number (= 0 default)
System->Start of layout - Action System-Global & local Variable - Set value
Variable: rd - Value: round(random(your_number_of_layouts)+1) (round() will give an integer) (+1 to prevent obtaining 0 as result of the random())
..SubEvent System-Compare Variable
..Variable: rd - = Equal to - Value:1
...Action: System - Go to Layout, pick your layout 1

..SubEvent System-Compare Variable
..Variable: rd - = Equal to - Value:2
...Action: System - Go to Layout, pick your layout 2

etc...[/code]

Kyatric2011-08-09 23:09:31
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Tue Aug 09, 2011 9:55 pm

yeah, there is noway to add a script expression, just a pulldown menu.

And idk there is a random function either yet.
B
3
G
1
Posts: 33
Reputation: 541

Post » Tue Aug 09, 2011 10:57 pm

[QUOTE=Kyatric] Indeed, you can't "name" a layer, you have to choose it from the dropdown.
[/QUOTE]

i guess u mean layout. and yes you can name them, just like event sheets. right menu -> Projects -> layouts -> select and then left menu -> name.

so my way 'could' work too. didnt test it. your way is working fine.
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 14 guests