Sine behavior angle update bug

Bugs will be moved here once resolved.

Post » Mon Sep 25, 2017 8:23 am

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.
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,283
Reputation: 47,550

Post » Tue Oct 24, 2017 9:26 am

Please, could this be fixed for the next beta?
B
31
S
13
G
21
Posts: 843
Reputation: 14,691

Post » Tue Oct 31, 2017 4:42 pm

@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:

Code: Select all
//this.mag = cr.to_radians(this.mag);


Then insert this text at line 71:

Code: Select all
if (this.movement === 5){
         this.mag = cr.to_radians(this.mag);
      }


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).
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,283
Reputation: 47,550

Post » Tue Oct 31, 2017 4:44 pm

Colludium wrote:@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:

Code: Select all
//this.mag = cr.to_radians(this.mag);


Then insert this text at line 71:

Code: Select all
if (this.movement === 5){
         this.mag = cr.to_radians(this.mag);
      }


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.
B
31
S
13
G
21
Posts: 843
Reputation: 14,691

Post » Wed Nov 15, 2017 12:41 pm

Thanks, should be fixed in the next build.
Scirra Founder
B
402
S
238
G
89
Posts: 24,613
Reputation: 195,993


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests