[REQUEST] Sine action "RESET"

0 favourites
From the Asset Store
11 loops of RPG, chiptune/8-bit music. Suitable for any pixel art game.
  • I +69 this!! Would be very useful in my boss fights. The movements eventually get out of whack because I cant reset sine.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Following the firebelly's note, I allowed myself to take the original Sine behavior, extend it with the Sine Reset function and re-pack it. To be found for download HERE

    Please extract it directly into a new directory: ...\Construct2\exporters\html5\behaviors\sinx

    Restart C2 after that. The new behavior appears next to the standard Sine and would not be replaced after C2 update.

  • It is better not to update yourself the officials behaviors/plugins XManBG

  • Thanks and yes, I know, and if Scirra minds it, I'll remove the link. Anyway that's a temporary solution until its real implementation.

  • 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!

    <img src="http://puu.sh/398jw.png" border="0" />

    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?

  • 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.

  • 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.

  • 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.

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)