playMaker

Author Topic: Float Compare to 0 ? [SOLVED]  (Read 2315 times)

Wayne191

  • Playmaker Newbie
  • *
  • Posts: 28
Float Compare to 0 ? [SOLVED]
« on: July 07, 2017, 12:18:42 AM »
Hi,

I am comparing a Variable A to 0 using Float Compare action. For some reason, all three events Equal, Less Than, Great Than got sent out. I even set a new float variable to be 0 and compare Variable A to the new float variable 0. It didn't work too.

How could that be possible? Anything I might did wrong?

Variable A: Subtract Variable B from Variable C

Thanks.
« Last Edit: July 23, 2017, 11:12:54 PM by Wayne191 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Float Compare to 0 ?
« Reply #1 on: July 07, 2017, 04:32:50 AM »
Hi,
Can you show a picture from your state, i just tried on my end and it seems to work fine here

Wayne191

  • Playmaker Newbie
  • *
  • Posts: 28
Re: Float Compare to 0 ?
« Reply #2 on: July 07, 2017, 05:51:48 AM »
Here is the screenshot. I also tried to make float 1 to be 0 after subtract and it didn't work as well.

Thanks djaydino. You are always very helpful.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Float Compare to 0 ?
« Reply #3 on: July 07, 2017, 01:18:31 PM »
Hi,
I can see that you got a lot going on in this fsm :)

on the float compare,is the 'float 2' always 0?
If so click on the '=' and set 0 as value instead of using a variable.

Also if you right click on a state name, you can set a breakpoint.

This will pause the game when it reaches that state. but it will not execute it yet.
when you unpause, it will go to the next state.

You can set on the next ones also breakpoints so you can see where it goes next. (very usefull for debugging :) )

The 'Float Compare' action should be working.
Try on a new scene a simple setup with a float compare and see if that works.

i you can't find the problem, let me know.

Wayne191

  • Playmaker Newbie
  • *
  • Posts: 28
Re: Float Compare to 0 ?
« Reply #4 on: July 13, 2017, 06:05:11 AM »
Found out the issue. Thanks for help.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Float Compare to 0 ?
« Reply #5 on: July 13, 2017, 06:08:48 AM »
Hi.
No problem, what was the issue?

Wayne191

  • Playmaker Newbie
  • *
  • Posts: 28
Re: Float Compare to 0 ?
« Reply #6 on: July 13, 2017, 06:45:51 AM »
There are lots of things going on in this FSM.

The float compare > and < were actually sent in two different cycles and two cycles are not through the same route. One of the variables is > 0 in the first cycle, but is <0 in the 2nd cycle. I thought both > and < were sent in the same cycle. Breakpoints are helpful.  :)


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Float Compare to 0 ?
« Reply #7 on: July 13, 2017, 07:01:03 AM »
Hi,
Breakpoints are indeed very helpfull also the 'debug' actions are usefull :)

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Float Compare to 0 ?
« Reply #8 on: July 13, 2017, 07:27:31 AM »
I have a short youtube tutorial video that goes through 5 tips for debugging with playmaker. You may find it helpful as well:

Wayne191

  • Playmaker Newbie
  • *
  • Posts: 28
Re: Float Compare to 0 ?
« Reply #9 on: July 13, 2017, 11:08:44 PM »
Thank you.