How do expressions work? ( Easy explonation )

Get help using Construct 2

Post » Wed Oct 07, 2015 6:39 am

I know that it exist manual entries about expressions but i haven't been able to understand them well enough to get the hang of expressions. I have made successfull expressions but some doesn't work. I made one today that doesn't work. Expressions seem to always need " " in them. Is that rigth? Do they need ( ) too? How do you write a expressions in easy to understand words. Do you write it "( Sprite )" or "Sprite"()? I may go deeper into what my expression that doesn't work is but i just explain that if i need to.
B
11
S
2
Posts: 262
Reputation: 1,309

Post » Wed Oct 07, 2015 7:17 am

https://www.scirra.com/manual/78/expressions

They basically express certain things in a quantitative form.
B
42
S
19
G
65
Posts: 1,097
Reputation: 37,906

Post » Wed Oct 07, 2015 7:22 am

It depends on what you want to do.
Anything inside " " is just text.
Ex: "Sprite"
That is is just an expression for text with a value of Sprite.

Parenthesis () have two purposes. The first is just like in math to control what operations are done first.
Ex: 1+2*3 = 7
Ex: (1+2)*3 = 9

The second purpose is for expressions that take parameters.
Ex: sin(45)
Ex: min(1, 3, 2)

Beyond that it should be pretty simple. But feel free to post the equation you made that doesn't work and describe what you want it to do.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455


Return to How do I....?

Who is online

Users browsing this forum: eochranek, fearfulelephants and 18 guests