Boolean Operation

Get help using Construct 2

Post » Thu Jan 05, 2012 12:53 pm

ARGGGG....

I am stuck. I don't want to use the "Bit" Plugin, because I think I've seen some article about "Boolean Operations" and since there are "basic" I sure think C2 should handle them.

So, maybe anyone can give me a reference on how to user AND, OR, NOT, Shift...
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Thu Jan 05, 2012 5:57 pm

The bit plugin is the easiest way to do bitwise operation

bitwise operation are not boolean operation. Boolean is a type. The operation you do with booleans are assignations and comparaisons.

the bitwise AND, OR, NOT, Shift,.. aren't comparaisons.
Besides, in scripting languages, the syntaxe is different :

[code]AND : & for bitwise, && for comparaison
OR : | for bitwise, || for comparaison
NOT : ~ for bitwise, ! for comparaison[/code]


Yann2012-01-05 17:58:13
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Jan 05, 2012 6:01 pm

You're a litte pettyfogger, ai?

Anyhow, how do I do a bitwise operation within C2?
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Thu Jan 05, 2012 6:02 pm

With the bit pluginYann2012-01-05 18:02:36
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Jan 05, 2012 6:04 pm

Ok....thanks, so there's no "nativ" way...what honestly I can not understand...
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Thu Jan 05, 2012 6:08 pm

Well, you don't really need bitwise operation that much.
There are ways to avoid using it in most cases.
But I guess you want to use that for some masking for allowed items in some of your inventory slots (:
I didn't use it for clarity.Yann2012-01-05 18:09:18
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Jan 05, 2012 6:17 pm

Right on Mr. Yann

Did you look at my demo?
B
42
S
19
G
12
Posts: 723
Reputation: 13,911


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests