playMaker

Author Topic: Help recreating "If statement" in playMaker [SOLVED]  (Read 2088 times)

spiralKing

  • Junior Playmaker
  • **
  • Posts: 50
Help recreating "If statement" in playMaker [SOLVED]
« on: April 07, 2014, 06:18:26 PM »
Trying to recreate this in playMaker

Code: [Select]

If (x == 3 || x > 1.5 && x < 3.6)

{
 x = 3;
}

« Last Edit: May 25, 2014, 11:46:28 PM by spiralKing »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help recreating "If statement" in playMaker
« Reply #1 on: April 08, 2014, 07:09:21 AM »
Hi,

your snippet doesn't make sense that if x==3 then x=3...

anyway:

 ok, in 1 state

1: x==3 : use int compare and fire a "FALSE" transition
2: x > 1.5 : use int compare again but exit only if "Less than"
3: x < 3.6 : use int compare again but exit only if "Greater then"
4: if you reach here, then the expression is statisfied. you can then send an event of even transit using FINISH event, cause you know that if you reach that FINISH event it's because ou met all rules.

Bye,

 Jean

spiralKing

  • Junior Playmaker
  • **
  • Posts: 50
Re: Help recreating "If statement" in playMaker
« Reply #2 on: May 25, 2014, 11:45:36 PM »
Quote
doesn't make sense that if x==3 then x=3...
I see what you mean

Thanks