How do I do this Or Sentence ?

Get help using Construct 2

Post » Sun Jan 11, 2015 3:46 pm

Image

Don't read too much into the codes [the variable assignments], it is nonsensical.

I am just wondering whether is it possible to fit two lines between "OR" statements.
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Sun Jan 11, 2015 4:00 pm

Hi, as far as I know, you can't.

You can only do Whatever=1 or Whatever =5 > trigger once, which only triggers the intended way, if whatever is not 1 or 5, but won't trigger again, if whatever is changed from 1 to 5 or 5 to 1. To do that, you can define a function, and simply call that. then you will have the right triggers and the event-code just once. If that is, what you want to achieve ;)
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Sun Jan 11, 2015 4:07 pm

Like this...
You do not have the required permissions to view the files attached to this post.
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Mon Jan 12, 2015 5:16 pm

Thanks for the solution, I wanted to do this too, but then it will show up in the Function object :(
I want the function object to hold more "global" functions because everything in the function is visible across all scenes so :(

Unless there is a way to isolate functions.
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Mon Jan 12, 2015 5:39 pm

It's possible with compare two values. Like this :
compareTwoValuesOr.PNG
You do not have the required permissions to view the files attached to this post.
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Tue Jan 13, 2015 6:28 am

Oh !
That's interesting !

But I am using the Trigger once condition so I guess I am out :(

How do you even create that by the way ?
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Tue Jan 13, 2015 8:28 am

It's part of the System object.

System - Compare two values, then type an expression using any of the standard mathematical forms.

It's all in the manual: https://www.scirra.com/manual/78/expressions
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,420
Reputation: 59,526

Post » Tue Jan 13, 2015 5:47 pm

Are you guys really sure, that it solves the problem, if the Value is changing from 0 to 6?

It still just compares, "if Whatever=0 or Whatever=6" is true, then it triggers once (meaning triggering only if previously not true). But if you want to trigger once each occasion, that is not going to work in my understanding.

Exapmle:

Whatever = 8
Whatever=0 or Whatever=6 is NOT TRUE > nothing happens

Change Whatever to 0
Whatever=0 OR Whatever=6 is TRUE for the first time > trigger once

Change Whatever to 6
Whatever=0 OR Whatever=6 remains TRUE > nothing happens, already triggered

Seems to be the same problem as described already in an earlier post of mine.

One question @Toddler: why exactly does the function solution bother you? Where does ist show up, and why is that any problem? I don't want to convince you, I just think, I can learn something there, I don't know about ;) Please explain.
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Tue Jan 13, 2015 6:16 pm

Well then, if it must run once between 0 <-> 6 value permutations too, I guess you could use sub-events and a local flag variable. Like this :
triggerOnceCombo.PNG
You do not have the required permissions to view the files attached to this post.
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Tue Jan 13, 2015 6:38 pm

variable vs. function ;)
B
8
S
3
Posts: 197
Reputation: 1,207

Next

Return to How do I....?

Who is online

Users browsing this forum: Euduardo, Kin, mikehive, ratboy3, tinhofiel and 38 guests