playMaker

Author Topic: How to subtract from an Int with a variable  (Read 2751 times)

MarkD

  • Full Member
  • ***
  • Posts: 113
How to subtract from an Int with a variable
« on: March 15, 2014, 02:47:38 AM »
I'm trying to subtract an Int stored as a variable with an Int also stored as a variable.  I've found an action that lets me add an Int as a variable, but there doesn't seem to be anything specifically for subtracting with a variable as an Int.

I read through the Wiki and found the Int Operator, but either it's not working or (more likely) I'm using it wrong.  Any ideas anyone?

Maybe a couple of pictures would help:

In this FSM, I'm trying to reduce Credits_int by the variable purchaseCost to give a new result "Credits_total". 

Then I'm setting my original Credits_int to be the new value.  However this isn't working.


Here's the same FSM, only showing an Add Int with a variable.  This FSM works perfectly.. except that my credit total is going up when I really want it to go down! :)



MarkD

  • Full Member
  • ***
  • Posts: 113
Re: How to subtract from an Int with a variable
« Reply #2 on: March 15, 2014, 03:35:26 AM »
Boom!  Worked like a charm.  Thank you!