How do I Get current instance Effect Value

Get help using Construct 2

Post » Fri Sep 19, 2014 2:20 pm

I have some sprites in "colorable" family. It's easy to change colour of sprite with HSL effect, but when I need to read current sprite Hue Saturation or Lightness, there's no experssion to Get current instance effect value.

It would be useful to have
Code: Select all
colorable.effect("HSL",0)

to get value of 0 parameter in HSL Effect.
B
4
S
1
Posts: 20
Reputation: 392

Post » Fri Sep 19, 2014 3:21 pm

Couldn't you use LiteTween and TweenToEffect to do that?
B
22
S
6
Posts: 244
Reputation: 2,690

Post » Sat Sep 20, 2014 9:49 am

Tweens are great for smooth animations, but what I need is expression to get sprite effect value, here's the picture:

Image
B
4
S
1
Posts: 20
Reputation: 392

Post » Sat Sep 20, 2014 3:14 pm

Hey, I made this Capx a while ago but didn't post it because my internet was kinda bad, and i think this will work for now till we find another solution:

AdjustHSL Hue Value.capx
You do not have the required permissions to view the files attached to this post.
B
22
S
6
Posts: 244
Reputation: 2,690

Post » Sat Sep 20, 2014 3:51 pm

I've seen similar question before and I think the answer is you can't because it's a webgl thing, thus it is not accessible through system expression. I can't find the thread but if I'm not mistaken, there's a workaround by assigning the effect parameter with instance variable or normal variable. This way, you can get the effect value through variable.

I'm probably wrong on the webgl thing, probably @Ashley himself can explain why it is not accessible.

Btw, it is interesting on how do you intend to use it in mathematical expression, can you share what are you trying to achieve?
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Sun Sep 21, 2014 12:34 pm

I'm making effect editor in game
Image
B
4
S
1
Posts: 20
Reputation: 392

Post » Sun Sep 21, 2014 2:17 pm

What @DuckfaceNinja said. Link your effect parameters to variables. A bit of a workaround but you will have full control after that.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Sun Sep 21, 2014 2:47 pm

I made a quick thing, and i think it's what you needed?

Adjust HSL.capx
You do not have the required permissions to view the files attached to this post.
B
22
S
6
Posts: 244
Reputation: 2,690

Post » Sun Sep 21, 2014 8:19 pm

I combined Your Solution Wisdoms with variables instead of tween to and lite tween.
Works the same and event sheet look like this:
Image

I think this can be a temporary solution
B
4
S
1
Posts: 20
Reputation: 392


Return to How do I....?

Who is online

Users browsing this forum: Armench and 14 guests