Create a WHILE and OR condition?

Get help using Construct 2

Post » Sun Apr 13, 2014 10:21 pm

Hi,

Can't find an example for making a condition build of a while and or combination, just like

WHILE "object1.number=2" OR "object.number=4" OR "object.number=25" do something

Do I need to create a sub-condition under the while? I wonder because I need to define the action right behind the while condition.

Looks a bit hard to understand the event system logic in such a case, if never made before.

Any help welcome.
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Mon Apr 14, 2014 2:06 am

Hi,

Can't find an example for making a condition build of a while and or combination, just like

WHILE "object1.number=2" OR "object.number=4" OR "object.number=25" do something

Do I need to create a sub-condition under the while? I wonder because I need to define the action right behind the while condition.

Looks a bit hard to understand the event system logic in such a case, if never made before.

Any help welcome.

Have exactly the same problem and doesn't seem to be any good way to do something like that due to C2 for some weird reason doesn't support "And" / "OR" in the same event condition. So I ended up doing it without a While all together. Think the only way to do it, if you need to use the while is to split it into several events.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Mon Apr 14, 2014 2:28 am

You can go old-school and do it as one expression. You can see the details in the console.
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
22
G
259
Posts: 3,793
Reputation: 143,702

Post » Mon Apr 14, 2014 2:33 am

Wow, this is really oldscool. Did not find this example anywhere.

Many thanks hornet!

But is there a usage for "object 1 collision with object 2" or "object 5 collision with object 6"

I guess I need to add more variables to perform this condition. Any "oldscool" condition for an array to use a loop in this code?

Somehow there seems to be tricky formulas in c2, which could be even easier in a js code class where you need what to do ;) and then the export bugs appear...
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Mon Apr 14, 2014 3:55 pm

Here is an example that places an OR analysis block at the end. It is a lot like the one hornet came up with.
You do not have the required permissions to view the files attached to this post.
Visit me at EgoAnt.com
B
51
S
7
G
7
Posts: 78
Reputation: 6,408


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests