How do I use the new set color in construct 3?

Get help using Construct 3!

Post » Mon May 15, 2017 9:49 pm

I'm trying to use the set color command (which I was fine with in construct 2) and it works fine for parameter 0 (red). However, when the parameter is set to 1 or 2 (theoretically green then blue) it doesn't work. I've tried multiple things to make sure I haven't just made a mistake (IE replacing the one used for the red and putting it in every tick) but to no avail. Is it treating the color as a single parameter? If so how do I target blue or green?
B
10
S
2
Posts: 12
Reputation: 622

Post » Fri May 26, 2017 11:46 pm

SteamPoweredPix wrote:I'm trying to use the set color command (which I was fine with in construct 2) and it works fine for parameter 0 (red). However, when the parameter is set to 1 or 2 (theoretically green then blue) it doesn't work. I've tried multiple things to make sure I haven't just made a mistake (IE replacing the one used for the red and putting it in every tick) but to no avail. Is it treating the color as a single parameter? If so how do I target blue or green?


@SteamPoweredPix Hi, I was having the same exact problem - it really seemed as though effects that require color parameters were just broken in Construct 3, but they're not! Here's how pass color values to effects now.

Instead of the C2-style "parameter 0 = red, parameter 1 = green, parameter 2 = blue", C3 color parameters are just a single value of "rgb" type. To get that you use the System expression "rgb" and pass it three numbers between 0-255 (not 0-100 like in C2).

Code: Select all
Solid red:
Set effect "SetColor" parameter 0 to rgb(255, 0, 0)

Solid green:
Set effect "SetColor" parameter 0 to rgb(0, 255, 0)

Solid blue:
Set effect "SetColor" parameter 0 to rgb(0, 0, 255)

Solid grey:
Set effect "SetColor" parameter 0 to rgb(128, 128, 128)

And so on. Hope this helps!
B
39
S
12
G
2
Posts: 46
Reputation: 4,046

Post » Sat May 27, 2017 1:23 pm

JerkTheRipper wrote:
SteamPoweredPix wrote:I'm trying to use the set color command (which I was fine with in construct 2) and it works fine for parameter 0 (red). However, when the parameter is set to 1 or 2 (theoretically green then blue) it doesn't work. I've tried multiple things to make sure I haven't just made a mistake (IE replacing the one used for the red and putting it in every tick) but to no avail. Is it treating the color as a single parameter? If so how do I target blue or green?


@SteamPoweredPix Hi, I was having the same exact problem - it really seemed as though effects that require color parameters were just broken in Construct 3, but they're not! Here's how pass color values to effects now.

Instead of the C2-style "parameter 0 = red, parameter 1 = green, parameter 2 = blue", C3 color parameters are just a single value of "rgb" type. To get that you use the System expression "rgb" and pass it three numbers between 0-255 (not 0-100 like in C2).

Code: Select all
Solid red:
Set effect "SetColor" parameter 0 to rgb(255, 0, 0)

Solid green:
Set effect "SetColor" parameter 0 to rgb(0, 255, 0)

Solid blue:
Set effect "SetColor" parameter 0 to rgb(0, 0, 255)

Solid grey:
Set effect "SetColor" parameter 0 to rgb(128, 128, 128)

And so on. Hope this helps!

Works perfectly now, thanks :D
B
10
S
2
Posts: 12
Reputation: 622


Return to How do I...?

Who is online

Users browsing this forum: Bootfit and 0 guests