Basic math problem

So in my mind this adds/subtracts by 1 for each time one of the events activates. But the first time one of the event activates it adds/subtracts 3. And the consecutive times it fires after that, it adds/subtracts by 1. So if I activate increase skill it reads like +3+1+1+1+1 etc. If I then activate decrease skill it’s the same. If I after that activate increase skill again, it starts of with a +3 like the first time.

Is there something I’m doing wrong or is it a bug? As far as I know it doesn’t get activated 3 times the first time either.

Are you sure the event doesn’t just fire 3 times on the first time? Stick a breakpoint on the SETs and see how the values are changing in debug.

Yeah you need to look at whatever is calling the events because everything here looks in order.

**** I misread this, what is the default value for SkillPoints?

The events are fired by pressing the buttons + and -. After a bit of debugging, the Skill Point variable itself is adds itself correctly each time. But the A+B math node sends out different numbers to the Set Variable node and the Int to String node. So when the Set Variable node sets Skill Points to 1, it sends out the number 2 to be converted to string and printed on screen. Since it adds itself again when it reaches the Print String node. Fixed by connecting the Skill Points variable directly to the Convert to String node :slight_smile:

Just me failing to pull a shortcut apparently.

Thanks for the help :slight_smile: