playMaker

Author Topic: Bug with playmaker. Compare INT [Pictures]  (Read 1474 times)

soccergames

  • Playmaker Newbie
  • *
  • Posts: 4
Bug with playmaker. Compare INT [Pictures]
« on: September 06, 2017, 06:19:41 PM »
This is a clear bug, I've been wasting my time for ages now.

IF INT 1 IS HIGHER THAN INT 2 IT SHOULD GO TO "IS OVER" STATE. It does not, but clearly it shows INT 1 is 3 and INT 2 is 1 therefore it should to to "IS OVER"..

Must be a bug right?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Bug with playmaker. Compare INT [Pictures]
« Reply #1 on: September 07, 2017, 02:20:40 AM »
Hi,
how are you getting the variable value?

if you variable value is 0 on start and the value is set from somewhere it might read the 0 value before the new value is placed.

soccergames

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Bug with playmaker. Compare INT [Pictures]
« Reply #2 on: September 07, 2017, 06:40:56 AM »
Its variable its from a global int which is set to 0, but when character collides which object it increases int to 1. So at beginning I expect it to show "is under" but when I have more than 1 points it should go to "is over" state, it does not. In first screenshot you can clearly see the int 1 variable changed to be higher than int 2 but it didnt change state.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Bug with playmaker. Compare INT [Pictures]
« Reply #3 on: September 07, 2017, 08:02:43 PM »
Hi,
I think you don't understand yet how states/actions work

In your setup this will check at the start and it sees the 0 so it goes to the next state (state 1)
so now state 1 is active but the idle not anymore, so it is not checking anymore.

You could loop state 1 back but that would give an infinite loop error.

So there are different ways to approach this depending on your project.

for example :

Quote
Set only "greater than" and leave others empty and ever frame on.
This way it will only change to State 2 when greater than.

a different way you can use is :
Quote
place in state 1 an additional int compare and also set only "greater than" and leave others empty and ever frame on and connect that to state 2
This way you if less than you can do something when needed.

on state 2 you could also add an int compare and set Equal and Less than and connect to state one.
this is useful if the int goes down also and you would want to go back to state 1

btw you can find many tutorials here to get you started :)