playMaker

Author Topic: problem with Int Add Multiple [SOLVED]  (Read 1356 times)

curb47

  • Sr. Member
  • ****
  • Posts: 256
problem with Int Add Multiple [SOLVED]
« on: March 24, 2022, 07:12:51 AM »
Hello,

I'm trying to add 4 Integers, and then compare the total with a value. If the total is equal to a certain amount then do something.

In the action I have set up 4 Int (Elements) and at the bottom set a variable for the 'Add To' total. The problem is, each time the action is called, it keeps adding to the previous Add To amount, rather than refreshing each time. I'm trying to set up a state where each time it's called it adds 4 Ints together to give a result, and then i can compare this result.

The Add To part is really throwing me.

It's almost like I need a Int Operator Multiple instead, which could simply add the 4 Ints and then Store Result.

Actually, that's what Int Add Multiple needs - a Store Result, instead of the Add To parameter.

Any thoughts?

Thanks in advance.

« Last Edit: March 24, 2022, 01:02:47 PM by curb47 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: problem with Int Add Multiple
« Reply #1 on: March 24, 2022, 12:19:29 PM »
Hi.
Before the int add, you could do a 'Set Int Value' then do the int add to that and compare.

curb47

  • Sr. Member
  • ****
  • Posts: 256
Re: problem with Int Add Multiple
« Reply #2 on: March 24, 2022, 12:49:05 PM »
Hi,
Thanks, I'll try that.

curb47

  • Sr. Member
  • ****
  • Posts: 256
Re: problem with Int Add Multiple
« Reply #3 on: March 24, 2022, 01:02:26 PM »
Thanks, that actually worked. I had actually Set Int Value in a previous attempt, but had put the action after the Int Add Multiple, which in my mind should do the same thing, but didn't. I guess there was a logic tangle somewhere.

So yeah, great, thank you!