Is it possible to add conditions to an "or" block?

Get help using Construct 2

Post » Mon Jun 06, 2016 9:21 pm

Is it possible to have an "or" block listing events with conditions added.

For example:

event
or
event with 1 condition
or
event with 2 conditions

It seems to only allow a single event/condition per "or".
B
40
S
18
G
5
Posts: 98
Reputation: 5,651

Post » Mon Jun 06, 2016 9:28 pm

I believe subevents may be the way to go?
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Post » Mon Jun 06, 2016 11:00 pm

How would I go about doing that? Should I make the "or" event (the one that I want to add the conditions to) have no actions on its own and then add a sub event with the conditions?
B
40
S
18
G
5
Posts: 98
Reputation: 5,651

Post » Mon Jun 06, 2016 11:41 pm

There are two things to consider in an or block, the logical TRUE/FALSE and the objects it picks (feeded to the actions).

For the the logical TRUE/FALSE, an or block is the same as the conditions seperated with a copy of the actions.
(yes i know its more code). If you are not picking objects, yes plz use an or block. And no, it dont accept an AND middle in the OR.

For the picking, if the or block contains a second condition picking the same object, then its starts from what is previous picked in the first condition picking that object. It will then happen that the logical TRUE/FALSE is correct but that there will be no objects feeded to the actions, due an empty picklist.

If you dont think an or block really trough, you are better of anywayz with a block for each condition and duplicated actions.

My 2 cents.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Jun 07, 2016 10:34 am

99Instances2Go wrote:There are two things to consider in an or block, the logical TRUE/FALSE and the objects it picks (feeded to the actions).

For the the logical TRUE/FALSE, an or block is the same as the conditions seperated with a copy of the actions.
(yes i know its more code). If you are not picking objects, yes plz use an or block. And no, it dont accept an AND middle in the OR.

For the picking, if the or block contains a second condition picking the same object, then its starts from what is previous picked in the first condition picking that object. It will then happen that the logical TRUE/FALSE is correct but that there will be no objects feeded to the actions, due an empty picklist.

If you dont think an or block really trough, you are better of anywayz with a block for each condition and duplicated actions.

My 2 cents.

Could else be useful with subevents in this situation? Or even just multilevel subevents successively comparing against different sets of events?
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Post » Tue Jun 07, 2016 12:56 pm

Dont think so, Construct mostly does not do 'if this,then that'.
I will bring even more confused people.

line-of-sight-and-quot-or-quot-bug-212-2_t152752
multiple-seperate-quot-or-quot-conditions-cause-anomalous-instancing_t123765
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Jun 08, 2016 7:38 am

99Instances2Go wrote:Dont think so, Construct mostly does not do 'if this,then that'.
I will bring even more confused people.

line-of-sight-and-quot-or-quot-bug-212-2_t152752
multiple-seperate-quot-or-quot-conditions-cause-anomalous-instancing_t123765


How about using inverted events to negate the statements that don't want to be considered in separate events?
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Post » Wed Jun 08, 2016 8:51 am

Same thing Zebbi (in my eyes), i see always the Two Same Things.

1/ A lot of poeple doe things like this, for example. In the first event they check if something moves right an some other condition. If true they set it to move left. In de next event they check if it moves left (forgetting that in the previous event they made it move left)

So, they make two events in a row, and the first event makes the second always true.

2/ At the same time (especialy in OR blocks) they pick some objects. In de next (same level or sub level event) they filter those picked items in a way that the condition is true, but there are no objects left in the picklist to feed the actions.

It is usaly not a case of construct having a flawed event system. It is usaly not carefully coded. In a lot of cases you are better of with two seperatly events then with an or block. The or is mostly lazy coding, because you dont have to duplicate the actions. Althaught, less event should be encouraged, i know.

So, in my opinion, allowing ANDs in an OR block will get even more poeple confused, when they seem to be confused allready. But i am guilty too, i still fall in those traps. I dont need more traps.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: dand, mageekm, oosyrag, Yahoo [Bot] and 31 guests