Sine behavior angle update bug

0 favourites
  • 5 posts
From the Asset Store
Fantasy Game includes more than 600 sound effects inspired by hit computer games like World of Warcraft and Diablo.
  • Problem Description

    The "update sine initial state" action causes the Init() function in the plugin to run to set the initial conditions. When angle sine is the selected mode, the Init() function converts the magnitude from degrees to radians, which is ok for the first Init() but for subsequent updates the function factors this.mag (already in radians) to radians again.

    Attach a Capx

    capx

    Description of Capx

    Two objects, one with sine (oscillate angle). Right arrow key to rotate second object and reset initial conditions of sine object.

    Steps to Reproduce Bug

    • Right arrow key
    • Observe the oscillation apparently stops

    Observed Result

    The object appears to stop oscillating because the sine oscillation angle size becomes very small.

    Expected Result

    The degrees to readians conversion in Init() should only run during OnCreate() and not when updating the initial prams, because the angles are already in radians.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    W10 x64.

    Construct 2 Version ID

    r247 64 bit.

  • Please, could this be fixed for the next beta?

  • the Mnk,

    Looks like it's not been fixed for this update. Here's how to fix the problem:

    Open the Sine Behavior runtime.js and make the following changes:

    Comment out line 131:

    //this.mag = cr.to_radians(this.mag);[/code:22on3kg9]
    
    Then insert this text at line 71:
    
    [code:22on3kg9]if (this.movement === 5){
    			this.mag = cr.to_radians(this.mag);
    		}[/code:22on3kg9]
    
    If you make these changes then beware that you're modifying an official plugin (so downloading an update will wipe away these fixes until scirra fix the problem themselves).
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • the Mnk,

    Looks like it's not been fixed for this update. Here's how to fix the problem:

    Open the Sine Behavior runtime.js and make the following changes:

    Comment out line 131:

    //this.mag = cr.to_radians(this.mag);[/code:ie46qv0z]
    
    Then insert this text at line 71:
    
    [code:ie46qv0z]if (this.movement === 5){
    			this.mag = cr.to_radians(this.mag);
    		}[/code:ie46qv0z]
    
    If you make these changes then beware that you're modifying an official plugin (so downloading an update will wipe away these fixes until scirra fix the problem themselves).
    

    Thanks for this info.

    I will prove it.

  • Thanks, should be fixed in the next build.

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