playMaker

Author Topic: Odd behavior with Float Compare - anyone seen this before? [SOLVED]  (Read 1704 times)

MarkD

  • Full Member
  • ***
  • Posts: 113
In one of my FSM's, I'm comparing against a distance to send an event if the target is in range for an attack or if it's too far away and has 'escaped'.  I have two Float Compares back to back and in both cases I've left Greater than or Less than empty.   

But regardless of the distance I'm comparing against, it ALWAYS sends "Attack". 

FYI - The photo is faded out because I'm pausing the client to show you a snapshot of the moment in time. 

Am I doing something wrong logically, or is this a bug perhaps?

« Last Edit: January 14, 2016, 02:41:42 AM by MarkD »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Odd behavior with Float Compare - anyone seen this before?
« Reply #1 on: January 14, 2016, 02:23:19 AM »
Hi,

 if your state is going to fire an event based on the float comparision for all cases, then why use "everyframe" since you expect an event to be sent everytime? try to turn off all everyframe in that state and test again.

 Bye,

 Jean

MarkD

  • Full Member
  • ***
  • Posts: 113
Re: Odd behavior with Float Compare - anyone seen this before? [SOLVED]
« Reply #2 on: January 14, 2016, 02:41:15 AM »
Hey Jean - thanks for the quick reply!

Unchecking didn't work, but after banging my head against my desk (for the 20th time tonight) it suddenly hit me.  I've got a transition named "attack" in two places in this FSM.  Annnd it just so happens that I'm calling "attack" from another FSM. 

Lesson learned - use unique transitions inside each FSM. :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Odd behavior with Float Compare - anyone seen this before? [SOLVED]
« Reply #3 on: January 14, 2016, 11:59:54 AM »
ouch :)

Learning the hard way is the best way to remember it...

Bye,

 Jean