playMaker

Author Topic: Randomize Bug[SOLVED]  (Read 660 times)

ch1ky3n

  • Junior Playmaker
  • **
  • Posts: 71
    • View Profile
Randomize Bug[SOLVED]
« on: July 30, 2018, 07:41:53 AM »
Hey All,

I encountered a small problem while updating the PMaker to the latest version. It is the new randomize action that features No Repeat. By default, it is ON/checked. While my state took variables of min and max from my database, there is a case where the min and the max difference is only 1 (Min 3 and Max 4). This will cause a bug and cost Unity to freeze. I wonder if this is a good report for you guys!

Thank You
« Last Edit: August 20, 2018, 12:36:04 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14126
  • Official Playmaker Support
    • View Profile
Re: Randomize Bug
« Reply #1 on: July 31, 2018, 01:16:21 AM »
Hi,

Yep, thanks for reporting this.

 which action exactly? I'll try to repro and escaladate a bug report.

 feel free to report on this via the PlayMaker bug report, We always welcome your input when you find issues.

Bye,

 Jean

ch1ky3n

  • Junior Playmaker
  • **
  • Posts: 71
    • View Profile
Re: Randomize Bug
« Reply #2 on: August 01, 2018, 01:21:14 PM »
I believe it is Randomize int
The “No Repeat” box is checked by default and could cause unity to freeze when the difference between min value and max value is 1
Like
Min 3
Max 4

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14126
  • Official Playmaker Support
    • View Profile
Re: Randomize Bug
« Reply #3 on: August 20, 2018, 12:21:12 AM »
Hi,

 good catch, Trying to find the issue at the moment.

 Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14126
  • Official Playmaker Support
    • View Profile
Re: Randomize Bug
« Reply #4 on: August 20, 2018, 12:35:52 AM »
Hi,

 Well, the problem is that if your min and max difference is 1 and you haven't checked "inclusive Max", then yes you have an issue if you don't want no repeat in the randomization.

 to fix the action ( while we push an update for the fix to be official)

replace line 52 of RandomInt to:

Code: [Select]
if (noRepeat.Value && max.Value != min.Value && (!inclusiveMax && (Mathf.Abs (max.Value - min.Value) > 1) ))
Bye,

 Jean
« Last Edit: August 20, 2018, 12:46:07 AM by jeanfabre »