(solved)Effect value animation with lerp and without lerp

Get help using Construct 2

Post » Sat May 09, 2015 10:38 am

I tried to made one sprite slowly tween to grayscale, but even i have put the lerp values correclty (i think so) it won't work. So I'm again stuck with this and cannot find working clear enough tutorial for it. :(

Image
Last edited by sorbias on Sun May 10, 2015 4:14 pm, edited 2 times in total.
B
11
S
1
Posts: 63
Reputation: 658

Post » Sat May 09, 2015 10:51 am

At least one parameter in your lerp expression needs to change (so either vary the starting value (set it to the current value for example) or modulate the last value). The way you have set it up now, it will stay at 50.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Sat May 09, 2015 11:21 am

Okay, then i have not understood the lerp correctly. I thought that the first value is 0, second value is 100 and 0.5 is the time it takes for the tween between those two values. Now i have no idea what those values actually are.

How should i change that then?
B
11
S
1
Posts: 63
Reputation: 658

Post » Sat May 09, 2015 11:33 am

Lerp calculates like this:
lerp(a, b, c) = c * (b - a) + a


ashley posted something about lerping with dt:
https://www.scirra.com/blog/ashley/17/u ... delta-time
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Sat May 09, 2015 1:52 pm

Dang, it feels so stupid and unnecessary to use this kind of maths for one very simple task... They really need to develop this program further, so this kind of stuff would be history and everybody would laugh to what we needed to do in past...

I'm very familiar with programs that uses some key framing techniques (3d-modeling, animation, video editing etc.) , but construct 2 don't know those basic tricks and it makes the game development very much slower in this kind of situations that I know it would've be.
B
11
S
1
Posts: 63
Reputation: 658

Post » Sat May 09, 2015 2:06 pm

behavior-litetween_t70700 is for you, then

"You can also control effect's parameter with LiteTween if you use this behavior by rex_rainbow.
Tween2Effect by rex_rainbow "
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Sun May 10, 2015 1:01 pm

What are "a", "b" and "c"? My language is not advanced enough that i could understand it very well from that blog. Thants why im asking silly questions here on forum.. :/

This is what i get:

Deltatime is the time that you need to get the finished frame. But i don't know what of those a, b or c is dt, so I don't know how should i use that info. Also I don't know about the other values or even the reason why should i use that function for this tween effect.

I did not found Tween2Effect and LiteTween very useful either. Lack of documentation made them hard to use and i did not get how to made them working in my case. (i did not found my effect from the list of "tween2effect"

Here is what i tried to do, but it did not work:
Image

Actually i found a video tutorial for Unity 3d, that made lerp more clear for me than this blog tutorial i saw earlier in C2 site. Here is the Unity tutorial:
https://www.youtube.com/watch?v=cD-mXwSCvWc

So I almost get it, but still. ah..
B
11
S
1
Posts: 63
Reputation: 658

Post » Sun May 10, 2015 2:01 pm

Image
B
65
S
23
G
7
Posts: 1,502
Reputation: 10,890

Post » Sun May 10, 2015 2:47 pm

@korbaaach thank you very very much! :)

Here is picture of korbaaach solution that works very well:
Image
Last edited by sorbias on Sun May 10, 2015 4:22 pm, edited 2 times in total.
B
11
S
1
Posts: 63
Reputation: 658

Post » Sun May 10, 2015 3:22 pm

Ok, I did finally do it WITHOUT using lerp at all. If somebody is interested, here is my solution:
Image

I don't know how stupid or wise my solution is, but it works. Now when my block has been sleeping 15 seconds, it will add every 0.01 second 1 to gray number variable and at the same time it will change grayScale effect parameter to that variable.

Now i just need to re do this to all of my different sprites that need to have this feature.
B
11
S
1
Posts: 63
Reputation: 658


Return to How do I....?

Who is online

Users browsing this forum: plinkie, zenox98 and 15 guests