[REQUEST] Sine action "RESET"

Discussion and feedback on Construct 2

Post » Wed Jun 05, 2013 9:54 pm

This DOES seem like a simple implementation. Just like period offset, except can be set anytime instead of only the initial starting point.

Worry not, for I've found a nice solution if you want to restart the sine!



Setting the Sine period to 0 will always keep the cycle position at 0, so you can abuse that to quickly reset the sine to the start.

However, it's still not as fluid as a Set Period option. I'm honestly surprised it hasn't been done already. Why not, guys?
B
19
S
5
G
1
Posts: 104
Reputation: 2,920

Post » Sat Feb 22, 2014 7:09 pm

I downloaded the CAPX for better sine control (+1 for sine reset function too!), but C2 tells me to update to Sine 1.1. Where can I get it? I do not find it on Google :( And by the way, thanks to everybody contributing to this thread, sine is an important feature. Personally, I would also like to see Bezier Curves (but thanks to this thread I can manage to do everything using sines only, yeah!!), not everything can be simulated correctly through physics.

My game is a bit like Shank and Mark of the Ninja; when I get close enough to an ennemy and attacks, I am making him jump towards the ennemy to kill it with a precise knife stab. If I'd make that jumping attack with animation, I would have many problems, especially with collisions, and that would look overly bad. I will use Sine to make the hero jump to that ennemy now. I will most likely do a very small invisible zone each side of the ennemy, that when overlapping and attacking, triggers Sine and the jump-attack animation. I will adjust the Sine curve accordingly. If I decide to make those two zones merging into only 1 big one instead (so that jump-attack can be triggered at any place near the ennemy, instead of at a fixed distance from him; not too far, not too close), then I will most likely adjust the Sine's curve to be dependant of the distance between the player and the ennemy, so that it always land correctly.
B
9
S
4
G
1
Posts: 18
Reputation: 1,315

Post » Thu Jun 05, 2014 8:39 pm

Ahm, this CAPX was made before I decided to repack the Sine with RESET as Sine Extended (to be found in this same thread LINK). Previously I just had changed the original Scirra Sine version to 1.1 in order to not mix up with the original version 1.0. It was not a clean solution because it was always overwritten by every new C2 update.
B
11
S
3
G
3
Posts: 79
Reputation: 3,343

Post » Tue Jul 22, 2014 1:59 pm

How do i make it do exactly 1 cycle or half cycle with sinx or sin behavior ? Even for every tick i am checking the HelpNotifictions.SineExtended.CyclePosition , i am not getting 1 to say 1 cycle is completed. Please let me know if there is any other way.

Baiscally i am trying to set this behavior for my notifications icon, zoom from the current size and reach back to the same size and stop, this will do may be for every 10 secs.
B
16
S
4
Posts: 248
Reputation: 2,267

Post » Mon Sep 29, 2014 9:04 pm

Sorry, that I'm answering so late.

You don't need a Reset (i.e. the sinx) for your task. You just need one full sine cycle like from 0.25 through 0.99...0 and back to 0.24. Sine never reaches the value 1 for its CyclePosition. I've tried with 0.99 as stopping condition and it works with it, but no more with 0.999. Anyway, here is an example of what you need to use the standard sine function: CAPX with the normal C2 sine function

Other links:
No more Sine 1.1: New CAPX of the old example with the sinx "plug-in" now
SineExtended plug-in: sinx.zip
B
11
S
3
G
3
Posts: 79
Reputation: 3,343

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests