Activated random groups without repetition

Get help using Construct 2

Post » Fri Jan 03, 2014 6:26 pm

Hi everybody,


I have 20 groups and each has to be activated randomly. These groups can only be randomized and executed again after all are performed. How can I do to avoid repetition?

One more question: I want to disable each group after the actions are performed. I wonder if I can use an expression to disable the current group (Eg this.group) instead of having to write the name of each in the action "set group X Deactivated"

Thanks for any help.RenatoB2014-01-03 19:04:53
B
74
S
13
G
4
Posts: 1,005
Reputation: 8,058

Post » Sat Jan 04, 2014 11:44 am

Let's go to another attempt. I would just like to know how can I do to randomize values ??without any repetition, until all have been drawn. Could someone only suggest the way?

Regarding the other question, I would just leave the programming more independent and just only replicate it, instead of editing one by one.

I really hope someone can give me some help.

Thank you
B
74
S
13
G
4
Posts: 1,005
Reputation: 8,058

Post » Sat Jan 04, 2014 3:15 pm

There's a couple of RandomArray plugins you can use. See this thread: random numbers
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Sat Jan 04, 2014 6:45 pm

Thanks, @blackhornet. The Pattern Gen is a very nice plugin. I believe that this result can be stored in memory, correct? How can I do to have access to these memory addresses? It would, for example, i1, i2, i3, until it reaches the total quantity of numbers that were generated?

And with respect to the use of an expression to determine the current group is activated/deactivated? Is there any?

Thanks again.
B
74
S
13
G
4
Posts: 1,005
Reputation: 8,058

Post » Sun Jan 05, 2014 11:29 am

@Raganork: I've read in other posts that you always indicates the Pattern Gen plugin and offers to help. Could you help me? I need to know how can I access the values that are generated with Pattern Gen. Thanks anyway.
B
74
S
13
G
4
Posts: 1,005
Reputation: 8,058

Post » Mon Jan 06, 2014 7:56 am

I haven't used PatternGen but this looks like what you want.



There doesn't appear to be an expression for detecting a group's state. You'd have to keep track of that yourself.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Mon Jan 06, 2014 10:03 am

Hi @blackhornet.

I had seen the CAPX with the plugin sample. The problem is I don't know how to access the addresses to compare the value and activate the respective group.
B
74
S
13
G
4
Posts: 1,005
Reputation: 8,058

Post » Mon Jan 06, 2014 2:24 pm

You can't address them, you get them one at a time as needed with PatterGen.Pattern.
Try the above example and you'll see it randomly returns i1..20.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Mon Jan 06, 2014 3:29 pm

@blackhornet

I thought the plugin combining an address (such as "i5" for example) to the value that was generated by the plugin, according to the order. I intended to link these addresses to the groups to which they were activated in the order they were generated by Pattern Gen. If this is not possible, then I do not know how to do this. Could you give me some suggestion?
B
74
S
13
G
4
Posts: 1,005
Reputation: 8,058

Post » Mon Jan 06, 2014 4:04 pm

Sample:
PatGen2.capx
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Next

Return to How do I....?

Who is online

Users browsing this forum: TRMG and 37 guests